From 04c117f85699f6d13a61ebf465e9171bddf3d9b7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Mar 2020 22:06:47 -0400 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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" ;;