From 3829f7a3a1b9d222daa321aa319fd4397bd6f175 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 24 Jul 2026 20:25:21 +0300 Subject: [PATCH] Feat: Stop using PulseAudio and XScreenSaver I switched to PipeWire and builtin DPMS. --- .fvwm/main.m4 | 4 ---- .xinitrc | 26 +++++++++++++++----------- bin/mplay | 29 ++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.fvwm/main.m4 b/.fvwm/main.m4 index 512207f..374f7b9 100644 --- a/.fvwm/main.m4 +++ b/.fvwm/main.m4 @@ -524,7 +524,6 @@ AddToFunc StartStandardSession + I GotoDeskAndPage 0 0 0 + I TERM_KOI8 + I Wait TERM -+ I Exec exec cgmem_nice 200 pulseaudio --start + I PaVuControl + I Exec exec "$HOME"/current/projects/audio-cdr-video/audio/pa-mic-off + I XsetbgFilename @@ -542,7 +541,6 @@ AddToFunc ResumeFunction + I GotoDeskAndPage 0 0 0 + I TERM_KOI8 + I Wait TERM -+ I Exec exec cgmem_nice 200 pulseaudio --start + I None ("Volume Control") PaVuControl + I BrVol50 + I Exec sleep 10; exec "$HOME"/current/projects/audio-cdr-video/audio/pa-mic-off @@ -620,8 +618,6 @@ AddToFunc Raise-All I All Raise DestroyFunc PaVuControl AddToFunc PaVuControl I GotoDeskAndPage 0 1 1 -+ I Exec exec pulseaudio --kill -+ I Exec exec cgmem_nice 200 pulseaudio --start + I Exec exec cgmem_nice 200 pavucontrol + I Wait "Volume Control" diff --git a/.xinitrc b/.xinitrc index 6389c66..97e040a 100644 --- a/.xinitrc +++ b/.xinitrc @@ -56,12 +56,14 @@ setxkbmap -layout 'us,ru' -variant ',common' -option 'grp:toggle,grp:shifts_togg xset r on # screen saver 5 minutes xset s 300 300 -# DPMS on desktop: standby - 1 hour, suspend - 2 hours, off - 4 hours +# Long DPMS on desktop: standby - 1 hour, suspend - 2 hours, off - 4 hours #xset dpms 3600 7200 14400 -# DPMS on notebook: standby - 10 minutes, suspend - 15 minutes, off - 20 minutes -xset dpms 600 900 1200 +# Short DPMS on notebook: standby - 10 minutes, suspend - 15 minutes, off - 20 minutes +#xset dpms 600 900 1200 +# Ultra short DPMS on notebook: standby - 5 minutes, suspend - 10 minutes, off - 15 minutes +xset dpms 300 600 900 -xscreensaver & +#xscreensaver & xbindkeys xxkb & @@ -88,8 +90,12 @@ unset screen_width xclcok_geom # multi-biff #xbuffy -fn '-*-helvetica-bold-r-*-*-*-100-*-*-*-*-koi8-r' -geometry +0+125 -boxfile mail/misc/.xbuffyrc & -(gnome-keyring-daemon --start --daemonize; - exec /usr/lib/notification-daemon/notification-daemon --replace) & +(sleep 10; exec /usr/lib/notification-daemon/notification-daemon --replace) & + +# PipeWire +pipewire & +pipewire-pulse & +wireplumber & if [ -z "$WINDOW_MANAGER" ]; then WINDOW_MANAGER=fvwm2 @@ -98,8 +104,6 @@ fi dbus-launch --exit-with-session gpg-agent --daemon "$WINDOW_MANAGER" -# Stop pulseaudio, xscreensaver and xsetbg.py -pulseaudio --kill -(xscreensaver-command -exit; - "$HOME"/current/projects/xsetbg/xsetbg-http-stop; sleep 1; - exec pkill -f xsetbg) & +# Stop xsetbg.py +("$HOME"/current/projects/xsetbg/xsetbg-http-stop; + sleep 1; exec pkill -f xsetbg) & diff --git a/bin/mplay b/bin/mplay index decfbfe..46b9413 100755 --- a/bin/mplay +++ b/bin/mplay @@ -1,20 +1,31 @@ #! /bin/sh -options="--ao=pulse --quiet" +options="--ao=pipewire --quiet" if [ -n "$AUDIO_VOLUME" ]; then - options="$options --af=loudnorm --volume=$AUDIO_VOLUME" + options="$options --af=loudnorm --volume=$AUDIO_VOLUME" fi -if [ "$DISPLAY" ]; then - (xscreensaver-command -exit - xset -dpms s off) & +if [ -n "$DISPLAY" ]; then + if [ -f "$HOME"/tmp/mplay.lock ]; then + if pgrep -q xscreensaver; then + echo Error: mplay.lock exists but xscreensaver is running >&2 + exit 1 + fi + _lockfile_exists=1 + else + _lockfile_exists=0 + (touch "$HOME"/tmp/mplay.lock; + xscreensaver-command -exit + exec xset -dpms s off) & + fi fi cgmem_nice 1000 mpv $options "$@" -if [ -n "$DISPLAY" ]; then - cd "$HOME" - xset +dpms s on - xscreensaver & +if [ -n "$DISPLAY" -a $_lockfile_exists = 0 ]; then + cd "$HOME" + xset +dpms s on + xscreensaver & + rm -f "$HOME"/tmp/mplay.lock fi -- 2.47.3