From 6283e390b38513c970093697294f7ba8b68830d6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Mar 2020 13:01:23 -0400 Subject: [PATCH 01/23] actually, let's do this a non-retarded way --- .local/bin/statusbar/battery | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index c05a3519..69da3f5e 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -19,8 +19,8 @@ do capacity=$(cat "$battery"/capacity) || exit status=$(cat "$battery"/status) - # If it is discharging and 20% or less, we will add a ❗ as a warning. - [ "$status" = "Discharging" ] && echo "$capacity" | grep -q "^[12][0-9]$" && warn="❗" + # If it is discharging and 25% or less, we will add a ❗ as a warning. + [ "$status" = "Discharging" ] && [ "$capacity" -le 25 ] && warn="❗" # Print the battery status (replaced by a cooresponding emoji with # sed), the percentage left and the warning if there is one. From 5cb4c6deeaecf349111d51166b98848f1fc1b584 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Mar 2020 13:01:36 -0400 Subject: [PATCH 02/23] Q to align in nvim --- .config/nvim/init.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 2bdca65c..d8b0ba20 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -64,6 +64,9 @@ set clipboard+=unnamedplus map k map l +" Replace ex mode with gq + map Q gq + " Check file in shellcheck: map s :!clear && shellcheck % From 04c117f85699f6d13a61ebf465e9171bddf3d9b7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Mar 2020 22:06:47 -0400 Subject: [PATCH 03/23] setbg overhaul, dwm update mv'd to postrun Yeah of course I'm going to totally rewrite a script right after I do a video on it. It uses links now to not waste space and env variables. Location moved to cache. Thanks to those who suggested some changes. --- .cache/bg | 1 + .config/wal/postrun | 1 + .local/bin/setbg | 27 ++++++++++++--------------- 3 files changed, 14 insertions(+), 15 deletions(-) create mode 120000 .cache/bg diff --git a/.cache/bg b/.cache/bg new file mode 120000 index 00000000..c2468135 --- /dev/null +++ b/.cache/bg @@ -0,0 +1 @@ +.config/wall.png \ No newline at end of file diff --git a/.config/wal/postrun b/.config/wal/postrun index e2ee73cb..ae28d832 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -24,5 +24,6 @@ done fix_sequences <"${HOME}/.cache/wal/sequences" +xsetroot -name "fsignal:xrdb" pkill dunst dunst & diff --git a/.local/bin/setbg b/.local/bin/setbg index be4adfd4..7b07e23e 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -1,22 +1,19 @@ #!/bin/sh -# In LARBS, ~/.config/wall.png is the location of the system wallpaper. This -# script, if given an argument, moves it there. This script without an -# argument sets ~/.config/wall.png as the wallpaper, which is required on login -# if you don't want a black screen. -# -# You may also give a directory name to select a random image from that -# directory as a wallpaper. Be careful that the directory only has images. +# This script does the following: +# Run by itself, set the wallpaper (at X start). +# If given a file, set that as the new wallpaper. +# If given a directory, choose random file in it. +# If wal is installed, also generate a colorscheme. -[ -f "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." +# Location of link to wallpaper link. +bgloc="${XDG_CACHE_HOME:-$HOME/.cache/}/bg" -[ -d "$1" ] && cp "$(find "$1" -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -type f | shuf -n 1)" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Random Wallpaper chosen." +[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." + +[ -d "$1" ] && ln -sf "$(find "$(readlink -f "$1")" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." # If pywal is installed, use it. -type wal >/dev/null 2>&1 && { wal -c - wal -s -i ~/.config/wall.png -o ~/.config/wal/postrun - xsetroot -name "fsignal:xrdb" - killall dwmblocks - setsid dwmblocks >/dev/null & } >/dev/null 2>&1 +wal -s -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 -xwallpaper --zoom ~/.config/wall.png +xwallpaper --zoom "$bgloc" From 9365b3db7d0f80bb9bbe965a0b1d1df663ee06f3 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 28 Mar 2020 10:07:32 -0400 Subject: [PATCH 04/23] bg fix? --- .cache/bg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cache/bg b/.cache/bg index c2468135..787af6fd 120000 --- a/.cache/bg +++ b/.cache/bg @@ -1 +1 @@ -.config/wall.png \ No newline at end of file +../.config/wall.png \ No newline at end of file From b340d3dc839abab1688ba0b6592905b49646716b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 28 Mar 2020 14:12:53 -0400 Subject: [PATCH 05/23] calcurse automatically xdg compliant now --- .config/i3/config | 2 +- .config/sxhkd/sxhkdrc | 2 +- .local/bin/statusbar/clock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 8aee9537..a22fe8ec 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -81,7 +81,7 @@ bindsym $mod+Shift+r exec --no-startup-id winresize bindsym $mod+t split toggle bindsym $mod+Shift+t gaps inner current set $inner_gaps; gaps outer current set $outer_gaps -bindsym $mod+y exec $term -e calcurse -D ~/.config/calcurse +bindsym $mod+y exec $term -e calcurse bindsym $mod+Shift+y exec --no-startup-id i3resize left bindsym $mod+u exec --no-startup-id ddspawn tmuxdd diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 6d8bda11..0b05a3df 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -21,7 +21,7 @@ super + m super + n $TERMINAL -e newsboat super + c - $TERMINAL -e calcurse -D ~/.config/calcurse + $TERMINAL -e calcurse super + v $TERMINAL -e nvim -c VimwikiIndex super + shift + a diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 5d463594..c668926a 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -3,7 +3,7 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; + 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse)" ;; 2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; 3) pgrep -x dunst >/dev/null && 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\` - Middle click opens calcurse if installed" ;; From bd4d5379266d0907e23425c1dda0dcc3717f7e25 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 28 Mar 2020 14:16:36 -0400 Subject: [PATCH 06/23] dumb oversight --- .local/bin/statusbar/clock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index c668926a..d17f3c63 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -3,7 +3,7 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse)" ;; + 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; 3) pgrep -x dunst >/dev/null && 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\` - Middle click opens calcurse if installed" ;; From 97cd22f7fc780e7753e72684380ae79d6069ef3b Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sun, 29 Mar 2020 12:42:13 +0000 Subject: [PATCH 07/23] for partial XDG supporting apps (#523) calcurse keeps creating new configs at ~/ without these two lines --- .config/user-dirs.dirs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 5a28707c..f25c63a2 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -1 +1,3 @@ XDG_DESKTOP_DIR="$HOME/" +XDG_CONFIG_HOME="$HOME/.config" +XDG_DATA_HOME="$HOME/.local/share" From 49247875e0cdd9de5019090ab525c0d700ba178a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 29 Mar 2020 12:02:15 -0400 Subject: [PATCH 08/23] lmc can run mixer --- .local/bin/lmc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/lmc b/.local/bin/lmc index bbe99a56..6d64b649 100755 --- a/.local/bin/lmc +++ b/.local/bin/lmc @@ -10,11 +10,13 @@ if [ "$PULSE" ]; then mute() { pulsemixer --mute ;} up() { pulsemixer --change-volume +"$NUM" ;} down() { pulsemixer --change-volume -"$NUM" ;} + control() { pulsemixer ;} else toggle() { amixer sset Master toggle ;} mute() { amixer sset Master mute ;} up() { amixer sset Master "$NUM"%+ ;} down() { amixer sset Master "$NUM"%- ;} + control() { alsamixer ;} fi case "$1" in @@ -22,6 +24,7 @@ case "$1" in mute) mute ;; up) up ;; down) down ;; -esac >/dev/null + control) control ;; +esac pkill -RTMIN+10 "${STATUSBAR:?}" & From 326ed6b56d71a9b689819256c9d85a2a5ece4b8f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 29 Mar 2020 14:16:07 -0400 Subject: [PATCH 09/23] battery minor imporvements --- .local/bin/statusbar/battery | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 69da3f5e..82e8450f 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -1,7 +1,7 @@ #!/bin/sh # Prints all batteries, their percentage remaining and an emoji corresponding -# to charge status (πŸ”Œ for pluged up, πŸ”‹ for discharging on battery, etc.). +# to charge status (πŸ”Œ for plugged up, πŸ”‹ for discharging on battery, etc.). case $BLOCK_BUTTON in 3) pgrep -x dunst >/dev/null && notify-send "πŸ”‹ Battery module" "πŸ”‹: discharging @@ -16,15 +16,12 @@ esac for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. - capacity=$(cat "$battery"/capacity) || exit - status=$(cat "$battery"/status) + capacity=$(cat "$battery"/capacity) + status=$(sed "s/Discharging/πŸ”‹/;s/Not charging/πŸ›‘/;s/Charging/πŸ”Œ/;s/Unknown/♻️/;s/Full/⚑/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. - [ "$status" = "Discharging" ] && [ "$capacity" -le 25 ] && warn="❗" + [ "$capacity" -le 25 ] && [ "$status" = "πŸ”‹" ] && warn="❗" - # Print the battery status (replaced by a cooresponding emoji with - # sed), the percentage left and the warning if there is one. - printf "%s%s%s\n" "$(echo "$status" | sed "s/,//;s/Discharging/πŸ”‹/;s/Not charging/πŸ›‘/;s/Charging/πŸ”Œ/;s/Unknown/♻️/;s/Full/⚑/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" + printf "%s%s%s%%\n" "$status" "$warn" "$capacity" unset warn done - From d21d1f1be3f3f52d05e395c5d482876cad16c235 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 18:53:43 -0400 Subject: [PATCH 10/23] break to avoid % on desktops --- .local/bin/statusbar/battery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 82e8450f..395ad8d2 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -16,7 +16,7 @@ esac for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. - capacity=$(cat "$battery"/capacity) + capacity=$(cat "$battery"/capacity) || break status=$(sed "s/Discharging/πŸ”‹/;s/Not charging/πŸ›‘/;s/Charging/πŸ”Œ/;s/Unknown/♻️/;s/Full/⚑/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. From 581924c71c8890374d57164403b4634d4477b743 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:29:34 -0400 Subject: [PATCH 11/23] changes and simplifications to `disk` --- .local/bin/statusbar/disk | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 2ca88059..269eba7e 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -1,18 +1,22 @@ #!/bin/sh # Status bar module for disk space -# $1 should be drive mountpoint -# $2 is optional icon, otherwise mountpoint will displayed +# $1 should be drive mountpoint, otherwise assumed /. -[ -z "$1" ] && exit +location=${1:-/} -icon="$2" -[ -z "$2" ] && icon="$1" +[ -d "$location" ] || exit case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "πŸ’½ Disk space" "$(df -h --output=target,used,size)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "πŸ’½ Disk module" "\- Shows used hard drive space. + 1) notify-send "πŸ’½ Disk space" "$(df -h --output=target,used,size)" ;; + 3) notify-send "πŸ’½ Disk module" "\- Shows used hard drive space. - Click to show all disk info." ;; esac -printf "%s: %s\n" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" +case "$location" in + "/home"* ) icon="🏠" ;; + "/mnt"* ) icon="πŸ’Ύ" ;; + *) icon="πŸ–₯ ";; +esac + +printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" From 86a5b350a7bf57aede15d7fe063a5af5878d7d7b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:30:19 -0400 Subject: [PATCH 12/23] labels moved to scripts for dwm compatibility --- .config/i3blocks/config | 4 +--- .local/bin/statusbar/cpu | 2 +- .local/bin/statusbar/memory | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index e4626545..457a9a2a 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -37,11 +37,9 @@ signal=12 #[memory] #interval=30 -#label=🧠 #[cpu] #interval=15 -#label=πŸ’» [volume] interval=once @@ -53,7 +51,7 @@ signal=10 #[disk] #interval=60 -#command=disk /home 🏠 +#command=disk /home [battery] command=battery BAT0 diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index 3b1394af..5b5528e6 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -7,4 +7,4 @@ case $BLOCK_BUTTON in - % is of single core." ;; esac -sensors | awk '/Core 0/ {print $3}' +sensors | awk '/Core 0/ {print "🌑", $3}' diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index dfd3d7b0..c1f704fa 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -6,4 +6,4 @@ case $BLOCK_BUTTON in - Click to show memory hogs." ;; esac -free -h | awk '/^Mem:/ {print $3 "/" $2}' +free -h | awk '/^Mem:/ {print "🧠", $3 "/" $2}' From 3ae11f5969d614fd2afa8a24251fa9218aac47cc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:30:42 -0400 Subject: [PATCH 13/23] statusbarinfo script for dwm --- .local/bin/statusbar/statusbarinfo | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 .local/bin/statusbar/statusbarinfo diff --git a/.local/bin/statusbar/statusbarinfo b/.local/bin/statusbar/statusbarinfo new file mode 100755 index 00000000..ae799e99 --- /dev/null +++ b/.local/bin/statusbar/statusbarinfo @@ -0,0 +1,33 @@ +#!/bin/sh + +echo " + ____ _ _ _ +/ ___|| |_ __ _| |_ _ _ ___| |__ __ _ _ __ +\___ \| __/ _\` | __| | | / __| '_ \ / _\` | '__| + ___) | || (_| | |_| |_| \__ \ |_) | (_| | | +|____/ \__\__,_|\__|\__,_|___/_.__/ \__,_|_| + +This is a list of the statusbar modules. + +πŸ“¦5 pacpackages: updatable packages (must have pacman -Sy run in root cronjob to check). +πŸ“° 41 news: unread RSS entries in newsboat. +β˜” 83% ❄️ 69Β° 🌞 80Β° weather: β˜” for precipitation, 🌞 and ❄ for daily high and low. +πŸ“¬ 20 mailbox: number of unread mail if mutt-wizard is active. +πŸ”‰ 62% volume: master sink volume. +πŸ”Œ83% battery: πŸ”Œ for charging, πŸ”‹ for discharging, ⚑ for full. +πŸ“Ά 80% ❎ internet: πŸ“Ά for wifi with % (πŸ“‘ if none), 🌐 for ethernet. (❎ if none). + +Obviously the time and date are displayed as well. + +Optional script modules: + +Edit ~/.local/src/dwmblocks/config.h to add these or your own if you'd like (and recompile and restart dwmblocks). + +'memory' 🧠 559Mi/3.7Gi Current used memory/total memory. +'cpu' 🌑 +46.0Β°C CPU temperature. +'disk' πŸ–₯ : 28G/30G Remaining disk space... +'disk ~' 🏠: 641G/850G ...can be given directory argument. +'moonphase' πŸŒ• 39% Phase of the moon (requires \`pom-perl\`). +'iplocate' πŸ‡ΊπŸ‡Έ United States Your own or VPN location (requires \`geoiplookup\`). + +" | less From 22ff37646c3088dd2db78082fa175ae14f581cde Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Wed, 1 Apr 2020 14:38:03 +0000 Subject: [PATCH 14/23] =?UTF-8?q?=F0=9F=8C=9Cupdated=20moonphase?= =?UTF-8?q?=F0=9F=8C=9B=20(#532)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit right click to open notification left & middle to update fixes specific dates --- .local/bin/statusbar/moonphase | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index d2bbad61..09af87ba 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -1,17 +1,23 @@ #!/bin/sh mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') -prcnt=$(pom $1 | grep -o '[[:digit:]]*%') +prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' ) case "$mnphs" in - "New") icon="πŸŒ‘" prcnt="0%" ;; + "New") icon="πŸŒ‘" prcnt="0" ;; "Waxing Crescent") icon="πŸŒ’" ;; - "First Quarter") icon="πŸŒ“" prcnt="50%" ;; + "First Quarter") icon="πŸŒ“" prcnt="50" ;; "Waxing Gibbous") icon="πŸŒ”" ;; - "Full") icon="πŸŒ•" prcnt="100%" ;; + "Full") icon="πŸŒ•" prcnt="100" ;; "Waning Gibbous") icon="πŸŒ–" ;; - "Last Quarter") icon="πŸŒ—" prcnt="50%" ;; + "Last Quarter") icon="πŸŒ—" prcnt="50" ;; "Waning Crescent") icon="🌘" ;; *) echo errorrrr ;; esac -printf "%s %s\\n" "$icon" "$prcnt" +case $BLOCK_BUTTON in + 1) $mnphs ;; + 2) $mnphs ;; + 3) pgrep -x dunst >/dev/null && notify-send " 🌜$(pom)" ;; +esac + +echo "$icon" "$prcnt"% From 26d8e9e006260611cd1daa556b42194612be69f5 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Thu, 2 Apr 2020 13:09:54 +0200 Subject: [PATCH 15/23] memory statusbar with multilanguage support (#536) * for multilanguage support see issue number #535 * emoji --- .local/bin/statusbar/memory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index c1f704fa..25a29585 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -6,4 +6,4 @@ case $BLOCK_BUTTON in - Click to show memory hogs." ;; esac -free -h | awk '/^Mem:/ {print "🧠", $3 "/" $2}' +free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' From 633db36d0938fbdc6db408b51fe2e49b2faabb75 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 2 Apr 2020 07:23:21 -0400 Subject: [PATCH 16/23] noto mono default if installed, inconsolata comted --- .config/fontconfig/fonts.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index cc435d5e..749a7cc8 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -28,8 +28,9 @@ monospace + Noto Sans Mono Liberation Mono - Inconsolata + Joy Pixels Noto Color Emoji From 043c6253537a20875adbfd274c1c3a3377803095 Mon Sep 17 00:00:00 2001 From: Aleks Ozolins Date: Sun, 5 Apr 2020 09:19:53 -0400 Subject: [PATCH 17/23] Update .profile to export XDG base dirs (#526) Not every program will read them from ~/.config/user-dirs.dirs so might as well export them yourself... Also can now use them elsewhere. --- .profile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.profile b/.profile index 1b5460a0..890acde7 100644 --- a/.profile +++ b/.profile @@ -14,6 +14,9 @@ export BROWSER="brave" export READER="zathura" export STATUSBAR="${LARBSWM}blocks" +# Export XDG environmental variables from '~/.config/user-dirs.dirs' +eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" + # ~/ Clean-up: #export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. export NOTMUCH_CONFIG="$HOME/.config/notmuch-config" From 77ba6e73c64aebf9e4f35a217117fc3dafbde99c Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Sun, 5 Apr 2020 15:30:49 -0700 Subject: [PATCH 18/23] Prevent writing all marked imgs onto file (lossage) (#534) This fix issues a warning message and does nothing in that case. Running C-x c (copy) or C-x m (move) will copy/move all the marked files to a single location. If that location is not a directory, then creating that file and overwriting it several times results in complete loss of data in the case of moving, and unhelpful behaviour in the case of "copying". Only the last marked file remains in the file. --- .config/sxiv/exec/key-handler | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index d9f18254..73b572a0 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -6,11 +6,13 @@ do "c") [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & ;; "r") From 6cb9c842c6691842d1bd34e495e84e12646d4991 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 18:31:37 -0400 Subject: [PATCH 19/23] inc rmd --- .config/fontconfig/fonts.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 749a7cc8..1a4b4042 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -30,7 +30,6 @@ Noto Sans Mono Liberation Mono - Joy Pixels Noto Color Emoji From 4471100f17dcdf33fcaafab8cb7c4947473930a5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 23:13:33 -0400 Subject: [PATCH 20/23] negatives fix --- .local/bin/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 285ac917..34cd2451 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -4,7 +4,7 @@ getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/β˜” /g" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "Β°","🌞",$2 "Β°"}' ;} +sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "Β°","🌞",$2 "Β°"}' ;} case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; From d650aacb907a2458fc22d9a225f6fd3c4ab2ef28 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 23:14:14 -0400 Subject: [PATCH 21/23] weather updates --- .local/bin/statusbar/weather | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 34cd2451..e98628e4 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -1,11 +1,22 @@ #!/bin/sh -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 +# Displays todays precipication chance (β˜”) and daily low (❄) and high (🌞). +# Usually intended for the statusbar. + +# If we have internet, get a weather report from wttr.in and store it locally. +# You could set up a shell alias to view the full file in a pager in the +# terminal if desired. This function will only be run once a day when needed. +getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/β˜” /g" | tr -d '\n')" +# Some very particular and terse stream manipulation. We get the maximum +# precipication chance and the daily high and low from the downloaded file and +# display them with coresponding emojis. +showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | + grep -wo "[0-9]*%" | sort -rn | sed "s/^/β˜” /g;1q" | tr -d '\n')" sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "Β°","🌞",$2 "Β°"}' ;} +# The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; 2) getforecast && showweather ;; @@ -16,7 +27,9 @@ case $BLOCK_BUTTON in 🌞: Daily high" ;; esac -if [ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] - then getforecast && showweather - else showweather -fi +# The test if our forcecast is updated to the day. If it isn't download a new +# weather report from wttr.in with the above function. +[ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || + getforecast + +showweather From 29096439ac8de198511736345206e916a3a5cbe7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 6 Apr 2020 19:28:33 -0400 Subject: [PATCH 22/23] weather for pos, neg and signless pos temps --- .local/bin/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index e98628e4..0a501e3c 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -14,7 +14,7 @@ curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/β˜” /g;1q" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "Β°","🌞",$2 "Β°"}' ;} +sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "Β°","🌞",$2 "Β°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in From 2d8fe0c738e84f2a202914771e7be665718d588e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 7 Apr 2020 09:22:41 -0400 Subject: [PATCH 23/23] emoji fonts not specified for mono --- .config/fontconfig/fonts.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 1a4b4042..2d58803c 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -30,8 +30,6 @@ Noto Sans Mono Liberation Mono - Joy Pixels - Noto Color Emoji