1 #!/bin/sh 2 3 # Set system color scheme to dark 4 5 # requires neovim-remote and a custom function `DarkTheme` that changes the 6 # vim color scheme to a dark 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 DarkTheme()<CR>" & 12 done 13 } 14 15 # Set dark mode bg 16 # $HOME/.config/scheme/feh-dark-bg & 17 18 # Set dark 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-dark-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/light ||: & 27 touch $HOME/.config/scheme/dark & 28 29 # Set gnome applications to dark scheme 30 gsettings set org.gnome.desktop.interface color-scheme prefer-dark & 31 32 # Requires st patched 33 pidof st | xargs kill -USR1 > /dev/null 2>&1 & 34 35 # requires a theme named default-dark in kitty schemes folder 36 kitty +kitten themes --reload-in=all default-dark & 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$/gtk-theme-name=Adwaita-dark/' "$gtk_conf" & 45 sed -i \ 46 's/^gtk-icon-theme-name=Papirus-Light$/gtk-icon-theme-name=Papirus-Dark/'\ 47 "$gtk_conf" & 48 49 sed -i 's/^icon_theme=Papirus-Light$/icon_theme=Papirus-Dark/' "$kde_conf" & 50 sed -i 's/^style=Adwaita$/style=Adwaita-Dark/' "$kde_conf" & 51 perl -i -0 -pe\ 52 's/(?<=\[Colors:View\])([\s\S]*?\K)BackgroundNormal=([\s\S]*?)(?=\n)/BackgroundNormal=#222222/gm'\ 53 "$HOME/.config/kdeglobals" & 54 55 # Requires xsettingsd 56 perl -i -pe 's/(?<=Net\/ThemeName ")Adwaita(?=")/Adwaita-dark/'\ 57 "$HOME/.config/xsettingsd/xsettingsd.conf" 58 kill -HUP $(pidof xsettingsd) 59 60 wait