Add customizability feature to icons via .zprofile

By changing CF_ICONS variable you can edit icons all across your system.
For example if you want to use material-design-icons-git (AUR) all you
need to do is to change the variable like below:

export CF_ICONS="/home=󱂵:/mnt=󰡰:android=󰀲:bat-charging=󰂄:\
    bat-discharging=󰂌:bat-f=󱈑:bat-unknown=󰂃:bat=󰁹:\
    batt=󰭟:btc=󰠓:cb=📋:clock-00=󱑖:clock-01=󱑋:clock-02=󱑌:\
    clock-03=󱑍:clock-04=󱑎:clock-05=󱑏:\
    clock-06=󱑐:clock-07=󱑑:clock-08=󱑒:clock-09=󱑓:clock-10=󱑔:\
    clock-11=󱑕:clock-12=󱑖:cpu=󰻠:crypto=󰆬:disk=󰑹:\
    down=󰜮:eth=󰡪:f-move=󰪹:help=󰘥:\
    hib=󰤁:internet=󰖈:lan-x=󰌙:lan=󰌘:lbc=󰺃:leave=󰠜:lock=󰌾:\
    mail=󰇮:mem=󰍛:music=󰎇:news=󰎕:pause=󰏤:pc=󰟀:\
    pkg-down=󰏔:pkg=󰏗:q-add=󱊘:reboot=󱄋:\
    rec-cam=󰤙:rec-screen=󰊓:rec-voice=󰗋:renew=󰑓:sheets=󱈆:\
    shutdown=󰐥:sync=󰃨:temp=󰏈:tick-clock=󰾨:tick-cloud=󰅠:\
    time=󰃰:tor=󱎖:torrent-add=󰶡:torrent-seed-x=󱏽:torrent-idle=󰹢:\
    torrent-seed=󰹦:up=󰜷:usb=󰕓:vol-0=󰕿:vol-1=󰖀:\
    vol-2=󰕾:vol-m=󰕾:vol-x=󰖁:vol=󰕾:vpn=󰌆:weather-h=󰖙:\
    weather-l=󰜗:weather-perc=󰖗:weather=󰔎:\
    wifi-x=󰤮:wifi=󰤨:🌑=󰽤:🌒=󰽧:🌓=󰽡:🌔=󰽨:🌕=󰽢:🌖=󰽦:🌗=󰽣:🌘=󰽥:"
This commit is contained in:
M. Yas. Davoodeh 2020-08-27 00:40:21 +04:30
parent 62e555f906
commit 49d1a7fb76
31 changed files with 217 additions and 136 deletions

View File

@ -4,7 +4,7 @@
ping -q -c example.org > /dev/null || exit
notify-send "📦 Repository Sync" "Checking for package updates..."
notify-send "$(ico pkg) Repository Sync" "Checking for package updates..."
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
@ -13,7 +13,7 @@ pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
if pacman -Qu | grep -v "\[ignored\]"
then
notify-send "🎁 Repository Sync" "Updates available. Click statusbar icon (📦) for update."
notify-send "$(ico pkg-down) Repository Sync" "Updates available. Click statusbar icon ($(ico pkg)) for update."
else
notify-send "📦 Repository Sync" "Sync complete. No new packages for update."
notify-send "$(ico pkg) Repository Sync" "Sync complete. No new packages for update."
fi

View File

@ -3,4 +3,4 @@
# Toggles all cronjobs off/on.
# Stores disabled crontabs in ~/.consaved until restored.
([ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved ] && crontab - < "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && rm "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.")
([ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved ] && crontab - < "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && rm "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && notify-send "$(ico tick-clock) Cronjobs re-enabled.") || ( crontab -l > "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && crontab -r && notify-send "$(ico tick-clock) Cronjobs saved and disabled.")

View File

@ -5,13 +5,13 @@
ping -q -c 1 example.org > /dev/null || exit
/usr/bin/notify-send "📰 Updating RSS feeds..."
/usr/bin/notify-send "$(ico sheets) Updating RSS feeds..."
pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
echo 🔃 > /tmp/newsupdate
echo $(ico sync) > /tmp/newsupdate
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
/usr/bin/newsboat -x reload
rm -f /tmp/newsupdate
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
/usr/bin/notify-send "📰 RSS feed update complete."
/usr/bin/notify-send "$(ico sheets) RSS feed update complete."

View File

@ -70,7 +70,7 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
# If there's only one screen
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
{ onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;}
{ onescreen "$screens"; postrun; notify-send "$(ico pc) Only one screen detected." "Using it in its optimal settings..."; exit ;}
# Get user choice including multi-monitor and manual selection:
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&

View File

@ -19,7 +19,7 @@ getmount() { \
mountusb() { \
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1
chosen="$(echo "$chosen" | awk '{print $1}')"
sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0
sudo -A mount "$chosen" 2>/dev/null && notify-send "$(ico usb) USB mounting" "$chosen mounted." && exit 0
alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}')
getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted"
partitiontype="$(lsblk -no "fstype" "$chosen")"
@ -27,7 +27,7 @@ mountusb() { \
"vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;
*) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" "$mp";;
esac
notify-send "💻 USB mounting" "$chosen mounted to $mp."
notify-send "$(ico usb) USB mounting" "$chosen mounted to $mp."
}
mountandroid() { \
@ -37,7 +37,7 @@ mountandroid() { \
simple-mtpfs --device "$chosen" "$mp"
echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1
simple-mtpfs --device "$chosen" "$mp"
notify-send "🤖 Android Mounting" "Android device mounted to $mp."
notify-send "$(ico android) Android Mounting" "Android device mounted to $mp."
}
asktype() { \

View File

@ -38,7 +38,7 @@ screencast() { \
-c:v h264 -crf 0 -preset ultrafast -c:a aac \
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
echo $! > /tmp/recordingpid
updateicon "⏺️🎙️"
updateicon "$(ico rec-screen rec-voice | tr -d '\n')"
}
video() { ffmpeg \
@ -48,7 +48,7 @@ video() { ffmpeg \
-c:v libx264 -qp 0 -r 30 \
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid
updateicon "⏺️"
updateicon "$(ico rec-screen)"
}
webcamhidef() { ffmpeg \
@ -57,7 +57,7 @@ webcamhidef() { ffmpeg \
-video_size 1920x1080 \
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid
updateicon "🎥"
updateicon "$(ico rec-cam)"
}
webcam() { ffmpeg \
@ -66,7 +66,7 @@ webcam() { ffmpeg \
-video_size 640x480 \
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid
updateicon "🎥"
updateicon "$(ico rec-cam)"
}
@ -76,7 +76,7 @@ audio() { \
-c:a flac \
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
echo $! > /tmp/recordingpid
updateicon "🎙️"
updateicon "$(ico rec-cam)"
}
askrecording() { \

View File

@ -9,13 +9,13 @@ unmountusb() {
chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
chosen="$(echo "$chosen" | awk '{print $1}')"
[ -z "$chosen" ] && exit
sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted."
sudo -A umount "$chosen" && notify-send "$(ico usb) USB unmounting" "$chosen unmounted."
}
unmountandroid() { \
chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1
[ -z "$chosen" ] && exit
sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
sudo -A umount -l "$chosen" && notify-send "$(ico android) Android unmounting" "$chosen unmounted."
}
asktype() { \

13
.local/bin/ico Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# Use icons defined in CF_ICONS
# Directories are used with disk module. Any path can take its own icon.
# Icons like weather and crypto are used in notifications of the respective modules.
# Special dash marks: x: crossed / no; 1: first quarter / 25%; m: mid point / 50%; 2: second quarter / 75%; f: full / 100%;
# Source your env file if you want to test new icons before rebooting your system
# . ~/.zprofile
for input in "$@" ;do
echo "${CF_ICONS:-defs}" | grep -Po "(:|^|\s+)$input=\K.+?(?=(:|$))" || exit $? # break if an icon is not found
done

View File

@ -7,5 +7,5 @@
for x in "$@";do
pacman -Qq "$x" >/dev/null 2>&1 ||
{ notify-send "📦 $x" "must be installed for this function." && exit 1 ;}
{ notify-send "$(ico pkg) $x" "must be installed for this function." && exit 1 ;}
done

View File

@ -3,10 +3,10 @@
# $1 is a url; $2 is a command
[ -z "$1" ] && exit
base="$(basename "$1")"
notify-send " Queuing $base..."
notify-send "$(ico q-add) Queuing $base..."
cmd="$2"
[ -z "$cmd" ] && cmd="youtube-dl --add-metadata"
idnum="$(tsp $cmd "$1")"
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
tsp -D "$idnum" mv "$base" "$realname"
tsp -D "$idnum" notify-send "👍 $realname done."
tsp -D "$idnum" notify-send "$(ico tick-cloud) $realname done."

View File

@ -4,12 +4,12 @@
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
case $BLOCK_BUTTON in
3) notify-send "🔋 Battery module" "🔋: discharging
🛑: not charging
: stagnant charge
🔌: charging
: charged
: battery very low!
3) notify-send "$(ico bat-discharging) Battery module" "$(ico bat-discharging): discharging
$(ico bat): not charging
$(ico bat-unknown): stagnant charge
$(ico bat-charging): charging
$(ico bat-f): charged
$(ico warn): battery very low!
- Scroll to change adjust xbacklight." ;;
4) xbacklight -inc 10 ;;
5) xbacklight -dec 10 ;;
@ -17,17 +17,17 @@ case $BLOCK_BUTTON in
esac
# acpi alternative
# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit
# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /$(ico bat-discharging)/;s/[Nn]ot charging, /$(ico bat)/;s/[Cc]harging, /$(ico bat-charging)/;s/[Uu]nknown, /$(ico bat-unknown)/;s/[Ff]ull, /$(ico bat-f)/;s/ \(remaining\|until charged\)//"; exit
# Loop through all attached batteries.
for battery in /sys/class/power_supply/BAT?
do
# Get its remaining capacity and charge status.
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
status=$(sed "s/[Dd]ischarging/$(ico bat-discharging)/;s/[Nn]ot charging/$(ico bat)/;s/[Cc]harging/$(ico bat-charging)/;s/[Uu]nknown/$(ico bat-unknown)/;s/[Ff]ull/$(ico bat-f)/" "$battery"/status)
# If it is discharging and 25% or less, we will add a ❗ as a warning.
[ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
[ "$capacity" -le 25 ] && [ "$status" = "$(ico bat)" ] && warn="$(ico warn)"
printf "%s%s%s%% " "$status" "$warn" "$capacity"
unset warn

View File

@ -1,27 +1,11 @@
#!/bin/sh
clock=$(date '+%I')
case "$clock" in
"00") icon="🕛" ;;
"01") icon="🕐" ;;
"02") icon="🕑" ;;
"03") icon="🕒" ;;
"04") icon="🕓" ;;
"05") icon="🕔" ;;
"06") icon="🕕" ;;
"07") icon="🕖" ;;
"08") icon="🕗" ;;
"09") icon="🕘" ;;
"10") icon="🕙" ;;
"11") icon="🕚" ;;
"12") icon="🕛" ;;
esac
clock=$(ico clock-$(date '+%I'))
case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
2) setsid -f "$TERMINAL" -e calcurse ;;
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
3) notify-send "$(ico time) Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
- Middle click opens calcurse if installed" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -1,12 +1,12 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
1) notify-send "$(ico cpu) CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
3) notify-send "$(ico cpu) CPU module " "\- Shows CPU temperature.
- Click to show intensive processes.
- Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
sensors | awk '/Core 0/ {print "🌡" $3}'
sensors | awk "/Core 0/ {print \"$(ico temp)\" \$3}"

View File

@ -5,16 +5,16 @@
# Currencies should be ;-separated:
# human-readable name;urlname;icon
coins="Bitcoin;btc;💰
Etherium;eth;🍸
Basic Attention Token;bat;🦁
LBC;lbc;📚"
coins="Bitcoin;btc;$(ico btc)
Etherium;eth;$(ico eth)
Basic Attention Token;bat;$(ico batt)
LBC;lbc;$(ico lbc)"
# Directory where currency info is stored.
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
getprices() { # The command to get the desired prices
printf "🔃 "; printprices
printf "%s " "$(ico sync)"; printprices
{ rm -rf "${dir:?}/*"
echo "$coins" | while IFS=';' read -r human web icon; do
val="$(curl -s "rate.sx/1$web")" &&
@ -44,9 +44,9 @@ case $BLOCK_BUTTON in
<b>Last updated:</b>
$uptime" ;;
2) getprices ;;
3) notify-send "💸 Crypto-currency module" "\- Left click for exact prices.
3) notify-send "$(ico crypto) Crypto-currency module" "\- Left click for exact prices.
- Middle click to update.
- Shows 🔃 if updating prices.
- Shows $(ico sync) if updating prices.
- Manually add/remove currencies to list in the script." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -8,16 +8,12 @@ location=${1:-/}
[ -d "$location" ] || exit
case $BLOCK_BUTTON in
1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
3) notify-send "💽 Disk module" "\- Shows used hard drive space.
1) notify-send "$(ico disk) Disk space" "$(df -h --output=target,used,size)" ;;
3) notify-send "$(ico disk) Disk module" "\- Shows used hard drive space.
- Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
case "$location" in
"/home"* ) icon="🏠" ;;
"/mnt"* ) icon="💾" ;;
*) icon="🖥";;
esac
icon="$(ico "$location")" || icon="$(ico pc)" # use icon or the address itself
printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"

View File

@ -11,7 +11,7 @@ pidof dwm >/dev/null &&
case $BLOCK_BUTTON in
1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
2) restartwm ;;
3) notify-send " Help module" "\- Left click to open LARBS guide.
3) notify-send "$(ico help) Help module" "\- Left click to open LARBS guide.
- Middle click to refresh window manager." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac; echo ""
esac; echo "$(ico help)"

View File

@ -5,18 +5,18 @@
case $BLOCK_BUTTON in
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
3) notify-send "🌐 Internet module" "\- Click to connect
📡: no wifi connection
📶: wifi connection with quality
: no ethernet
🌐: ethernet working
3) notify-send "$(ico internet) Internet module" "\- Click to connect
$(ico wifi-x): no wifi connection
$(ico wifi): wifi connection with quality
$(ico lan-x): no ethernet
$(ico lan): ethernet working
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) wifiicon="📡 " ;;
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
down) wifiicon="$(ico wifi-x) " ;;
up) wifiicon="$(awk "/^\\s*w/ { print \"$(ico wifi)\", int(\$3 * 100 / 70) \"% \" }" /proc/net/wireless)" ;;
esac
printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)"
printf "%s%s\n" "$wifiicon" "$(sed "s/down/$(ico lan-x)/;s/up/$(ico lan)/" /sys/class/net/e*/operstate 2>/dev/null)"

View File

@ -6,8 +6,8 @@
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e neomutt ;;
2) setsid -f mailsync >/dev/null ;;
3) notify-send "📬 Mail module" "\- Shows unread mail
- Shows 🔃 if syncing mail
3) notify-send "$(ico mail) Mail module" "\- Shows unread mail
- Shows $(ico sync) if syncing mail
- Left click opens neomutt
- Middle click syncs mail" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
@ -15,6 +15,4 @@ esac
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
pidof mbsync >/dev/null 2>&1 && icon="🔃"
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon"
[ "$unread" != "0" ] && echo "$(ico mail)$unread$(pidof mbsync >/dev/null 2>&1 && ico sync)"

View File

@ -1,12 +1,12 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
1) notify-send "$(ico mem) Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
3) notify-send "$(ico mem) Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs.
- Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
free --mebi | sed -n '2{p;q}' | awk "{printf (\"$(ico mem)%2.2fGiB/%2.2fGiB\n\", ( \$3 / 1024), (\$2 / 1024))}"

View File

@ -21,17 +21,18 @@ case "$icon" in
*) exit 1 ;;
esac
echo "${icon-?}"
icon="$(ico $icon)" || icon="?"
echo "$icon"
case $BLOCK_BUTTON in
3) notify-send "🌜 Moon phase module" "Displays current moon phase.
- 🌑: New
- 🌒: Waxing Crescent
- 🌓: First Quarter
- 🌔: Waxing Gibbous
- 🌕: Full
- 🌖: Waning Gibbous
- 🌗: Last Quarter
- 🌘: Waning Crescent" ;;
3) notify-send "$(ico 🌘) Moon phase module" "Displays current moon phase.
- $(ico 🌑): New
- $(ico 🌒): Waxing Crescent
- $(ico 🌓): First Quarter
- $(ico 🌔): Waxing Gibbous
- $(ico 🌕): Full
- $(ico 🌖): Waning Gibbous
- $(ico 🌗): Last Quarter
- $(ico 🌘): Waning Crescent" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -1,14 +1,14 @@
#!/bin/sh
filter() { mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*//g;/\\[playing\\].*/d" | paste -sd ' ';}
filter() { mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/$(ico pause)/g;/\\[playing\\].*/d" | paste -sd ' ';}
pidof -x mpdup >/dev/null 2>&1 || mpdup >/dev/null 2>&1 &
case $BLOCK_BUTTON in
1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause
2) mpc toggle | filter ;; # right click, pause/unpause
3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
- when paused.
3) mpc status | filter ; notify-send "$(ico music) Music module" "\- Shows mpd song playing.
- $(ico pause) when paused.
- Left click opens ncmpcpp.
- Middle click pauses.
- Scroll changes track.";; # right click, pause/unpause

View File

@ -5,8 +5,8 @@
# second, gives network traffic per second.
case $BLOCK_BUTTON in
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
🔺: Traffic transmitted" ;;
3) notify-send "$(ico internet) Network traffic module" "$(ico down): Traffic received
$(ico up): Traffic transmitted" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
@ -25,4 +25,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)
printf "$(ico down)%4sB $(ico up)%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)

View File

@ -6,12 +6,12 @@
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e newsboat ;;
2) setsid -f newsup >/dev/null exit ;;
3) notify-send "📰 News module" "\- Shows unread news items
- Shows 🔃 if updating with \`newsup\`
3) notify-send "$(ico news) News module" "\- Shows unread news items
- Shows $(ico sync) if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "📰" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk "{ if(\$1>0) print \"$(ico news)\" \$1}")$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"

View File

@ -20,10 +20,10 @@
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e popupgrade ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
3) notify-send "$(ico pkg-down) Upgrade module" "$(ico pkg): number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/$(ico pkg)/;s/^$(ico pkg)0$//g"

View File

@ -29,7 +29,7 @@ case $BLOCK_BUTTON in
notify-send "$3 $2 module" "\- <b>Exact price: \$$(cat "$pricefile")</b>
- Left click for chart of changes.
- Middle click to update.
- Shows 🔃 if updating prices.
- Shows $(ico sync) if updating prices.
- <b>Last updated:
$uptime</b>" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;

View File

@ -9,25 +9,25 @@ transmission-remote -l | grep % |
s/.*Uploading.*/L/g;
s/.*%.*/M/g" |
sort -h | uniq -c | sed " # Now we replace the standin letters with icons.
s/A/🛑/g;
s/B/🕰/g;
s/L/🔼/g;
s/M/🔽/g;
s/N//g;
s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' '
s/A/$(ico torrent-seed-x)/g;
s/B/$(ico torrent-idle)/g;
s/L/$(ico up)/g;
s/M/$(ico down)/g;
s/N/$(ico tick-cloud)/g;
s/Z/$(ico torrent-seed)/g" | awk '{print $2 $1}' | paste -sd ' '
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e tremc ;;
2) td-toggle ;;
3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
3) notify-send "$(ico torrent-seed) Torrent module" "\- Left click to open tremc.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
🛑: paused
🕰: idle (seeds needed)
🔼: uploading (unfinished)
🔽: downloading
: done
🌱: done and seeding" ;;
$(ico torrent-seed-x): paused
$(ico torrent-idle): idle (seeds needed)
$(ico up): uploading (unfinished)
$(ico down): downloading
$(ico tick-cloud): done
$(ico torrent-seed): done and seeding" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -7,22 +7,22 @@ case $BLOCK_BUTTON in
2) pamixer -t ;;
4) pamixer --allow-boost -i 1 ;;
5) pamixer --allow-boost -d 1 ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
3) notify-send "$(ico vol) Volume module" "\- Shows volume $(ico vol), $(ico vol-x) if muted.
- Middle click to mute.
- Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
[ $(pamixer --get-mute) = true ] && echo 🔇 && exit
[ $(pamixer --get-mute) = true ] && echo $(ico vol-x) && exit
vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then
icon="🔊"
icon="$(ico vol)"
elif [ "$vol" -lt "30" ]; then
icon="🔈"
icon="$(ico vol-0)"
else
icon="🔉"
icon="$(ico vol-1)"
fi
echo "$icon$vol%"

View File

@ -13,17 +13,17 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
# precipication chance and the daily high and low from the downloaded file and
# display them with coresponding emojis.
showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
grep -wo "[0-9]*%" | sort -rn | sed "s/^//g;1q" | tr -d '\n')"
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
grep -wo "[0-9]*%" | sort -rn | sed "s/^/$(ico weather-perc)/g;1q" | tr -d '\n')"
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk "{print \" $(ico weather-l)\" \$1 \"°\",\"$(ico weather-h)\" \$2 \"°\"}" ;}
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
2) getforecast && showweather ;;
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
3) notify-send "$(ico weather) Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
: Chance of rain/snow
🥶: Daily low
🌞: Daily high" ;;
$(ico weather-perc): Chance of rain/snow
$(ico weather-l): Daily low
$(ico weather-h): Daily high" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -9,12 +9,12 @@ case "$(readlink -f /sbin/init)" in
esac
cmds="\
🔒 lock slock
🚪 leave dwm kill -TERM $(pidof -s dwm)
renew dwm kill -HUP $(pidof -s dwm)
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
🔃 reboot ${reb:-sudo -A reboot}
🖥 shutdown ${shut:-sudo -A shutdown -h now}"
$(ico lock) lock slock
$(ico leave) leave dwm kill -TERM $(pidof -s dwm)
$(ico renew) renew dwm kill -HUP $(pidof -s dwm)
$(ico hib) hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
$(ico reboot) reboot ${reb:-sudo -A reboot}
$(ico shutdown) shutdown ${shut:-sudo -A shutdown -h now}"
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1

View File

@ -6,4 +6,4 @@
pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}")
transmission-remote -a "$@" && notify-send "🔽 Torrent added."
transmission-remote -a "$@" && notify-send "$(ico torrent-add) Torrent added."

View File

@ -128,6 +128,95 @@ ex=🎯:\
*.java=♨:\
"
# config's icons: Refer to `ico` for more details
CF_ICONS="/home=🏠:\
/mnt=💾:\
android=🤖:\
bat-charging=🔌:\
bat-discharging=🔋:\
bat-f=⚡:\
bat-unknown=♻:\
bat=🛑:\
batt=🦁:\
btc=💰:\
cb=📋:\
clock-00=🕛:\
clock-01=🕐:\
clock-02=🕑:\
clock-03=🕒:\
clock-04=🕓:\
clock-05=🕔:\
clock-06=🕕:\
clock-07=🕖:\
clock-08=🕗:\
clock-09=🕘:\
clock-10=🕙:\
clock-11=🕚:\
clock-12=🕛:\
cpu=🖥:\
crypto=💸:\
disk=💽:\
down=🔻:\
eth=🍸:\
f-move=:\
help=❓:\
hib=🐻:\
internet=🌐:\
lan-x=❎:\
lan=🌐:\
lbc=📚:\
leave=🚪:\
lock=🔒:\
mail=📬:\
mem=🧠:\
music=🎵:\
news=📰:\
pause=⏸:\
pc=💻:\
pkg-down=🎁:\
pkg=📦:\
q-add=⏳:\
reboot=🔃:\
rec-cam=🎥:\
rec-screen=⏺️:\
rec-voice=🎙️:\
renew=♻:\
sheets=📰:\
shutdown=🖥:\
sync=🔃:\
temp=🌡:\
tick-clock=🕓:\
tick-cloud=✅:\
time=📅:\
torrent-add=🔽:\
torrent-seed-x=🛑:\
torrent-seed=🕰:\
torrent-seeding=🌱:\
up=🔺:\
usb=💻:\
vol-0=🔈:\
vol-1=🔉:\
vol-2=🔊:\
vol-m=🔊:\
vol-x=🔇:\
vol=🔊:\
warn=❗:\
weather-h=🌞:\
weather-l=🥶:\
weather-perc=☔:\
weather=🌈:\
wifi-x=📡:\
wifi=📶:\
🌑=🌑:\
🌒=🌒:\
🌓=🌓:\
🌔=🌔:\
🌕=🌕:\
🌖=🌖:\
🌗=🌗:\
🌘=🌘:\
"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
if pacman -Qs libxft-bgra >/dev/null 2>&1; then