Adding menu that allows quick changing colorscheme in XMonad.
This commit is contained in:
parent
588fee1986
commit
3440f89019
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Script name: dtos-colorscheme
|
||||
# Description: Change colorscheme in DTOS.
|
||||
# Dependencies: dmenu, dmscripts
|
||||
# GitLab: https://www.gitlab.com/dwt1/dtos
|
||||
# License: https://www.gitlab.com/dwt1/dtos/LICENSE
|
||||
# Contributors: Derek Taylor
|
||||
|
||||
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
|
||||
# if certain things happen, which is a good thing. Otherwise, we can
|
||||
# get hidden bugs that are hard to discover.
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source "$HOME/.config/dmscripts/config"
|
||||
|
||||
options=("DoomOne"
|
||||
"Dracula"
|
||||
"GruvboxDark"
|
||||
"MonokaiPro"
|
||||
"Nord"
|
||||
"OceanicNext"
|
||||
"Palenight"
|
||||
"SolarizedDark"
|
||||
"SolarizedLight"
|
||||
"TomorrowNight")
|
||||
|
||||
choice=$(printf '%s\n' "${options[@]}" | ${DMENU} 'Choose color scheme:' "${@}")
|
||||
|
||||
if [ "$choice" ]; then
|
||||
sed -i "s/import Colors.*/import Colors.$choice/g" "$HOME"/.xmonad/README.org || echo "Cannot modify README.org"
|
||||
sed -i "s/import Colors.*/import Colors.$choice/g" "$HOME"/.xmonad/xmonad.hs || echo "Cannot modify xmonad.hs"
|
||||
xmonad --restart
|
||||
# What to do if we just escape without choosing anything.
|
||||
else
|
||||
echo "Program terminated." && exit 0
|
||||
fi
|
|
@ -492,7 +492,8 @@ myKeys =
|
|||
, ("M-p h", spawn "dm-hub") -- allows access to all dmscripts
|
||||
, ("M-p a", spawn "dm-sounds") -- choose an ambient background
|
||||
, ("M-p b", spawn "dm-setbg") -- set a background
|
||||
, ("M-p c", spawn "dm-colpick") -- pick color from our scheme
|
||||
, ("M-p c", spawn "dtos-colorscheme") -- choose a colorscheme
|
||||
, ("M-p C", spawn "dm-colpick") -- pick color from our scheme
|
||||
, ("M-p e", spawn "dm-confedit") -- edit config files
|
||||
, ("M-p i", spawn "dm-maim") -- screenshots (images)
|
||||
, ("M-p k", spawn "dm-kill") -- kill processes
|
||||
|
|
|
@ -376,7 +376,8 @@ myKeys =
|
|||
, ("M-p h", spawn "dm-hub") -- allows access to all dmscripts
|
||||
, ("M-p a", spawn "dm-sounds") -- choose an ambient background
|
||||
, ("M-p b", spawn "dm-setbg") -- set a background
|
||||
, ("M-p c", spawn "dm-colpick") -- pick color from our scheme
|
||||
, ("M-p c", spawn "dtos-colorscheme") -- choose a colorscheme
|
||||
, ("M-p C", spawn "dm-colpick") -- pick color from our scheme
|
||||
, ("M-p e", spawn "dm-confedit") -- edit config files
|
||||
, ("M-p i", spawn "dm-maim") -- screenshots (images)
|
||||
, ("M-p k", spawn "dm-kill") -- kill processes
|
||||
|
|
Loading…
Reference in New Issue