-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmenu
More file actions
executable file
·46 lines (42 loc) · 913 Bytes
/
Copy pathmenu
File metadata and controls
executable file
·46 lines (42 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
draw_line () {
for i in {1..10}; do
printf "―"
done
}
menu_list=" run\n term\n web\n music\n mail\n file\n edit\n view\n todo\n calc\n man\n top\n$(draw_line)\n exit"
dmenucmd="dmenu -i -l $(echo -e $menu_list | wc -l)"
cmd=$(echo -e "$menu_list" | eval "$dmenucmd")
case $cmd in
*run)
dmenu_prog -l 20 ;;
*term)
tabbed st -w ;;
*web)
surf_open ;;
*music)
st -e cmus ;;
*mail)
st -e mutt ;;
*file)
pcmanfm > /dev/null 2>&1 ;;
*edit) # TODO dont open if dmenu returned empty
st -e vim -p "$(dmenu_browse)" ;;
*view)
sxiv "$(dmenu_browse $HOME/pictures)" ;;
*todo)
dmenu_todo ;;
*calc)
dmenu_calc -l 1;;
*man)
manprog=$(dmenu_man -l 20)
manname=$(echo "$manprog" | cut -d " " -f 2)
st -t "$manname" -e man $manprog ;;
*top)
st -g 68x6 -e htop ;;
*exit)
dmenu_quit ;;
*)
$cmd
esac
exit 0