Views:
1,965β
Votes: 3β
β
Solution
Tags:
gnome
bash
gsettings
zenity
yad
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/1017046
Title:
Bash one-liner to display ALL `gsettings` in GUI dialog window
ID:
/2018/03/18/Bash-one-liner-to-display-ALL-_gsettings_-in-GUI-dialog-window
Created:
March 18, 2018
Edited: March 19, 2018
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
Yad works but not Zenity (yet)
I tried doing this with zenity
but couldnβt figure it out. I managed to make it work with yad
but after a couple of clock days had to turn to google groups to get help from the yad experts. They fixed my one-liner bash code in 12 hours!
If you donβt have yad
installed already you need to use:
sudo apt install yad
yad
lets you sort the list by any column in ascending/descending order. You can grab the scroll bar to quickly move up and down the list. The Up/Down arrow, PgUp, PgDn, Home and End keys navigate as expected.
The one-liner bash code
Hereβs the bash one-liner code you can copy and paste into your terminal window:
gsettings list-recursively | sed 's/ */\n/;s/ */\n/;s/\&/\&/g' | yad --list --title "gsettings" --item-seperator='\n' --width=1800 --height=800 --wrap-width=600 --column=Group --column=Key --column=Setting --no-markup
This is for a 1080p display where the screen is 1920 pixels wide. If your screen is smaller, reduce the size of these arguments:
--width=1800 --height=800 --wrap-width=600
Sample output
When the yad
scroll box opened I:
- Clicked on the
Group
column heading to sort by group. Otherwise the order is random asgsettings list-recursively
dumps out the database. - Scrolled down
org.gnome.settings-daemon.plugins.power
section. - Noticed a
gsettings
Iβve never seen before but might help me solve suspend problems Iβve encountered (as highlighted in screen shot below)
The one-liner pays for itself right away
Here is the new gsettings
I discovered:
$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor
false
The gsettings
contradicts a systemd
setting I have:
$ cat /etc/systemd/logind.conf | grep -i lidswitchdock | grep -vF "#"
HandleLidSwitchDocked=suspend
dconf-editor a complete GUI application
There is also dconf-editor
a full blown GUI you can use: What is dconf, what is its function, and how do I use it?
To summarize the link, install it using:
sudo apt install dconf-tools
The whole link is highly recommended reading and it covers gsettings
in depth as well.