From 953f603f0783d37e2379f966b5f7866a7dd80bc4 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sat, 12 Nov 2022 17:13:59 +0100 Subject: [PATCH] feat: local config --- .config/X11/xprofile | 6 ++---- .config/mpd/mpd.conf | 4 ++-- .config/sxhkd/sxhkdrc | 10 +++++----- .config/zsh/.zshrc | 7 ++----- .local/bin/audio-notify | 6 ++++-- .local/bin/statusbar/sb-volume | 12 +++++++----- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 71069e1..72ebe3a 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -8,9 +8,9 @@ eval $(dbus-launch --sh-syntax --exit-with-session) xss-lock -- slock & redshift & dunst &> /dev/null & #temp fix +gentoo-pipewire-launcher && wpctl set-volume @DEFAULT_AUDIO_SINK@ 50% & # MPD daemon start (if no other user instance exists) [ ! -s "$XDG_CONFIG_HOME/mpd/pid" ] && mpd -pulsemixer --set-volume 50 sbacklight set 3 & setbg & dwmblocks & @@ -18,9 +18,7 @@ xrdb "$XDG_CONFIG_HOME/X11/xresources" xrdb -merge "$XDG_STATE_HOME/xcolors" xautolock -locker slock -time 5 -corners 000- & -xinput set-prop 'Synaptics TM3072-003' 'libinput Tapping Enabled' 1 & -xinput set-prop 'Synaptics TM3072-003' 'libinput Natural Scrolling Enabled' 1 & -xinput set-prop 'Synaptics TM3072-003' 'libinput Accel Speed' 0.4 & +cursor_setup "Logitech Gaming Mouse G502" & setxkbmap 'fr(oss)' remaps & sxhkd & diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index afedc3a..921e4a6 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -17,8 +17,8 @@ pid_file "~/.config/mpd/pid" sticker_file "~/.config/mpd/sticker.sql" audio_output { - type "pulse" - name "pulse audio" + type "pipewire" + name "PipeWire Output" } audio_output { diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 6082152..e87cbe1 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -3,10 +3,10 @@ # System stuff XF86AudioMute - pulsemixer --toggle-mute; audio-notify + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; audio-notify {XF86AudioLowerVolume, XF86AudioRaiseVolume} - pulsemixer --change-volume {-5, +5}; audio-notify + wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%{-,+}; audio-notify super + {F5, F6} sbacklight {dec,inc} @@ -18,13 +18,13 @@ super + shift + u dmenuumount super + s - dmenuprompt "suspend?" "systemctl suspend" + dmenuprompt "suspend?" "loginctl suspend" super + shift + s - dmenuprompt "shutdown?" "shutdown -h now" + dmenuprompt "shutdown?" "loginctl poweroff" super + shift + r - dmenuprompt "reboot?" "reboot" + dmenuprompt "reboot?" "loginctl reboot" super + BackSpace slock diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 6b444b6..a3601b8 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -71,14 +71,11 @@ precmd_dunctions() { zle-line-init ;} # Use beam shape cursor for each new promp [ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" # Load zsh-history-search -source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null +source $HOME/.local/src/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null # Load zsh-syntax-highlighting -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null +source $HOME/.local/src/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null typeset -A ZSH_HIGHLIGHT_STYLES ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold' ZSH_HIGHLIGHT_STYLES[path]='fg=magenta,bold' ZSH_HIGHLIGHT_STYLES[unknown-token]='bg=red,fg=white,bold' - -# opam configuration -test -r "$OPAMROOT/opam-init/init.zsh" && . "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null || true diff --git a/.local/bin/audio-notify b/.local/bin/audio-notify index f015fb1..47f5f91 100755 --- a/.local/bin/audio-notify +++ b/.local/bin/audio-notify @@ -10,8 +10,10 @@ ###################################################################### -level="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')" -muted="$(pulsemixer --get-mute)" + +level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')" +muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')" + if [ "1" = "$muted" ]; then dunstify -r 100002 "Sound muted" "$level%" diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index eda4ae2..760e153 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -10,19 +10,21 @@ ###################################################################### -vol="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')" -if [ "1" = $(pulsemixer --get-mute) ]; then +level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')" +muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')" + +if [ "1" = "$muted" ]; then icon="婢" else - if [ "$vol" -gt "70" ]; then + if [ "$level" -gt "70" ]; then icon="墳" - elif [ "$vol" -lt "30" ]; then + elif [ "$level" -lt "30" ]; then icon="奄" else icon="奔" fi fi -printf " %s %3d%% " $icon $vol +printf " %s %3d%% " $icon $level