summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.config/lf/lfrc3
-rw-r--r--.config/user-dirs.dirs2
-rwxr-xr-x.local/bin/statusbar/volume24
-rw-r--r--.profile2
4 files changed, 20 insertions, 11 deletions
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index 616c5ab..3766268 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -2,7 +2,7 @@
# Basic vars
set shell sh
-set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope
+set previewer ~/.config/lf/scope
set shellopts '-eu'
set ifs "\n"
set scrolloff 10
@@ -54,7 +54,6 @@ cmd bulkrename ${{
}}
# Bindings
-map c $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)"
map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)"
map gh
diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs
index f25c63a..5a28707 100644
--- a/.config/user-dirs.dirs
+++ b/.config/user-dirs.dirs
@@ -1,3 +1 @@
XDG_DESKTOP_DIR="$HOME/"
-XDG_CONFIG_HOME="$HOME/.config"
-XDG_DATA_HOME="$HOME/.local/share"
diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume
index cd79de3..e248952 100755
--- a/.local/bin/statusbar/volume
+++ b/.local/bin/statusbar/volume
@@ -1,20 +1,30 @@
#!/bin/sh
+# Prints the current volume or 🔇 if muted. Uses PulseAudio by default,
+# uncomment the ALSA lines if you remove PulseAudio.
+
case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e alsamixer & ;;
- 2) amixer sset Master toggle ;;
- 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
- 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;;
+ # 1) setsid "$TERMINAL" -e alsamixer & ;;
+ # 2) amixer sset Master toggle ;;
+ # 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
+ # 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;;
+ 1) setsid "$TERMINAL" -e pulsemixer & ;;
+ 2) pulsemixer --toggle-mute ;;
+ 4) pulsemixer --change-volume +5 ;;
+ 5) pulsemixer --change-volume -5 ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change."
esac
-volstat="$(amixer get Master)"
+volstat="$(pactl list sinks)"
+# volstat="$(amixer get Master)" # ALSA only equivalent.
-echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit
+echo "$volstat" | grep -q "Mute: yes" && printf "🔇\\n" && exit
+# echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit # ALSA
-vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q")
+vol="$(echo "$volstat" | grep '^[[:space:]]Volume:' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
+# vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") # ALSA
if [ "$vol" -gt "70" ]; then
icon="🔊"
diff --git a/.profile b/.profile
index 0a5d5ae..7c1f943 100644
--- a/.profile
+++ b/.profile
@@ -18,6 +18,8 @@ export STATUSBAR="${LARBSWM}blocks"
eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)"
# ~/ Clean-up:
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"