A site for solving at least some of your technical problems...
A site for solving at least some of your technical problems...
Now a day, I very often lose my Gnome settings. Most of it, I couldn't care less, but a few things are very important, especially the way my windows work: I HATE it when a window comes to the front when clicked on. It is totally crazy to work that way. Gnome supports the normal X11 way but they don't use that as the default, which is sad.
So I wrote a little script in order to be able to reset my settings without having to open CCSM (the Gnome preference tool) although if you have a hard time finding what you are looking for, CCSM can be useful!
There is my current script that fixes my hotkeys (at times called shortcuts) to switch between the first 3 workspaces, to lower or raise a window, and very important: the focus-mode is set to sloppy (strange name!) and auto-raise to false (that too, I don't get it,) and the raise-on-click is set to false otherwise I just go crazy.
#!/bin/sh # Reset hotkeys to what we MUST HAVE. gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Alt>F1']" gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Alt>F2']" gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Alt>F3']" gsettings set org.gnome.desktop.wm.keybindings close "['disabled']" gsettings set org.gnome.desktop.wm.keybindings begin-move "['disabled']" gsettings set org.gnome.desktop.wm.keybindings begin-resize "['disabled']" gsettings set org.gnome.desktop.wm.keybindings cycle-group "['disabled']" gsettings set org.gnome.desktop.wm.keybindings lower "['<Alt>F6']" gsettings set org.gnome.desktop.wm.keybindings raise "['<Alt>F7']" gsettings set org.gnome.desktop.wm.preferences auto-raise "false" gsettings set org.gnome.desktop.wm.preferences focus-mode "sloppy" gsettings set org.gnome.desktop.wm.preferences raise-on-click "false" # Not too sure why I use 2x2 right now, but I had problems with 4x1 gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 2 gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ vsize 2
The last two lines I generally do not need because the number of desktop is not usually getting lost, although they had a bug under 13.10 that would not properly read the number of desktops and thus resetting the width and height to 1x#.
Note: to find all keys available in your current settings, use the 'list-recursively' command:
gsettings list-recursively | less
The compiz (gnome, really) data is saved in ~/.config/dconf/user which unfortunately is a binary file. A text editor should still show you some information, otherwise try using strings as in:
strings ~/.config/dconf/user
Also I want to be able to put my screen to sleep when I hit Super-L. Since I have a server which runs 24/7, I do not use the sleep mode (hibernation) on that computer. The default functionality is to turn on that mode... So instead I edit the key and use the following script:
sh -c 'sleep 1 && xset dpms force off'
I put that in the special user commands. In Ubuntu 24.04 (and a few versions back,) we can do that directly in the Gnome Settings available on Ubuntu. I go to Keyboard (in the left column). Then scroll down until I see View and Customize Shortcuts. Clicking on that one opens a window. Again, I scroll down and click on Custom Shortcuts. This opens yet another window. The first time I click on the + to add a new entry. I name it "Start Screensaver" and use the Super+L as the actual shortcut. As for the command, I enter the script above.
More about the script:
Note that it is possible to bring to monitor back with the "on" option:
xset dpms force on
However, since the screen is off, you'd have a hard time to type that. In most likelihood, if the screen doesn't come back, something happened. Here are three of them I can think of: