From: <dom...@us...> - 2020-02-17 12:03:56
|
Revision: 997 http://sourceforge.net/p/fvwm-crystal/code/997 Author: dominique_libre Date: 2020-02-17 12:03:55 +0000 (Mon, 17 Feb 2020) Log Message: ----------- Exit: cleanup and try our best to find systemctl when present Modified Paths: -------------- ChangeLog fvwm/components/functions/Exit Modified: ChangeLog =================================================================== --- ChangeLog 2020-02-17 12:00:45 UTC (rev 996) +++ ChangeLog 2020-02-17 12:03:55 UTC (rev 997) @@ -3,6 +3,9 @@ Verion 3.6.0 ------------ +lundi 17 février + fvwm/components/functions/Exit: cleanup and try our best to find systemctl when present + samedi 15 février 2020 fvwm/components/functions/Fullscreen: add Navigator and Firefox into the browser FS workaround Modified: fvwm/components/functions/Exit =================================================================== --- fvwm/components/functions/Exit 2020-02-17 12:00:45 UTC (rev 996) +++ fvwm/components/functions/Exit 2020-02-17 12:03:55 UTC (rev 997) @@ -1,8 +1,19 @@ # Menu for different ways to run away ;) # Created by: Pawel "NEMO" Drygas <ne...@br...> # Modified by Dominique Michel <dom...@so...> for use with -# session managers as gnome-session +# session managers as gnome-session (its old and outdated now) +# + pm-utils and systemd supports - anyway, hibernation is much better +# than session management because it just work and is fast. +# We don't know how fvwm-crystal is started and what its PATH is +InfoStoreAdd sysctl no +Test (x systemctl) InfoStoreAdd sysctl systemctl +# Fallbacks +Test (x /usr/bin/systemctl) InfoStoreAdd sysctl /usr/bin/systemctl +Test (x /bin/systemctl) InfoStoreAdd sysctl /bin/systemctl +Test (x /usr/sbin/systemctl) InfoStoreAdd sysctl /usr/sbin/systemctl +Test (x /sbin/systemctl) InfoStoreAdd sysctl /sbin/systemctl + # ps -C ... truncate the command name (see man 5 proc); use pgrep -f ... DestroyFunc KillAutoHibernate AddToFunc KillAutoHibernate @@ -41,18 +52,14 @@ DestroyFunc AutoHibernate-generator AddToFunc AutoHibernate-generator -+ I InfoStoreAdd sysctl no -+ I Test (x /usr/bin/systemctl) InfoStoreAdd sysctl /usr/bin/systemctl -+ I TestRc (NoMatch) Test (x /bin/systemctl) InfoStoreAdd sysctl /bin/systemctl + I DestroyMenu recreate /AutoHibernate + I Piperead "if test `pkill -0 AutoHibernate`; \ then AddToMenu /AutoHibernate \\'$[gt.Stop]\\' EndAutoHibernate; \ - else if [ $[infostore.sysctl] == no ]; \ + else if [ $[infostore.sysctl] = no ]; \ then echo AddToMenu /AutoHibernate \\'$[gt.Start when battery is as low as]\\' Popup /AutoHibernatePMValue; \ else echo AddToMenu /AutoHibernate \\'$[gt.Start when battery is as low as]\\' Popup /AutoHibernateSysValue; \ fi; \ fi" -+ I InfoStoreRemove sysctl DestroyMenu /AutoHibernate AddToMenu /AutoHibernate @@ -70,18 +77,14 @@ DestroyFunc ScreenLidSuspend-generator AddToFunc ScreenLidSuspend-generator -+ I InfoStoreAdd sysctl no -+ I Test (x /usr/bin/systemctl) InfoStoreAdd sysctl /usr/bin/systemctl -+ I TestRc (NoMatch) Test (x /bin/systemctl) InfoStoreAdd sysctl /bin/systemctl + I DestroyMenu recreate /ScreenLidSuspend + I Piperead "if [ `pgrep -c ScreenLidSuspen` -gt 0 ]; \ then echo AddToMenu /ScreenLidSuspend \\'$[gt.No resume hybride with screen lid]\\' NoScreenLidSuspend; \ - else if [ $[infostore.sysctl] == no ]; \ + else if [ $[infostore.sysctl] = no ]; \ then echo AddToMenu /ScreenLidSuspend \\'$[gt.Resume hybride with screen lid]\\' ScreenLidSuspend pm; \ else echo AddToMenu /ScreenLidSuspend \\'$[gt.Resume hybride with screen lid]\\' ScreenLidSuspend sys; \ fi; \ fi" -+ I InfoStoreRemove sysctl DestroyMenu /ScreenLidSuspend AddToMenu /ScreenLidSuspend @@ -118,9 +121,6 @@ DestroyFunc Exit-Menu AddToFunc Exit-Menu -+ I InfoStoreAdd sysctl no -+ I Test (x /usr/bin/systemctl) InfoStoreAdd sysctl /usr/bin/systemctl -+ I TestRc (NoMatch) Test (x /bin/systemctl) InfoStoreAdd sysctl /bin/systemctl + I DestroyMenu /Exit + I AddToMenu /Exit + I AddToMenu /Exit '%22x22/fvwm-crystal/view-refresh.png%$[gt.Restart]' Restart @@ -127,14 +127,12 @@ + I Test (x /usr/bin/xscreensaver) AddToMenu /Exit '%22x22/fvwm-crystal/system-lock-screen.png%$[gt.Lock screen]' X xscreensaver-command -lock + I Test (EnvIsSet SESSION_MANAGER) AddToMenu /Exit '%22x22/fvwm-crystal/system-log-out.png%$[gt.Logout]' QuitSession + I Test (!EnvIsSet SESSION_MANAGER) AddToMenu /Exit '%22x22/fvwm-crystal/system-log-out.png%$[gt.Logout]' Quit -+ I Test (EnvMatch infostore.sysctl no) Test (x /usr/sbin/pm-hibernate) Exit-Menu-pm -+ I Test (x /bin/systemctl) Exit-Menu-sysctl /bin/systemctl -+ I Test (x /usr/bin/systemctl) Exit-Menu-sysctl /usr/bin/systemctl ++ I Test (EnvMatch infostore.sysctl no) KeepRc Test (x /usr/sbin/pm-hibernate) Exit-Menu-pm ++ I TestRc (NoMatch) Test (x $[infostore.sysctl]) Exit-Menu-sysctl $[infostore.sysctl] + I Test (EnvIsSet SESSION_MANAGER) AddToMenu /Exit '' Nop Test (EnvIsSet SESSION_MANAGER) AddToMenu /Exit '%22x22/fvwm-crystal/gdm.png%$[gt.Save session]' Exec exec gnome-session-save --gui Test (EnvIsSet SESSION_MANAGER) AddToMenu /Exit '%22x22/fvwm-crystal/gdm.png%$[gt.Manage session]' Exec exec gnome-session-properties + I Test (EnvMatch infostore.sysctl no) Exit-SelectLogoutManager -+ I InfoStoreRemove sysctl Exit-Menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |