Skip to content

Commit

Permalink
Renamed CSS file to GTKless, added transitioning to script to new fil…
Browse files Browse the repository at this point in the history
…ename, and removed borders workaround as the bug is finally fixed.
  • Loading branch information
dominichayesferen committed Dec 12, 2023
1 parent ae5bc8e commit 38a151a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
14 changes: 10 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ for directory in ~/.mozilla/firefox ~/.var/app/org.mozilla.firefox/.mozilla/fire
for profile in *; do if [ -f "$profile/prefs.js" ]; then
echo "Detected profile: $directory/$profile, installing Firefox GTKless to this profile..."
if [ -d "$profile/chrome" ]; then
if ! grep -q '/* FIREFOX GTKLESS STYLE CHECK HEADER -' "$profile/chrome/ferenChrome.css"; then
if ! grep -q '/* FIREFOX GTKLESS STYLE CHECK HEADER -' "$profile/chrome/GTKless.css" && ! grep -q '/* FIREFOX GTKLESS STYLE CHECK HEADER -' "$profile/chrome/ferenChrome.css"; then
bkupcounts=0
while [ -d "$profile/chrome.bak""$bkupcounts" ]; do
bkupcounts=$(($bkupcounts+1))
done
mv -f "$profile/chrome" "$profile/chrome.bak""$bkupcounts"
echo "Backed up your old userChrome folder to chrome.bak""$bkupcounts."
else #Delete old ferenChrome, but leave userChrome.css intact, if it's just an installation of GTKless
rm -f "$profile/chrome/ferenChrome.css"
else #Delete old GTKless, but leave userChrome.css intact, if it's just an installation of GTKless
if [ -f "$profile/chrome/ferenChrome.css" ]; then
rm -f "$profile/chrome/ferenChrome.css"
fi
rm -f "$profile/chrome/GTKless.css"
fi
fi
if [ ! -d "$profile/chrome" ]; then #On new installs, remake the chrome folder...
Expand All @@ -62,7 +65,10 @@ for directory in ~/.mozilla/firefox ~/.var/app/org.mozilla.firefox/.mozilla/fire
if [ ! -f "$profile/chrome/userChrome.css" ]; then #...and copy everything over.
cp -Rf "$DIR/mod-files/chrome/"* "$profile/chrome/"
else #If GTKless is already installed, only replace GTKless's CSS
cp -f "$DIR/mod-files/chrome/ferenChrome.css" "$profile/chrome/"
if grep -q 'ferenChrome.css' "$profile/chrome/userChrome.css"; then
sed -i 's/ferenChrome.css/GTKless.css/g' "$profile/chrome/userChrome.css"
fi
cp -f "$DIR/mod-files/chrome/GTKless.css" "$profile/chrome/"
fi
#Now it's user.js's turn
if [ -f "$profile/user.js" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,6 @@
}
}

/* Temporary fix for border radius not matching properly with Adwaita */
:root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #navigator-toolbox,
:root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) ::backdrop { /*browser.css:50, Firefox 120*/
border-top-left-radius: calc(env(-moz-gtk-csd-titlebar-radius) - 2px) !important;
border-top-right-radius: calc(env(-moz-gtk-csd-titlebar-radius) - 2px) !important;
}

/* Consistent rounding for rounded window option */
@media (-moz-bool-pref: "widget.gtk.rounded-bottom-corners.enabled") { /*browser.css:64, Firefox 120*/
body,
dialog::backdrop {
border-radius: calc(env(-moz-gtk-csd-titlebar-radius) - 2px) !important;
}
}

/* Cursed buttons from Firefox - browser.css:364, mostly, Firefox 114 */
.titlebar-button {
appearance: none !important;
Expand Down Expand Up @@ -238,7 +223,7 @@

color: var(--lwt-text-color) !important; /*TITLEBAR AREA*/
}
:not(:-moz-lwtheme) #navigator-toolbox { /*browser-shared.css:174, Firefox 120*/ /*TITLEBAR AREA, toolbar is managed by *browser.css:75, Firefox 120**/
:not(:-moz-lwtheme) #navigator-toolbox { /*browser-shared.css:174, Firefox 120*/ /* TITLEBAR AREA, toolbar is managed by *browser.css:75, Firefox 120* */
background: var(--lwt-accent-color) !important;
color: inherit !important;

Expand Down
4 changes: 2 additions & 2 deletions mod-files/chrome/userChrome.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/* insert other mods, above ferenChrome.css, here */
@import url("ferenChrome.css");
/* insert other mods, above GTKless.css, here */
@import url("GTKless.css");

0 comments on commit 38a151a

Please sign in to comment.