Skip to content

Commit

Permalink
fx: various fixes for profiles and userChrome
Browse files Browse the repository at this point in the history
  • Loading branch information
trapd00r committed Nov 12, 2023
1 parent 4dc49de commit 1e3878c
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 32 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -13,6 +13,7 @@
* [1984](https://github.com/trapd00r/utils/blob/master/1984) - fun with pv
* [absname](https://github.com/trapd00r/utils/blob/master/absname) - you can't trust $PWD in linux
* [abstract](https://github.com/trapd00r/utils/blob/master/abstract) - extract abstract from given file(s)
* [add_userchrome_to_all_profiles.zsh](https://github.com/trapd00r/utils/blob/master/add_userchrome_to_all_profiles.zsh) - copies userChrome.css to all profiles in Firefox
* [album](https://github.com/trapd00r/utils/blob/master/album) - get a quick list of albums by name
* [albumlist](https://github.com/trapd00r/utils/blob/master/albumlist) - display all albums by artist
* [albums_by_artist](https://github.com/trapd00r/utils/blob/master/albums_by_artist) - display all unique albums by artist
Expand Down
3 changes: 3 additions & 0 deletions add_userchrome_to_all_profiles.zsh
@@ -0,0 +1,3 @@
#!/usr/bin/zsh
# abstract: copies userChrome.css to all profiles in Firefox
for x in ${HOME}/.mozilla/firefox/*.*/chrome(/); do cp -v ${HOME}/dev/utils/userChrome.css ${x}/userChrome.css; done
6 changes: 5 additions & 1 deletion fx_vscreen_profiles
Expand Up @@ -7,7 +7,11 @@
# We must create a profile for each vscreen using firefox -P first, then enable
# sync so we get all the bookmarks and settings

# Related: fx_screen_profiles
# Related:
# - www
# - fx_screen_profiles
# - userChrome.css
# - add_userchrome_to_all_profiles.zsh once done

use strict;
use warnings FATAL => 'all';
Expand Down
59 changes: 59 additions & 0 deletions userChrome.css
@@ -0,0 +1,59 @@
#navigator-toolbox:not(:hover):not(:focus-within) #toolbar-menubar > * {
background-color: rgb(232, 232, 231);
}

#main-window[sizemode="maximized"] #content-deck {
padding-top: 8px;
}

tabs {
counter-reset: tab-counter;
}

.tab-label::before {
counter-increment: tab-counter;
content: counter(tab-counter) " - ";
}

:root:not([customizing]) #navigator-toolbox:not(:hover):not(:focus-within) #nav-bar {
max-height: 0;
min-height: 0!important;
--tridactyl-auto-show-zone: 10px;
margin-bottom: calc(-1 * var(--tridactyl-auto-show-zone));
opacity: 0;
}

#navigator-toolbox::after {
display: none !important;
}

#statuspanel {
right: 0;
display: inline;
}

statuspanel[type="overLink"],
#statuspanel[type="overLink"] {
display: none !important;
}

#tabs-newtab-button {
display: none !important;
}

.tabbrowser-tab[selected="true"] .tab-background {
background: #575757 none !important;
}

#navigator-toolbox {
--lwt-tabs-border-color: transparent !important;
}

#tabbrowser-tabs {
--lwt-tab-line-color: transparent !important;
}


#alltabs-button {
display: none !important;
}
46 changes: 15 additions & 31 deletions www
Expand Up @@ -4,38 +4,22 @@
if [[ $(hostname) = "x1" ]]; then
fx_vscreen_profiles "$@"
elif [[ $(hostname) = "fantomen" ]]; then
fx_screen_profiles "$@"

# current screen number of the active monitor
# 2 = middle
CURRENT_SCREEN=$(sdorfehs -c sdump|sed -E 's/,/\n/g'|grep -P ' 1$'|awk '{print $2}')

# if we are on the middle screen we want to use the vscreen profiles on the
# other monitors we can use the screen_profiles since vscreens are hardly
# used there
if [[ $CURRENT_SCREEN == 2 ]]; then
echo $CURRENT_SCREEN
fx_vscreen_profiles "$@"
else
fx_screen_profiles "$@"
fi
else
firefox
fi

#XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
#
## Allow users to override command-line options
#if [[ -f $XDG_CONFIG_HOME/chrome-flags.conf ]]; then
# CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/chrome-flags.conf)"
#fi
#
## smaller ui elements
## --high-dpi-support=0 --force-device-scale-factor=0.82
## Launch
#
#export GTK_THEME=japh
## env GTK_THEME=japh
#
#if [[ $(hostname) = "sid" ]]; then
# exec env GTK_THEME=japh /opt/google/chrome/google-chrome $CHROME_USER_FLAGS \
# --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
# --high-dpi-support=1 \
# --force-device-scale-factor=0.82 "$@"
#elif [[ $(hostname) = "fantomen" ]]; then
# exec env GTK_THEME=japh /usr/bin/google-chrome-stable $CHROME_USER_FLAGS \
# --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
# --high-dpi-support=1 \
# --force-device-scale-factor=0.82 "$@"
#elif [[ $(hostname) = "tp" ]]; then
# exec /opt/google/chrome/google-chrome $CHROME_USER_FLAGS \
# --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
# --high-dpi-support=1 \
# --force-device-scale-factor=1 "$@"
#fi
# remember to execute add_userchrome_to_all_profiles.zsh once done

0 comments on commit 1e3878c

Please sign in to comment.