Improve swap_mode command

This commit is contained in:
Alex Selimov 2025-10-06 20:02:46 -04:00
parent 47b0bbbdc5
commit dc6c3cda99
Signed by: aselimov
GPG key ID: 3DDB9C3E023F1F31
6 changed files with 45 additions and 6 deletions

View file

@ -7,7 +7,7 @@
set -e
dmenu="dmenu -theme-str 'window {width: 25%;}' -i -p Emoji"
dmenu="dmenu -theme-str 'window {width: 50%;}' -i -p Emoji"
case "$1" in
"list")
data=$(sed '0,/^__DATA__$/d' "$0")

View file

@ -2,9 +2,11 @@
NVIM_CONF="${HOME}/.config/nvim/init.lua"
GHOSTTY_CONF="${HOME}/.config/ghostty/config"
DUNST_CONF="${HOME}/.config/dunst/dunstrc"
[ -f "$NVIM_CONF" ] || { echo "Missing $NVIM_CONF"; exit 1; }
[ -f "$GHOSTTY_CONF" ] || { echo "Missing $GHOSTTY_CONF"; exit 1; }
[ -f "$DUNST_CONF" ] || { echo "Missing $DUNST_CONF"; exit 1; }
set_light_mode() {
sed -E -i 's/^([[:space:]]*theme[[:space:]]*=[[:space:]]*)zenwritten-dark/\1zenwritten-light/' "$GHOSTTY_CONF"
@ -64,18 +66,47 @@ if [ "$(uname)" != "Darwin" ]; then
# GTK Theme
gsettings set org.gnome.desktop.interface gtk-theme ''
gsettings set org.gnome.desktop.interface gtk-theme 'WhiteSur-Dark'
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "WhiteSur-Dark"@' ~/.xsettingsd
# Rofi theme
sed -i -e "s/light.rasi/dark.rasi/" $HOME/.config/rofi/config.rasi
# Swap dunst urgency_low background and foreground
sed -E -i '/^\[urgency_low\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#8e8e8e"/
}' "$DUNST_CONF"
# Swap dunst urgency_normal background and foreground
sed -E -i '/^\[urgency_normal\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#BBBBBB"/
}' "$DUNST_CONF"
else
echo "Swapping to light mode"
# GTK Theme
gsettings set org.gnome.desktop.interface gtk-theme ''
gsettings set org.gnome.desktop.interface gtk-theme 'WhiteSur-Light'
gsettings set org.gnome.desktop.interface color-scheme 'default'
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "WhiteSur-Light"@' ~/.xsettingsd
# Swap dunst urgency_low background and foreground
sed -E -i '/^\[urgency_low\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#8e8e8e"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
}' "$DUNST_CONF"
# Swap dunst urgency_normal background and foreground
sed -E -i '/^\[urgency_normal\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#BBBBBB"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#191919"/
}' "$DUNST_CONF"
# Rofi theme
sed -i -e "s/dark.rasi/light.rasi/" $HOME/.config/rofi/config.rasi
fi
killall dunst
killall -HUP xsettingsd
fi

View file

@ -1,7 +1,7 @@
# --- Basics
font-family = "IosevkaTermSlab Nerd Font Propo"
font-style = "Regular"
font-size = 12
font-size = 11
background-opacity = 1.0
window-decoration = none
confirm-close-surface = false

View file

@ -2,5 +2,8 @@
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env
export PATH="$PATH:/usr/local/cuda-12.8/bin:$HOME/bin"
export PATH="$PATH:/usr/local/cuda-12.8/bin:$HOME/bin:$HOME/.local/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-12.8/lib64"
export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
export ANTHROPIC_AUTH_TOKEN="$(pass list zai_token)"

View file

@ -2,5 +2,5 @@
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env
export PATH="$PATH:/usr/local/cuda-12.8/bin:$HOME/bin"
export PATH="$PATH:/usr/local/cuda-12.8/bin:$HOME/bin:$HOME/.local/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-12.8/lib64"

View file

@ -16,6 +16,8 @@ setopt HIST_IGNORE_SPACE # Don't save commands starting with space
# Environment Variables
#==============================================================================
source ~/.profile
export OMPI_MCA_rmaps_base_oversubscribe=1
export CLICOLOR=1
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
@ -106,10 +108,13 @@ gemini() {
unset -f nvm node npm gemini
load_nvm
gemini "$@"
}
claude() {
unset -f claude
npm 2>&1 1>/dev/null
claude "$@"
}
# ghcup
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env