What command do I need to use if I want to create a custom keyboard shortcut to open the Gnome file manager to the home directory? (Fedora 36 and Gnome)
I tried gnome-open ~ and also triedgnome-open . and neither of them seem to work when used as a Keyboard Shortcut (although gnome-open ~ works when I run it from the terminal, but I had to first install libgnome )
Is there ALREADY a shortcut for launching the file manager that I just don’t know of?
The “file manager” is called “nautilus” on Gnome. So I usually just go “alt + f2” followed by “nautilus”.
In the keyboard shortcut settings, I see that there is one for “home folder” but it’s disabled. You should just be able to set that to whatever you wish. I just tested it out by setting it to “ctrl shift alt h” and it worked just fine:
I didn’t find one for shutdown/restart. One cannot really restart gnome with Wayland, you must logout and log back in. With X, you can run “alt + f2” and then “r” in the command prompt there to restart. You can use that to run any command really:
The terminal command for turning off/restarting is shutdown, take a look at man shutdown for its options—you should be able to add keyboard shortcuts for them. Although, it may require to be run as sudo so maybe not…
I haven’t used keyboard shortcuts for this stuff in ages. It’s simple enough in Gnome to go “super” and then type “logoff” in the search bar—the first icon that turns up is to log off. Same for shutdown:
systemctl reboot is the system restart command AFAIK. As in …
System Commands:
is-system-running Check whether system is fully running
default Enter system default mode
rescue Enter system rescue mode
emergency Enter system emergency mode
halt Shut down and halt the system
poweroff Shut down and power-off the system
reboot Shut down and reboot the system
kexec Shut down and reboot the system with kexec
exit [EXIT_CODE] Request user instance or container exit
switch-root ROOT [INIT] Change to a different root file system
suspend Suspend the system
hibernate Hibernate the system
hybrid-sleep Hibernate and suspend the system
suspend-then-hibernate Suspend the system, wake after a period of
time, and hibernate
from systemctl --help.
Or … you could use gnome-session-quit <option> where option is one of …
Application Options:
--logout Log out
--power-off Power off
--reboot Reboot
--force Ignoring any existing inhibitors
--no-prompt Don’t prompt for user confirmation
Also, with gnome a couple clicks work from the icon in the upper right corner.
Click on that then select from the menu for lock screen/restart/power off/log off/ and others.