diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup index bf7f85d6..62a2a8c6 100755 --- a/.local/bin/cron/checkup +++ b/.local/bin/cron/checkup @@ -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 diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog index 5aba5e65..2a13cdb3 100755 --- a/.local/bin/cron/crontog +++ b/.local/bin/cron/crontog @@ -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.") diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index 29f2b3c9..77862e96 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -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." diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 37d1397a..c63db18e 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -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:") && diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index 488522a6..09790d16 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -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() { \ diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index 49a2fbf8..55eda28d 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -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() { \ diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index 26612efe..599887ff 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -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() { \ diff --git a/.local/bin/ico b/.local/bin/ico new file mode 100755 index 00000000..68926c07 --- /dev/null +++ b/.local/bin/ico @@ -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 diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled index be3ac245..d026e43d 100755 --- a/.local/bin/ifinstalled +++ b/.local/bin/ifinstalled @@ -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 diff --git a/.local/bin/qndl b/.local/bin/qndl index f5bd14f2..1541bce3 100755 --- a/.local/bin/qndl +++ b/.local/bin/qndl @@ -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." diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index f42d0962..a7e90706 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -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 diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index d25e8d00..3104ef2a 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -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//;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 diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index 1572b527..12fc74fa 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -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}" diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 94ed9496..8214abbe 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -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 Last updated: $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 diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index e947509d..74c228d3 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -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}')" diff --git a/.local/bin/statusbar/help-icon b/.local/bin/statusbar/help-icon index 8fa4a52c..f96bcc77 100755 --- a/.local/bin/statusbar/help-icon +++ b/.local/bin/statusbar/help-icon @@ -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)" diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index d8bd8969..52c5fded 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -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)" diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index ca77f5ca..12bf06ed 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -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)" diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index 01d3daf9..9dd87d19 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -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))}" diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index fab8b4da..0ccbc81e 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -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 diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 8de3e6ae..db3332c2 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -1,14 +1,14 @@ #!/bin/sh -filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';} +filter() { mpc | sed "/^volume:/d;s/\\&/&/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 diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index 71e6fe43..049ffd1a 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -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) diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index fe701db6..415e5e2f 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -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 Note: 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)" diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index a9b6cf77..2d1ab974 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -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" diff --git a/.local/bin/statusbar/price b/.local/bin/statusbar/price index 45b01adb..4bd2ea6c 100755 --- a/.local/bin/statusbar/price +++ b/.local/bin/statusbar/price @@ -29,7 +29,7 @@ case $BLOCK_BUTTON in notify-send "$3 $2 module" "\- Exact price: \$$(cat "$pricefile") - Left click for chart of changes. - Middle click to update. -- Shows πŸ”ƒ if updating prices. +- Shows $(ico sync) if updating prices. - Last updated: $uptime" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 9e1da3a6..2f675753 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -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 diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 61588c3f..359afde1 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -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%" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index e04bac0b..1ea30183 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -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 diff --git a/.local/bin/sysact b/.local/bin/sysact index 0a7cdd02..7e214ff4 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -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 diff --git a/.local/bin/transadd b/.local/bin/transadd index a598fad3..7860ab2f 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -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." diff --git a/.zprofile b/.zprofile index 2d2f3674..9e2c6f05 100644 --- a/.zprofile +++ b/.zprofile @@ -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