commit d71c9e5bdc29efa588d84e094922a3e6b80acec9
parent 9e0e17b149b4ab12834b198bb3c10aa288f1a980
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 26 Sep 2019 14:09:23 +0200
Use dmenu instead of dmenu_themed wrapper
Diffstat:
13 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/.local/bin/contactmenu b/.local/bin/contactmenu
@@ -5,7 +5,7 @@ shopt -s nullglob globstar
contact_files=~/.config/mutt/aliases
-contact=$(cat "${contact_files[@]}" | awk '{ print $2 }'| dmenu_themed -i "$@")
+contact=$(cat "${contact_files[@]}" | awk '{ print $2 }'| dmenu -i "$@")
[[ -n $contact ]] || exit 0
email=$(cat "${contact_files[@]}" | grep "$contact " | grep "@" | sed 's/.*<//;s/>.*//')
diff --git a/.local/bin/define b/.local/bin/define
@@ -76,7 +76,7 @@ prepare_history_file
if [ "$gui" = 1 ]; then
suggestions="$(xclip -o || :; cat "$history_file")"
- word=$(echo "$suggestions" | dmenu_themed -i -p "Dictionary lookup:") || exit 1
+ word=$(echo "$suggestions" | dmenu -i -p "Dictionary lookup:") || exit 1
notify-send -t 10000 "define: $word" "$(define "$word" | remove_comm_msgs)"
exit 0
else
diff --git a/.local/bin/displayselect b/.local/bin/displayselect
@@ -7,11 +7,11 @@
twoscreen() { # If multi-monitor is selected and there are two screens.
- mirror=$(printf "no\\nyes" | dmenu_themed -i -p "Mirror displays?")
+ mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
# Mirror displays using native resolution of external display and a scaled
# version for the internal display
if [ "$mirror" = "yes" ]; then
- external=$(echo "$screens" | dmenu_themed -i -p "Optimize resolution for:")
+ external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:")
internal=$(echo "$screens" | grep -v "$external")
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
@@ -32,23 +32,23 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
--scale "$scale_x"x"$scale_y"
else
- primary=$(echo "$screens" | dmenu_themed -i -p "Select primary display:")
+ primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
secondary=$(echo "$screens" | grep -v "$primary")
direction=$(printf "left\\nright" | \
- dmenu_themed -i -p "What side of $primary should $secondary be on?")
+ dmenu -i -p "What side of $primary should $secondary be on?")
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" \
--"$direction"-of "$primary" --auto --scale 1.0x1.0
fi
}
morescreen() { # If multi-monitor is selected and there are more than two screens.
- primary=$(echo "$screens" | dmenu_themed -i -p "Select primary display:")
+ primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
secondary=$(echo "$screens" | grep -v "$primary" | \
- dmenu_themed -i -p "Select secondary display:")
+ dmenu -i -p "Select secondary display:")
direction=$(printf "left\\nright" | \
- dmenu_themed -i -p "What side of $primary should $secondary be on?")
+ dmenu -i -p "What side of $primary should $secondary be on?")
tertiary=$(echo "$screens" | grep -v "$primary" | \
- grep -v "$secondary" | dmenu_themed -i -p "Select third display:")
+ grep -v "$secondary" | dmenu -i -p "Select third display:")
xrandr --output "$primary" --auto \
--output "$secondary" --"$direction"-of "$primary" --auto \
--output "$tertiary" \
@@ -74,7 +74,7 @@ screens=$(echo "$allposs" | grep " connected" | awk '{print $1}')
# Get user choice including multi-monitor and manual selection:
if [ "$(echo "$screens" | wc -l)" -gt 1 ]; then
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" \
- | dmenu_themed -i -p "Select display arangement:") &&
+ | dmenu -i -p "Select display arangement:") &&
case "$chosen" in
"manual selection") arandr ; exit ;;
"multi-monitor") multimon ;;
diff --git a/.local/bin/dmenu_run b/.local/bin/dmenu_run
@@ -1,5 +1,5 @@
#!/bin/sh
set -eu
-cmd="$(dmenu_path | dmenu_themed "$@")"
+cmd="$(dmenu_path | dmenu "$@")"
out="$(eval "$cmd" 2>&1)"
[ "$out" != "" ] && notify-send "\$ $cmd" "$out"
diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount
@@ -7,16 +7,16 @@
getmount() { \
[ -z "$chosen" ] && exit 1
- mp="$(find $1 2>/dev/null | dmenu_themed -i -p "Mount point")"
+ mp="$(find $1 2>/dev/null | dmenu -i -p "Mount point")"
[ "$mp" = "" ] && exit 1
if [ ! -d "$mp" ]; then
- mkdiryn=$(printf "No\\nYes" | dmenu_themed -i -p "$mp does not exist. Create it?")
+ mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
fi
}
mountusb() { \
- chosen="$(echo "$usbdrives" | dmenu_themed -i -p "Mount which drive?" | awk '{print $1}')"
+ chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0
alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \\( -path *%s -prune \\) \\ \n",$3}')
getmount "/mnt /media /mount /home -maxdepth 1 -type d $alreadymounted"
@@ -29,14 +29,14 @@ mountusb() { \
}
mountandroid() { \
- chosen=$(echo "$anddrives" | dmenu_themed -i -p "Which Android device?" | cut -d : -f 1)
+ chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1)
getmount "$HOME -maxdepth 3 -type d"
simple-mtpfs --device "$chosen" "$mp"
notify-send "🤖 Android Mounting" "Android device mounted to $mp."
}
asktype() { \
- case $(printf "USB\\nAndroid" | dmenu_themed -i -p "Mount a USB drive or Android device?") in
+ case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in
USB) mountusb ;;
Android) mountandroid ;;
esac
diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord
@@ -80,7 +80,7 @@ audio() { \
}
askrecording() { \
- choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu_themed -i -p "Select recording style:")
+ choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
case "$choice" in
screencast) screencast;;
audio) audio;;
@@ -91,7 +91,7 @@ askrecording() { \
}
asktoend() { \
- response=$(printf "No\\nYes" | dmenu_themed -i -p "Recording still active. End recording?") &&
+ response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
[ "$response" = "Yes" ] && killrecording
}
diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount
@@ -5,19 +5,19 @@
unmountusb() {
[ -z "$drives" ] && exit
- chosen=$(echo "$drives" | dmenu_themed -i -p "Unmount which drive?" | awk '{print $1}')
+ chosen=$(echo "$drives" | dmenu -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_themed -i -p "Unmount which device?")
+ chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
[ -z "$chosen" ] && exit
fusermount -u "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
}
asktype() { \
- case $(printf "USB\\nAndroid" | dmenu_themed -i -p "Unmount a USB drive or Android device?") in
+ case $(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?") in
USB) unmountusb ;;
Android) unmountandroid ;;
esac
diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode
@@ -6,7 +6,7 @@ set -e
# Must have xclip installed to even show menu.
xclip -h >/dev/null || exit
-chosen=$(grep -v "#" ~/.local/share/emoji | dmenu_themed -i -l 20 -fn PragmataPro-22)
+chosen=$(grep -v "#" ~/.local/share/emoji | dmenu -i -l 20 -fn PragmataPro-22)
[ "$chosen" != "" ] || exit
diff --git a/.local/bin/ducksearch b/.local/bin/ducksearch
@@ -11,7 +11,7 @@ url="$(grep 'href="htt' "$HOME"/code/adamsgaard.dk/output/bookmark.html | \
sed 's/.*<a href="//;s/">/ /;s/<\/a>//' ;
cat ~/doc/bookmark.txt)"
-choice=$(echo "$url" | dmenu_themed -i -p "Search DuckDuckGo:") || exit 1
+choice=$(echo "$url" | dmenu -i -p "Search DuckDuckGo:") || exit 1
if [ "$choice" = "🦆" ]; then
$browser "https://duckduckgo.com"
diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler
@@ -18,7 +18,7 @@ for url in "$@"; do
action="comic" ;;
*)
action="$(printf "open\nopen (tbb)\nxclip\nbookmark\ncurl\nhtml to pdf\nsci-hub\nadd bibref\nmpv\nxdg-open\nyoutube-dl\nyoutube-dl-music" | \
- dmenu_themed -i -p "action:")";;
+ dmenu -i -p "action:")";;
esac
case "$action" in
@@ -30,7 +30,7 @@ for url in "$@"; do
printf "%s" "$url" | xclip ;;
"bookmark")
description="$(echo "$(date), $hostname" | \
- dmenu_themed -p "description:")"
+ dmenu -p "description:")"
setsid $TERMINAL bookmark "$url" "$description" & ;;
"comic")
setsid comic "$url" >/dev/null 2>&1 & ;;
diff --git a/.local/bin/maimpick b/.local/bin/maimpick
@@ -1,5 +1,5 @@
#!/bin/sh
-case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfullscreen (copy)" | dmenu_themed -l 6 -i -p "Screenshot which area?")" in
+case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfullscreen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim --hidecursor -s ~/tmp/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
"current window") maim --hidecursor -i "$(xdotool getactivewindow)" ~/tmp/pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
"full screen") maim ~/tmp/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
diff --git a/.local/bin/message b/.local/bin/message
@@ -75,8 +75,8 @@ function send_message {
if [ "$prompt" = 1 ]; then
names="Susan Louise Damsgaard Sonnesen\nAnders Damsgaard\nJesper Hannibalsen\nSimon Svendsen\nNiels Christensen\nAnne Grethe Damsgaard Christensen\nLars Damsgaard Fink"
- recipient=$(echo -e "${names[@]}" | dmenu_themed -i -p "To:" || exit 1)
- msg="$(echo ' ' | dmenu_themed -i -p 'Message:')"
+ recipient=$(echo -e "${names[@]}" | dmenu -i -p "To:" || exit 1)
+ msg="$(echo ' ' | dmenu -i -p 'Message:')"
send_message "$recipient" "$msg"
keyboard-layout-switch.sh us
exit 0
diff --git a/.local/bin/t-daemon-toggle b/.local/bin/t-daemon-toggle
@@ -6,10 +6,10 @@
if pgrep -x transmission-da >/dev/null ;
then
- yn=$(printf "No\\nYes" | dmenu_themed -i -p "Kill transmission-daemon?")
+ yn=$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")
[ "$yn" = "Yes" ] && killall transmission-da
else
- yn=$(printf "No\\nYes" | dmenu_themed -i -p "Start transmission daemon?")
+ yn=$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")
[ "$yn" = "Yes" ] && transmission-daemon
fi
#sleep 3 && pkill -RTMIN+16 i3blocks