Merge branch 'patch-6' of git://github.com/krisdoodle45/voidrice into krisdoodle45-patch-6

This commit is contained in:
Luke Smith 2021-10-20 10:32:03 -04:00
commit 7928c52e90
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
3 changed files with 18 additions and 14 deletions

View file

@ -1,13 +1,16 @@
#!/bin/bash #!/bin/bash
dunstconf="${HOME}/.config/dunst/dunstrc"
zathuraconf="${HOME}/.config/zathura/zathurarc"
source "${HOME}/.cache/wal/colors.sh" source "${HOME}/.cache/wal/colors.sh"
mkdir -p "${HOME}/.config/dunst" mkdir -p "$dunstconf"
mkdir -p "${HOME}/.config/zathura" mkdir -p "$zathuraconf"
mv -n "${HOME}/.config/dunst/dunstrc" "${HOME}/.config/dunst/dunstrc.bak" mv -n "$dunstconf" "$dunstconf.bak"
mv -n "${HOME}/.config/zathura/zathurarc" "${HOME}/.config/zathura/zathurarc.bak" mv -n "$zathuraconf" "$zathuraconf.bak"
ln -sf "${HOME}/.cache/wal/dunstrc" "${HOME}/.config/dunst/dunstrc" ln -sf "${HOME}/.cache/wal/dunstrc" "$dunstconf"
ln -sf "${HOME}/.cache/wal/zathurarc" "${HOME}/.config/zathura/zathurarc" ln -sf "${HOME}/.cache/wal/zathurarc" "$zathuraconf"
fix_sequences() { fix_sequences() {
e=$'\e' e=$'\e'

View file

@ -2,7 +2,4 @@
# Open a terminal window in the same directory as the currently active window. # 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) setsid -f $TERMINAL >/dev/null 2>&1
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"

View file

@ -9,6 +9,10 @@
# Location of link to wallpaper link. # Location of link to wallpaper link.
bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" 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")" && trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;; 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 pywal is installed, use it.
if command -v wal >/dev/null 2>&1 ; then 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 && 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 pidof dwm >/dev/null && xdotool key super+F12
# If pywal is removed, return config files to normal. # If pywal is removed, return config files to normal.
else 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 "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
[ -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 "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf"
fi fi
xwallpaper --zoom "$bgloc" xwallpaper --zoom "$bgloc"