commit 9d79aba42bd3fbda9270f308f8c0795cb2687fe3
parent 8e9cdfdfbe7df3b62202764e2c7657c8991a0b2b
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 11 Jan 2019 08:58:28 +0100
Set style for dmenu
Diffstat:
5 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/links/bin/dmenumount b/links/bin/dmenumount
@@ -4,19 +4,20 @@
# Otherwise, you'll be prompted to give a mountpoint from already existsing directories.
# If you input a novel directory, it will prompt you to create that directory.
pgrep -x dmenu && exit
+dmenuopts="-nb #222222 -nf #888888 -sb #333333 -sf #ffffff -fn PragmataPro"
getmount() { \
[ -z "$chosen" ] && exit 1
- mp="$(find $1 | dmenu -i -p "Type in mount point.")"
+ mp="$(find $1 | dmenu $dmenuopts -i -p "Type in mount point.")"
[ "$mp" = "" ] && exit 1
if [ ! -d "$mp" ]; then
- mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
+ mkdiryn=$(printf "No\\nYes" | dmenu $dmenuopts -i -p "$mp does not exist. Create it?")
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
fi
}
mountusb() { \
- chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
+ chosen="$(echo "$usbdrives" | dmenu $dmenuopts -i -p "Mount which drive?" | awk '{print $1}')"
sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0
getmount "/mnt /media /mount /home -maxdepth 5 -type d"
partitiontype="$(lsblk -no "fstype" "$chosen")"
@@ -28,14 +29,14 @@ mountusb() { \
}
mountandroid() { \
- chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1)
+ chosen=$(echo "$anddrives" | dmenu $dmenuopts -i -p "Which Android device?" | cut -d : -f 1)
getmount "$HOME -maxdepth 3 -type d"
simple-mtpfs --device "$chosen" "$mp"
notify-send "Android device mounted to $mp."
}
asktype() { \
- case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in
+ case $(printf "USB\\nAndroid" | dmenu $dmenuopts -i -p "Mount a USB drive or Android device?") in
USB) mountusb ;;
Android) mountandroid ;;
esac
diff --git a/links/bin/dmenurecord b/links/bin/dmenurecord
@@ -9,6 +9,8 @@
#
# If there is already a running instance, user will be prompted to end it.
+dmenuopts="-nb #222222 -nf #888888 -sb #333333 -sf #ffffff -fn PragmataPro"
+
updateicon() { \
echo "$1" > ~/.recordingicon
pkill -RTMIN+9 i3blocks
@@ -80,7 +82,7 @@ audio() { \
}
askrecording() { \
- choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
+ choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu $dmenuopts -i -p "Select recording style:")
case "$choice" in
screencast) screencast;;
audio) audio;;
@@ -91,7 +93,7 @@ askrecording() { \
}
asktoend() { \
- response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
+ response=$(printf "No\\nYes" | dmenu $dmenuopts -i -p "Recording still active. End recording?") &&
[ "$response" = "Yes" ] && killrecording
}
diff --git a/links/bin/dmenuumount b/links/bin/dmenuumount
@@ -3,21 +3,23 @@
# Provides you with mounted partitions, select one to unmount.
# Drives mounted at /, /boot and /home will not be options to unmount.
+dmenuopts="-nb #222222 -nf #888888 -sb #333333 -sf #ffffff -fn PragmataPro"
+
unmountusb() {
[ -z "$drives" ] && exit
- chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}')
+ chosen=$(echo "$drives" | dmenu $dmenuopts -i -p "Unmount which drive?" | awk '{print $1}')
[ -z "$chosen" ] && exit
sudo -A umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
}
unmountandroid() { \
- chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
+ chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu $dmenuopts -i -p "Unmount which device?")
[ -z "$chosen" ] && exit
fusermount -u "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
}
asktype() { \
- case $(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?") in
+ case $(printf "USB\\nAndroid" | dmenu $dmenuopts -i -p "Unmount a USB drive or Android device?") in
USB) unmountusb ;;
Android) unmountandroid ;;
esac
diff --git a/links/bin/dmenuunicode b/links/bin/dmenuunicode
@@ -5,9 +5,9 @@
# Must have xclip installed to even show menu.
xclip -h >/dev/null || exit
-#chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 20 -fn Monospace-16)
-chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 20 -fn 'Pragmata Pro-16')
-#chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 20 -fn 'Noto Sans Mono-16')
+dmenuopts="-nb #222222 -nf #888888 -sb #333333 -sf #ffffff -fn PragmataPro-16"
+
+chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 20 $dmenuopts)
[ "$chosen" != "" ] || exit
diff --git a/links/bin/ducksearch b/links/bin/ducksearch
@@ -8,7 +8,9 @@ browser=${BROWSER:-firefox}
pgrep -x dmenu && exit
-choice=$(echo "🦆" | dmenu -i -p "Search DuckDuckGo:") || exit 1
+dmenuopts="-nb #222222 -nf #888888 -sb #333333 -sf #ffffff -fn PragmataPro"
+
+choice=$(echo "🦆" | dmenu $dmenuopts -i -p "Search DuckDuckGo:") || exit 1
if [ "$choice" = "🦆" ]; then
$browser "https://duckduckgo.com"