summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@thebackupbox.net>2022-05-25 07:35:56 +0000
committerepoch <epoch@thebackupbox.net>2022-05-25 07:35:56 +0000
commitd88e0f03027fd8ab33c822f975b970d522367795 (patch)
treebc288880eb8db58f2b9e7449a8adb471dda52f81
parentaf7a8f4e59f0d3dbf0608eba169adab6c0d1951b (diff)
downloaduritools-d88e0f03027fd8ab33c822f975b970d522367795.tar.gz
uritools-d88e0f03027fd8ab33c822f975b970d522367795.zip
added ability to set the colors for choose's dmenu from X resources
-rwxr-xr-xchoose10
1 files changed, 9 insertions, 1 deletions
diff --git a/choose b/choose
index 87fb4c2..763c71c 100755
--- a/choose
+++ b/choose
@@ -15,7 +15,15 @@ if [ $DISPLAY ];then
#usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]
# [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]
if which dmenu 2>&1 >/dev/null;then
- dmenu -l 10 -p "$prompt" -nb '#000000' -nf '#00aa00' -sb '#006600' -sf '#00ff00'
+ nb="$(xrdb -get choose.nb)"
+ nf="$(xrdb -get choose.nf)"
+ sb="$(xrdb -get choose.sb)"
+ sf="$(xrdb -get choose.sf)"
+ if [ "$nb" ];then nb="-nb $nb"; fi
+ if [ "$nf" ];then nf="-nf $nf"; fi
+ if [ "$sb" ];then sb="-sb $sb"; fi
+ if [ "$sf" ];then sf="-sf $sf"; fi
+ dmenu -l 10 -p "$prompt" $nb $nf $sb $sf
else
printf "dmenu missing. %s\n" "https://tools.suckless.org/dmenu/"
fi