-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdsk
More file actions
executable file
·34 lines (28 loc) · 987 Bytes
/
dsk
File metadata and controls
executable file
·34 lines (28 loc) · 987 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
#!/bin/sh
# shellcheck disable=1090,2154
. "${XDG_CACHE_HOME-$HOME/.cache}/wal/colors.sh"
icon=
drive=/home
blockcolor=$color13
txtcolor=$color0
case $BLOCK_BUTTON in
1) # Left Click
notify-send \
-h string:x-canonical-private-synchronous:i3bdsk \
"💽 Disk space" "$(df -hT -x tmpfs -x squashfs -x devtmpfs)"
;;
3) # Right Click
notify-send \
-h string:x-canonical-private-synchronous:i3bdsk \
"Scanning $HOME..."
notify-send \
-h string:x-canonical-private-synchronous:i3bdsk \
"💽 Home folder disk usage by folder" "$(sudo du -hs $HOME/* | sort -h)"
;;
esac
command=$(df -h "$drive" | awk ' /[0-9]/ {print $3 "/" $2}')
printf "\
<b><span foreground='$blockcolor' background='$color0'></span>\
<span foreground='$txtcolor' background='$blockcolor'>%s</span>\
<span foreground='$color0' background='$blockcolor'></span></b>\n" \
" $icon $command "