I am searching for FVWM own Restart and Shutdown of the computer. Not “sudo shutdown -h” requiring root access but a button that does the job. Currently using FvwmScript-ConfirmQuit to logout and then shut down with login manager.
Hi @rasat,
Well, this isn’t a FVWM problem. Your typical option is to use sudo
as that’s the only level of permission you can use to invoke shutdown -h now
. That said, if you’re on Linux, and using systemd, there might be a way using that.
Would be good if FVWM can provide the restart/shutdown buttons, or a simple script if anyone wants. I found one yad script that does the job except for logout. Works in Systemd and SysV. Check yad script “Logout dialog”.
Not Fvwm, but look in /etc/sudoers for instructions on how to make the shutdown command work for ordinary users. Then you won’t have to use the sudo command.
Would be good if FVWM can provide the restart/shutdown buttons, or a simple script if anyone wants. I found one yad script that does the job except for logout. Works in Systemd and SysV. Check yad script “Logout dialog”.
This is not an Fvwm issue, and there isn’t a general method that works across all the oses that users of Fvwm use. Fvwm is meant to be user configured, and you’ll have to configure the method that works best for you, then bind the action to the buttons. You can setup sudo to run those commands with no password, then just bind sudo shutdown -h now
to a button, menu, key binding, FvwmScript dialog and so on. You can configure policykit, polkit, systemd or various other methods to allow your user to run the shutdown commands as a normal user, then bind those commands as you see fit.
As a window manager Fvwm provides you the tools to build it into a desktop you want, but it will take a bit of work on your end to configure your system to allow privilege escalation to run shutdown and restart commands. And there is no universal way to do this across the oses. For instance the script you link assumes the user has properly installed and configured sudo correctly to use those commands. So this isn’t something Fvwm can provide as it requires the presence and configuration of other software.
Thanks, got the point. In MX Linux this by default (for ordinary users).
sudo /sbin/poweroff
sudo /sbin/reboot
For MX, I can use the below-modified script if I don’t find something better. I have been trying to avoid external scripts in FVWM but recently included Yad to have one small calendar with the Day/Time button. Now, maybe for logout.
#! /bin/bash
action=$(yad --width 260 --entry --title "System Logout" \
--image=gnome-shutdown \
--button="gtk-ok:0" --button="gtk-close:1" \
--text "Choose action:" \
--entry-text \
"Power Off" "Reboot")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 2 ]]; then
gdmflexiserver --startnew &
exit 0
fi
case $action in
Power*) cmd="sudo /sbin/poweroff" ;;
Reboot*) cmd="sudo /sbin/reboot" ;;
*) exit 1 ;;
esac
eval exec $cmd
I will check how " sudo /sbin/poweroff / reboot" looks in FvwmButtonts.
I have been trying to avoid external scripts in FVWM.
This is silly, Fvwm is only a window manager, it isn’t a full desktop or os, you will need external scripts and software for almost anything that is not directly related to managing windows (shutdown and restarts of the computer is not related to managing windows for instance). Fvwm provides you tools to launch and link external software. If you want to use Fvwm to make a full desktop you’ll have to either use someone else’s script or write your own. For instance look at the desktops based off of Fvwm, such as NsCDE, fvwm-crystal, or fvwm-nightshade. These are full of external scripts and require third party software to run.
This is not what I meant by saying “to avoid external scripts”. Moreover, FVWM is more than “only a window manager”.
That what I also earlier thought (2005) until recently. Took a look at what FVWM3 does alone as a 2.3MB package (+ dependencies). Without adding other languages or scripts. Asking myself if FVWM can improve/speed-up my daily workflow and efficiency?
All WMs and DEs do window management in one way or another. But very few focus on getting the actual work done (why using a computer) with speed and less distraction. In this regard, FVWM has on its own all that is needed. At present, I created 15 extensions (modules) to improve my work efficiency simply by using what FVWM3 is providing. This is what I meant by not using external scripts. As an example, the yad script is not needed for a restart/shutdown panel. FvwmButtons does it.