dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit 4a5844d48bb58ef244c5f793254125d07a91d5ad
parent bf49606d2feb32cc23fba89c51e60b2af2130113
Author: regexghost <dev@regexghost.com>
Date:   Fri,  7 Aug 2026 22:31:11 +0100

all option in setup, headphone volume control on super+shift+brackets, show relevant volume and icon in panel

Diffstat:
Minit.sh | 6++++--
Mjwm/.config/jwm/jwmrc | 2++
Mpanel-scripts/lemonbar-bar.sh | 9+++++++--
Msetup.sh | 7+++++++
Mwm-scripts/volume.sh | 29+++++++++++++++++++----------
5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/init.sh b/init.sh @@ -43,8 +43,10 @@ fi chsh # Random setup -echo "50" > ~/.cache/volume -echo "no" > ~/.cache/muted +mkdir ~/.cache/panel_volume +echo "50" > ~/.cache/panel_volume/volume +echo "no" > ~/.cache/panel_volume/muted +echo "default" > ~/.cache/panel_volume/sink mkdir -p ~/.config/aspell/ mkdir -p ~/.local/share/aspell/ sudo systemctl enable --now bluetooth diff --git a/jwm/.config/jwm/jwmrc b/jwm/.config/jwm/jwmrc @@ -181,6 +181,8 @@ <Key mask="4S" key="bracketleft">exec:~/.local/share/regexghost/panel/music-moc.sh --toggle-pause</Key> <Key mask="4" key="bracketleft">exec:~/.local/share/regexghost/wm-scripts/volume.sh --down</Key> <Key mask="4" key="bracketright">exec:~/.local/share/regexghost/wm-scripts/volume.sh --up</Key> + <Key mask="4S" key="bracketleft">exec:~/.local/share/regexghost/wm-scripts/volume.sh --down --bluez</Key> + <Key mask="4S" key="bracketright">exec:~/.local/share/regexghost/wm-scripts/volume.sh --up --bluez</Key> <Key mask="4S" key="slash">exec:~/.local/share/regexghost/wm-scripts/volume.sh --toggle-mute</Key> <Key mask="4S" key="apostrophe">exec:~/.local/share/regexghost/wm-scripts/keyboard-settings.sh</Key> <Key mask="4" key="Return">exec:st</Key> diff --git a/panel-scripts/lemonbar-bar.sh b/panel-scripts/lemonbar-bar.sh @@ -39,10 +39,15 @@ update_network_down () { } update_vol () { - if [ $(cat ~/.cache/muted) = "yes" ]; then + if [ "$(cat ~/.cache/panel_volume/sink)" = "bluez" ]; then + icon="" + else + icon="" + fi + if [ "$(cat ~/.cache/panel_volume/muted)" = "yes" ]; then vol="${muted_colour}${COLOUR_RESET}" else - vol="${volume_colour} $(cat ~/.cache/volume)%%${COLOUR_RESET}" + vol="${volume_colour}${icon} $(cat ~/.cache/panel_volume/volume)%%${COLOUR_RESET}" fi } diff --git a/setup.sh b/setup.sh @@ -4,6 +4,13 @@ file="lists/$2" sub="$HOME/.local/bin/sub" +if [ "$2" = "all" ]; then + for x in lists/*; do + "$0" "$1" "$(basename "$x")" + done + exit +fi + exec 3<&0 if [ "$1" = "save" ]; then while read -r filepath; do diff --git a/wm-scripts/volume.sh b/wm-scripts/volume.sh @@ -1,33 +1,42 @@ #!/bin/sh -VOLUME_CACHE_FILE="$XDG_CACHE_HOME/volume" -MUTED_CACHE_FILE="$XDG_CACHE_HOME/muted" +VOLUME_CACHE_FILE="$XDG_CACHE_HOME/panel_volume/volume" +MUTED_CACHE_FILE="$XDG_CACHE_HOME/panel_volume/muted" +SINK_CACHE_FILE="$XDG_CACHE_HOME/panel_volume/sink" + +if [ "$2" = "--bluez" ]; then + sink="$(pactl list sinks | grep "Name:" | grep "bluez" | sed 's/.*Name: //g')" + echo "bluez" > "$SINK_CACHE_FILE" +else + sink="@DEFAULT_SINK@" + echo "default" > "$SINK_CACHE_FILE" +fi volume_up () { - current_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | awk ' /Volume/ {print $5}' | sed 's/%//g') + current_volume=$(pactl get-sink-volume "$sink" | awk ' /Volume/ {print $5}' | sed 's/%//g') if [ $current_volume -gt 97 ]; then - pactl set-sink-volume @DEFAULT_SINK@ 100% + pactl set-sink-volume "$sink" 100% echo "100" > "$VOLUME_CACHE_FILE" else - pactl set-sink-volume @DEFAULT_SINK@ +3% + pactl set-sink-volume "$sink" +3% echo $((current_volume+3)) > "$VOLUME_CACHE_FILE" fi } volume_down () { - current_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | awk ' /Volume/ {print $5}' | sed 's/%//g') + current_volume=$(pactl get-sink-volume "$sink" | awk ' /Volume/ {print $5}' | sed 's/%//g') if [ $current_volume -lt 3 ]; then - pactl set-sink-volume @DEFAULT_SINK@ 0% + pactl set-sink-volume "$sink" 0% echo "0" > "$VOLUME_CACHE_FILE" else - pactl set-sink-volume @DEFAULT_SINK@ -3% + pactl set-sink-volume "$sink" -3% echo $((current_volume-3)) > "$VOLUME_CACHE_FILE" fi } toggle_mute () { - pactl set-sink-mute @DEFAULT_SINK@ toggle - pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}' > "$MUTED_CACHE_FILE" + pactl set-sink-mute "$sink" toggle + pactl get-sink-mute "$sink" | awk '{print $2}' > "$MUTED_CACHE_FILE" } if [ "$1" = "--up" ]; then