summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-10-20 10:32:03 -0400
committerLuke Smith <luke@lukesmith.xyz>2021-10-20 10:32:03 -0400
commit7928c52e90d6c5facde5e78967321e4a492812fb (patch)
tree1b7ee10b09561b6a2ac77c14bad22ec9f3a14ed4 /.local/bin
parent714aa92a9596352d4f70e35d212fe922c23348b4 (diff)
parent56caae7b0316eab26392090a62eb2bf4cd4887d5 (diff)
downloadeibhear-7928c52e90d6c5facde5e78967321e4a492812fb.tar.gz
eibhear-7928c52e90d6c5facde5e78967321e4a492812fb.tar.zst
eibhear-7928c52e90d6c5facde5e78967321e4a492812fb.zip
Merge branch 'patch-6' of git://github.com/krisdoodle45/voidrice into krisdoodle45-patch-6
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/samedir5
-rwxr-xr-x.local/bin/setbg12
2 files changed, 9 insertions, 8 deletions
diff --git a/.local/bin/samedir b/.local/bin/samedir
index 73facfd..82397d3 100755
--- a/.local/bin/samedir
+++ b/.local/bin/samedir
@@ -2,7 +2,4 @@
# Open a terminal window in the same directory as the currently active window.
-PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
-PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')"
-cd "$(readlink /proc/"$PID"/cwd)" || return 1
-"$TERMINAL"
+setsid -f $TERMINAL >/dev/null 2>&1
diff --git a/.local/bin/setbg b/.local/bin/setbg
index 7f997b7..b0938fd 100755
--- a/.local/bin/setbg
+++ b/.local/bin/setbg
@@ -9,6 +9,10 @@
# Location of link to wallpaper link.
bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
+# Configuration files of applications that have their themes changed by pywal.
+dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
+zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
+
trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
@@ -18,12 +22,12 @@ esac
# If pywal is installed, use it.
if command -v wal >/dev/null 2>&1 ; then
- wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
- pidof dwm >/dev/null && xdotool key super+F12
+ wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
+ pidof dwm >/dev/null && xdotool key super+F12
# If pywal is removed, return config files to normal.
else
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
+ [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
+ [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf"
fi
xwallpaper --zoom "$bgloc"