This commit is contained in:
vinceliuice
2025-08-10 13:19:59 +08:00
parent b60f91605a
commit 1c4e533ab7
5 changed files with 104 additions and 8 deletions

View File

@@ -758,9 +758,6 @@ install_firefox_theme() {
remove_firefox_theme
udo mkdir -p "${TARGET_DIR}"
udo cp -rf "${FIREFOX_SRC_DIR}"/customChrome.css "${TARGET_DIR}"
mkdir -p "${TARGET_DIR}"
cp -rf "${FIREFOX_SRC_DIR}/${theme_name}" "${TARGET_DIR}"
[[ -f "${TARGET_DIR}"/customChrome.css ]] && mv "${TARGET_DIR}"/customChrome.css "${TARGET_DIR}"/customChrome.css.bak
@@ -798,6 +795,82 @@ install_firefox_theme() {
config_firefox
}
link_firefox_theme() {
if has_snap_app firefox; then
local TARGET_DIR="${FIREFOX_SNAP_THEME_DIR}"
elif has_flatpak_app org.mozilla.firefox; then
local TARGET_DIR="${FIREFOX_FLATPAK_THEME_DIR}"
else
local TARGET_DIR="${FIREFOX_THEME_DIR}"
fi
if [[ "${colorscheme}" == '-nord' && "${adaptive}" == '-adaptive' ]]; then
local theme_type="${adaptive}"
else
local theme_type="${darker}${adaptive}${colorscheme}"
fi
remove_firefox_theme
mkdir -p "${TARGET_DIR}/${theme_name}"
ln -sf "${FIREFOX_SRC_DIR}/${theme_name}"/colors "${TARGET_DIR}/${theme_name}"/colors
(
cd "${FIREFOX_SRC_DIR}/${theme_name}"
for file_name in `ls *.css`; do
ln -sf "${FIREFOX_SRC_DIR}/${theme_name}/${file_name}" "${TARGET_DIR}/${theme_name}/${file_name}"
done
)
ln -sf "${FIREFOX_SRC_DIR}"/common/icons "${TARGET_DIR}/${theme_name}"/icons
ln -sf "${FIREFOX_SRC_DIR}"/common/pages "${TARGET_DIR}/${theme_name}"/pages
if [[ "${colorscheme}" == '-nord' ]]; then
ln -sf "${FIREFOX_SRC_DIR}"/common/titlebuttons-nord "${TARGET_DIR}/${theme_name}"/titlebuttons
else
ln -sf "${FIREFOX_SRC_DIR}"/common/titlebuttons "${TARGET_DIR}/${theme_name}"/titlebuttons
fi
(
cd "${FIREFOX_SRC_DIR}"/common
for file_name in `ls *.css`; do
ln -sf "${FIREFOX_SRC_DIR}"/common/"${file_name}" "${TARGET_DIR}/${theme_name}/${file_name}"
done
)
mkdir -p "${TARGET_DIR}/${theme_name}"/parts
(
cd "${FIREFOX_SRC_DIR}/${theme_name}"/parts
for file_name in `ls *.css`; do
ln -sf "${FIREFOX_SRC_DIR}/${theme_name}/parts/${file_name}" "${TARGET_DIR}/${theme_name}/parts/${file_name}"
done
)
(
cd "${FIREFOX_SRC_DIR}"/common/parts
for file_name in `ls *.css`; do
ln -sf "${FIREFOX_SRC_DIR}"/common/parts/"${file_name}" "${TARGET_DIR}/${theme_name}/parts/${file_name}"
done
)
[[ -f "${TARGET_DIR}"/userChrome.css ]] && mv "${TARGET_DIR}"/userChrome.css "${TARGET_DIR}"/userChrome.css.bak
cp -rf "${FIREFOX_SRC_DIR}"/userChrome-"${theme_name}${theme_type}".css "${TARGET_DIR}"/userChrome.css
[[ -f "${TARGET_DIR}"/userContent.css ]] && mv "${TARGET_DIR}"/userContent.css "${TARGET_DIR}"/userContent.css.bak
cp -rf "${FIREFOX_SRC_DIR}"/userContent-"${theme_name}${theme_type}".css "${TARGET_DIR}"/userContent.css
if [[ "${theme_name}" == 'Monterey' ]]; then
sed -i "s/left_header_button_3/left_header_button_${left_button}/g" "${TARGET_DIR}"/userChrome.css
sed -i "s/right_header_button_3/right_header_button_${right_button}/g" "${TARGET_DIR}"/userChrome.css
fi
if [[ "${firefoxtheme}" == 'Flat' && "${theme_name}" == 'Monterey' ]]; then
cp -rf "${FIREFOX_SRC_DIR}"/userChrome-Monterey-alt"${theme_type}".css "${TARGET_DIR}"/userChrome.css
ln -sf "${FIREFOX_SRC_DIR}"/WhiteSur/parts/headerbar-urlbar.css "${TARGET_DIR}"/Monterey/parts/headerbar-urlbar-alt.css
fi
}
config_firefox() {
if has_snap_app firefox; then
local TARGET_DIR="${FIREFOX_SNAP_THEME_DIR}"

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="m3 1c-1.662 0-3 1.338-3 3v8c0 1.662 1.338 3 3 3h10c1.662 0 3-1.338 3-3v-8c0-1.662-1.338-3-3-3h-10zm0 1h4.5v5h1v-5h4.5c1.108 0 2 0.892 2 2v8c0 1.108-0.892 2-2 2h-4.5v-4h-1v4h-4.5c-1.108 0-2-0.892-2-2v-8c0-1.108 0.892-2 2-2zm2.4004 3.9492c-0.15 0-0.30039 0.050391-0.40039 0.15039l-1.9004 2c-0.2 0.2-0.2 0.60078 0 0.80078l1.9004 1.9004c0.2 0.2 0.60078 0.2 0.80078 0s0.2-0.60078 0-0.80078l-1-1h6.3984l-1 1.0996c-0.2 0.2-0.2 0.60078 0 0.80078s0.60078 0.2 0.80078 0l1.9004-1.9004c0.2-0.2 0.2-0.60078 0-0.80078l-1.9004-2.0996c-0.2-0.2-0.60078-0.2-0.80078 0s-0.2 0.60078 0 0.80078l1 1.0996h-6.3984l1-1.0996c0.2-0.2 0.2-0.60078 0-0.80078-0.1-0.1-0.25039-0.15039-0.40039-0.15039z" fill="#ffffff"/>
</svg>

After

Width:  |  Height:  |  Size: 839 B

View File

@@ -721,7 +721,7 @@ toolbar:not([brighttext]) .webextension-browser-action:-moz-lwtheme {
/* side view extension */
#pageAction-urlbar-side-view_mozilla_org,
#sidebarswitcher_menu_side-view_mozilla_org-sidebar-action,
#sidebarswitcher_menu_side-view_mozilla_org-sidebar-action.webextension-menuitem,
#side-view_mozilla_org-BAP .toolbarbutton-icon,
#sidebar-box[sidebarcommand="side-view_mozilla_org-sidebar-action"] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon {
list-style-image: url("../icons/side-view.svg") !important;
@@ -731,6 +731,16 @@ toolbar:not([brighttext]) .webextension-browser-action:-moz-lwtheme {
background-image: url("../icons/side-view.svg") !important;
}
@media (prefers-color-scheme: dark) {
#side-view_mozilla_org-menuitem-_open-in-sidebar .menu-iconic-icon {
background-image: url("../icons/side-view-dark.svg") !important;
}
#sidebarswitcher_menu_side-view_mozilla_org-sidebar-action.webextension-menuitem {
list-style-image: url("../icons/side-view-dark.svg") !important;
}
}
/* Firefox note extension */
#notes_mozilla_com-BAP .toolbarbutton-icon,
#sidebarswitcher_menu_notes_mozilla_com-sidebar-action,

View File

@@ -16,8 +16,8 @@ $cakeisalie: "This stylesheet is generated, DO NOT EDIT";
-GtkWidget-text-handle-height: 20;
-GtkDialog-button-spacing: 6;
-GtkDialog-action-area-border: 4; // This is necessary to align buttons and elements inside windows.
-GtkDialog-content-area-border: 4;
-GtkDialog-action-area-border: 6; // This is necessary to align buttons and elements inside windows.
-GtkDialog-content-area-border: 6;
// We use the outline properties to signal the focus properties
outline-color: gtkalpha(currentColor, 0.15);

View File

@@ -46,6 +46,7 @@ usage() {
sec_helpify "4. darker" " Darker Firefox theme version" "" " Darker Firefox theme version"
sec_helpify "5. nord" " Nord Firefox colorscheme version" "" " Nord Firefox colorscheme version"
sec_helpify "6. adaptive" " Adaptive color version" " You need install adaptive-tab-bar-colour plugin first" " https://addons.mozilla.org/firefox/addon/adaptive-tab-bar-colour/"
sec_helpify "7. link" " Install links for theme" "" ""
helpify "-e, --edit-firefox" "[(monterey|flat)|alt|(darker|adaptive)]" " Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" ""
@@ -175,6 +176,10 @@ while [[ $# -gt 0 ]]; do
prompt -i "Firefox adaptive color version...\n"
prompt -w "You need install adaptive-tab-bar-colour plugin first: https://addons.mozilla.org/firefox/addon/adaptive-tab-bar-colour/\n"
shift ;;
link)
link="true"
prompt -i "Install links...\n"
shift ;;
esac
done
@@ -284,7 +289,8 @@ if [[ "${uninstall}" == 'true' ]]; then
prompt -s "Done! '${firefoxtheme}' Firefox theme has been removed. \n"
fi
else
show_needed_dialogs; customize_theme
# show_needed_dialogs
customize_theme
if [[ "${gdm}" == 'true' ]]; then
if [[ "${firefox}" == 'true' || "${edit_firefox}" == 'true' || "${flatpak}" == 'true' || "${snap}" == 'true' || "${dash_to_dock}" == 'true' ]]; then
@@ -323,7 +329,11 @@ else
if [[ "${firefox}" == 'true' && "${gdm}" != 'true' ]]; then
prompt -i "Installing '${firefoxtheme}' Firefox theme... \n"
install_firefox_theme
if [[ "${link}" == 'true' ]]; then
link_firefox_theme
else
install_firefox_theme
fi
prompt -s "Done! '${firefoxtheme}' Firefox theme has been installed. \n"
fi