]> git.phdru.name Git - dotfiles.git/commitdiff
Feat: Stop using PulseAudio and XScreenSaver master
authorOleg Broytman <phd@phdru.name>
Fri, 24 Jul 2026 17:25:21 +0000 (20:25 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 26 Jul 2026 16:18:35 +0000 (19:18 +0300)
I switched to PipeWire and builtin DPMS.

.fvwm/main.m4
.xinitrc
bin/mplay

index 512207f3a6d2fe956e1cd07c5cac9e8052538a8c..a98a39f2ee61db61726c2735dfc32c20dc458dba 100644 (file)
@@ -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"
 
@@ -930,7 +926,7 @@ AddToMenu Brightness    "Current:" Popup CurrentBrightness
 DestroyFunc CurrentVolume
 AddToFunc CurrentVolume
 +              I DestroyMenu recreate CurrentVolume
-+              I PipeRead 'echo AddToMenu CurrentVolume Current:_"$($HOME/current/projects/audio-cdr-video/audio/pa-get-volume)%" Title'
++              I PipeRead 'echo AddToMenu CurrentVolume Current:_"$($HOME/current/projects/audio-cdr-video/audio/pa-volume get | cut -d\\  -f6)" Title'
 
 DestroyMenu CurrentVolume
 AddToMenu CurrentVolume    DynamicPopupAction Function CurrentVolume
index 6389c668ed66af9f1d3280a5f38dc33b846cc6ea..97e040a581d8ba9188778655187e59db7f0f102f 100644 (file)
--- 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) &
index decfbfe8e22fa83a39d12f50821d116c571a4a92..46b941362acfe2ba5cfbf7f05de9e9078965dec1 100755 (executable)
--- 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