diff options
author | Ben Sima <ben@bsima.me> | 2019-04-08 09:44:56 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-04-08 09:44:56 -0700 |
commit | cb5ed744ec217402e8a6651e3101c84f28321a01 (patch) | |
tree | 1d6974e58fa6f84181eca87447c30321b8b4b74f /xtheme | |
parent | fa2f864d775677542d616e943f4305e71cf37ccf (diff) |
Add xtheme script
Diffstat (limited to 'xtheme')
-rwxr-xr-x | xtheme | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# mostly stolen from jb55 https://github.com/jb55/bin/blob/master/themeswitch + +usage () { + printf "usage: xtheme <dark|light>\n" + exit 1 +} + +export XTHEME="$1" + +[ -z "$XTHEME" ] && usage +[ "$XTHEME" != "dark" ] && [ "$XTHEME" != "light" ] && usage + +# switch terminal theme +home-manager switch + +# set emacs theme using emacsclient +if [ "$XTHEME" == "light" ] +then + exec emacsclient \ + --eval "(bs/switch-theme 'light)" & +else + exec emacsclient \ + --eval "(bs/switch-theme 'dark)" & +fi + +systemctl --user restart polybar & + +wait |