-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu-dwm.bash
More file actions
executable file
·64 lines (58 loc) · 1.36 KB
/
menu-dwm.bash
File metadata and controls
executable file
·64 lines (58 loc) · 1.36 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#Pop up properties
source "$HOME/.config/themes/dmenu-theme"
function power()
{
#Infos a afficher
action=$(echo -e "eteindre\nredemarrer\nfermer" | dmenu -i -fn $FONT -nf $NORMFGND -nb $NORMBGND -sb $SELBGND -sf $SELFGND)
#Launch tool
case $action in
"eteindre" )
poweroff
;;
"redemarrer" )
reboot
;;
"exit" )
systemctl --user exit
;;
esac
}
function todo()
{
LINES=$(todo.sh -d ~/.config/todo/config ls | wc -l)
max=0
for lines in $(todo.sh -d ~/.config/todo/config ls | sed "s/ /_/g")
do
nbcar=$(echo $lines | wc -m)
if [ "$nbcar" -gt "$max" ]
then
max=$nbcar
fi
done
WIDTH=$(($max*7))
#Infos a afficher
action=$(todo.sh -d ~/.config/todo/config ls | head -n -2 | dmenu -i -l 5 -nb $NORMBGND -nf $NORMFGND -sb $SELBGND -sf $SELFGND)
todo.sh -d ~/.config/todo/config -fn $action
}
function umount()
{
MOUNTED=$(ls -1 /media)
max=0
for lines in $(echo -e $MOUNTED | sed "s/ /_/g")
do
nbcar=$(echo $lines | wc -m)
if [ "$nbcar" -gt "$max" ]
then
max=$nbcar
fi
done
WIDTH=$(($max*7))
#Infos a afficher
action=$(echo -e $MOUNTED | dmenu -i -l 15 -nf $NORMFGND -nb $NORMBGND -sb $SELBGND -sf $SELFGND | sed "s+\(.*\)+/media/\1+")
udiskie-umount -s $action
}
#Infos a afficher
action=$(echo -e "power\ntodo\numount" | dmenu -i -fn $FONT -nf $NORMFGND -nb $NORMBGND -sb $SELBGND -sf $SELFGND)
#Launch tool
$action