Add light/dark mode toggle using xsettingsd
This commit is contained in:
parent
eb87e6387e
commit
f75d294a5b
4 changed files with 120 additions and 101 deletions
17
bin/swap_mode.sh
Executable file
17
bin/swap_mode.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script for changing between light and dark modes
|
||||
mode=$(grep "light_mode = " ~/.wezterm.lua | cut -d "=" -f 2 | tr -d " ")
|
||||
if [ "$mode" = "true" ]; then
|
||||
echo "Swapping to dark mode"
|
||||
sed -i -e "s/local light_mode =.*/local light_mode = false/" ~/.wezterm.lua
|
||||
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "Orchis-Grey-Dark"@' ~/.xsettingsd
|
||||
sed -i -e "s/light.rasi/dark.rasi/" $HOME/.config/rofi/config.rasi
|
||||
else
|
||||
echo "Swapping to light mode"
|
||||
sed -i -e "s/local light_mode =.*/local light_mode = true/" ~/.wezterm.lua
|
||||
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "Orchis-Grey-Light"@' ~/.xsettingsd
|
||||
sed -i -e "s/dark.rasi/light.rasi/" $HOME/.config/rofi/config.rasi
|
||||
fi
|
||||
|
||||
killall -HUP xsettingsd
|
Loading…
Add table
Add a link
Reference in a new issue