1 #!/bin/sh 2 3 # Set system color scheme to light 4 5 # requires neovim-remote and a custom function `LightTheme` that changes the 6 # vim color scheme to a light one 7 update_vim() { 8 instances=$(nvr --serverlist) 9 for instance in $instances; do 10 nvr -s --nostart --servername $instance \ 11 --remote-send "<Esc>:call LightTheme()<CR>" & 12 done 13 } 14 15 # Set light mode bg 16 # $HOME/.config/scheme/feh-light-bg & 17 18 # Set light mode lockscreen background, you will need your lockscreen background 19 # to point to `$HOME/.config/scheme/lockscreen-bg` 20 # ln -sf $HOME/.config/scheme/lockscreen-light-bg\ 21 # $HOME/.config/scheme/lockscreen-bg 22 23 # Update file flag. This file allows the scripts and other programs to keep 24 # track in which color scheme the system is currenlty in. 25 [ ! -d $HOME/.config/scheme ] && mkdir $HOME/.config/scheme & 26 rm -rf $HOME/.config/scheme/dark ||: & 27 touch $HOME/.config/scheme/light & 28 29 # Set gnome applications to light scheme 30 gsettings set org.gnome.desktop.interface color-scheme prefer-light & 31 32 # Requires st patched 33 pidof st | xargs kill -USR2 > /dev/null 2>&1 & 34 35 # requires a theme named default-light in kitty schemes folder 36 kitty +kitten themes --reload-in=all default-light & 37 38 update_vim & 39 40 # gtk and kde config files 41 gtk_conf="$HOME/.config/gtk-3.0/settings.ini" 42 kde_conf="$HOME/.config/qt5ct/qt5ct.conf" 43 44 sed -i 's/^gtk-theme-name=Adwaita-dark$/gtk-theme-name=Adwaita/' "$gtk_conf" & 45 sed -i \ 46 's/^gtk-icon-theme-name=Papirus-Dark$/gtk-icon-theme-name=Papirus-Light/' \ 47 "$gtk_conf" & 48 49 sed -i 's/^icon_theme=Papirus-Dark$/icon_theme=Papirus-Light/' $kde_conf & 50 sed -i 's/^style=Adwaita-Dark$/style=Adwaita/' $kde_conf & 51 perl -i -0 -pe\ 52 's/(?<=\[Colors:View\])([\s\S]*?\K)BackgroundNormal=([\s\S]*?)(?=\n)/BackgroundNormal=#FFFFFF/gm'\ 53 "$HOME/.config/kdeglobals" & 54 55 # Requires xsettingsd 56 perl -i -pe 's/(?<=Net\/ThemeName ")Adwaita-dark(?=")/Adwaita/'\ 57 "$HOME/.config/xsettingsd/xsettingsd.conf" 58 kill -HUP $(pidof xsettingsd) 59 60 wait