Make dmenu use .Xresources with fallback

This commit is contained in:
David Holland 2020-08-09 19:21:31 +02:00
parent f4fa5ff954
commit 006509941b
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
2 changed files with 10 additions and 2 deletions

View file

@ -19,7 +19,7 @@
*.color13: #FF92D0 *.color13: #FF92D0
*.color14: #9AEDFE *.color14: #9AEDFE
*.color15: #E6E6E6 *.color15: #E6E6E6
*.font = "Hack:size=10:antialias=true:autohint=true" *.font: "Hack:size=10:antialias=true:autohint=true"
*.termName: xterm-256color *.termName: xterm-256color
*.shell: /usr/bin/zsh *.shell: /usr/bin/zsh
*.tabspaces: 4 *.tabspaces: 4

View file

@ -4,6 +4,14 @@ if [[ -f $HOME/.zsh_alias ]]; then
source $HOME/.zsh_alias source $HOME/.zsh_alias
fi fi
command_to_run=$({ alias | awk '{split($0,alias,"="); print alias[1];}' ; dmenu_path ; } | sort | dmenu -i -fn Hack -nb "#282a36" -nf "#f8f8f2" -sb "#44475a" -sf "#f8f8f2" "$@") fallback_font="Hack:size=10:antialias=true:autohint=true"
font=""
if [ -x $(command -v xgetres) ]; then
font=$(xgetres font || echo $fallback_font);
else
font=$fallback_font;
fi
command_to_run=$({ alias | awk '{split($0,alias,"="); print alias[1];}' ; dmenu_path ; } | sort | dmenu -i -fn $font -nb "#282a36" -nf "#f8f8f2" -sb "#44475a" -sf "#f8f8f2" "$@")
eval ${command_to_run} & eval ${command_to_run} &