feat: add gnome support

This commit is contained in:
Kat Inskip 2024-03-29 13:20:42 -07:00
parent e9eb56126b
commit e4d1a62790
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
3 changed files with 17 additions and 2 deletions

7
.gitignore vendored
View file

@ -3,6 +3,11 @@ __pycache__/
*.py[cod]
*$py.class
# PyCharm
.idea
# C extensions
*.so
@ -161,4 +166,4 @@ cython_debug/
# App specific files
app.log
config.toml
config.toml

View file

@ -0,0 +1,10 @@
import subprocess
from konawall.module_loader import add_environment
from konawall.imager import combine_to_viewport
@add_environment("gnome_setter")
def set_wallpapers(files: list, displays: list):
file = combine_to_viewport(displays, files)
command = ["gsettings", "set", "org.gnome.desktop.background", "picture-uri", f"file://{file.name}"]
command = ["gsettings", "set", "org.gnome.desktop.background", "picture-uri-dark", f"file://{file.name}"]
subprocess.run(command)

View file

@ -43,7 +43,7 @@ class Konawall(wx.adv.TaskBarIcon):
# Reload (actually load) the config and modules.
if wx.Platform == "__WXGTK__":
from xdg_base_dirs import xdg_config_home
self.config_path = os.path.join(xdg_config_home(), "konawall", "config.toml")
self.config_path = os.path.join(xdg_config_home(), "konawall", "config.toml")
if wx.Platform == "__WXMAC__":
config_path_string = "~/Library/Application Support/konawall/config.toml"
self.config_path = os.path.expanduser(config_path_string)