guake
guake copied to clipboard
Restore default settings
Please add functionality to restore default settings. Or at least documentation how to do it. Thank you.
In Guake, we use GNOME/GSettings
to manage settings.
You can use gsettings
to reset all settings by gsettings
:
$ gsettings reset-recursively guake.general
There are several scheme used by Guake:
$ gsettings list-schemas | grep guake
guake.general
guake.style.font
guake.style
guake.keybindings
guake.style.background
guake.keybindings.global
guake
guake.keybindings.local
guake.hooks
Bost @.***> 於 2021年8月29日 週日 下午7:36寫道:
Please add functionality to restore default settings. Or at least documentation how to do it. Thank you.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
Thanks.
@Bost Would you like to help create a PR for this?
i could help
I'll assign @Chicchi7393 since they're volunteering here.
@Davidy22 sorry, i tried to make the button, i think i succeded but i can't test because the settings aren't saving when closing (and it gives me two errors at startup (arch with gnome40) )
Are you making any calls to self.settings.general.set_boolean()? That'll probably help you change settings to their original value. I can't see your code, but I suspect you just have the button changing some states in the preferences ui right now.
i got the schemas from the config file (could be unpractical in the future, if you want i'll use os.system
to reset every category of properties available) and on the click it will loop in the schemas to reset using the function self.settings.general.reset
, i can't test because in my case it doesn't even save to the config but i can link the maybe-functioning fork
On quick inspection of the commit, that's a massive amount of changes to prefs.glade for one button being added. Skimming through, a hefty chunk of it seems to be a change in convention? Is the preferences window failing to pop up for you at all, because some side effect in this hefty change might be the cause of that. You can also run guake with guake --debug
for more messages that can help you pinpoint the issue better.
On quick inspection of the commit, that's a massive amount of changes to prefs.glade for one button being added. Skimming through, a hefty chunk of it seems to be a change in convention? Is the preferences window failing to pop up for you at all, because some side effect in this hefty change might be the cause of that. You can also run guake with
guake --debug
for more messages that can help you pinpoint the issue better.
apparently only changing the version of glade changed this much, i'll try to revert and change only the needed
@Davidy22 there is no such thing as --debug, also committed on the fork using glade 3.22.2 but the handler is not called
Oh whoops misremembered, it's --verbose
Oh whoops misremembered, it's --verbose
still, if i do guake -p --verbose
nothing gets logged, now it saves what i set but the reset button doesn't do anything (that should also restart the settings, but it doesn't do it, so i suppose the handler doesn't even get executed)
To get log output, close guake entirely and run guake --verbose
from another terminal to start guake. Pulling your repo and running with --verbose, I get the following message at the moment that I click the reset button:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/guake/prefs.py", line 562, in resetAllSettings_clicked_cb
self.prefDlg.resetAllSettings_clicked_cb(btn)
File "/usr/local/lib/python3.8/dist-packages/guake/prefs.py", line 815, in resetAllSettings_clicked_cb
list_schemas = os.system("gsettings list-schemas | grep guake").split("\n")
AttributeError: 'int' object has no attribute 'split'
For sections of code like the one throwing the error above where no functions from guake are actually being called, you can also write a quick proof of concept in a throwaway file and copy it into guake once you get it to work. Looks like this is just a typing error that could have been tested and fixed outside of guake
Fixed it I suppose, i can’t test run because I’m at school with my iPad but in around 1h and 50m I can test, hope everything works!
Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look
Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look
apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py
Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look
apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py
What kinda code do you run?
You cannot use (and better not use, use subprocess) os.system()
to pipe stuff, it return int because it failed, and return errno.
You should use subprocess to handle the pipe, and for better wrap for spawn new processes.
Just inspecting the error a little bit, and I'm not in sure what context did you manage to get guake_version() to return None, but expected parameter type is string and there's probably a good sensical place for you to add a check somewhere to make that line work.
On a side note, are you installing from source with sudo make install
or some other path? I notice the error path is slightly different from mine. Probably doesn't actually make a difference though
Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look
apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py
What kinda code do you run?
You cannot use (and better not use, use subprocess)
os.system()
to pipe stuff, it return int because it failed, and return errno.You should use subprocess to handle the pipe, and for better wrap for spawn new processes.
i now use subprocess, that error happened after i switched back to subprocess
Just inspecting the error a little bit, and I'm not in sure what context did you manage to get guake_version() to return None, but expected parameter type is string and there's probably a good sensical place for you to add a check somewhere to make that line work.
On a side note, are you installing from source with
sudo make install
or some other path? I notice the error path is slightly different from mine. Probably doesn't actually make a difference though
i do make reinstall in between the changes
well whatever it is, do some logging to try to figure out why guake_version's giving a blank return and add an appropriate check
How's fixing the patch up progressing, @Chicchi7393?
Unassigning due to no response