mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 04:19:19 -08:00
feat: add gnome support
This commit is contained in:
parent
e9eb56126b
commit
e4d1a62790
3 changed files with 17 additions and 2 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -3,6 +3,11 @@ __pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
|
||||||
|
|
||||||
|
# PyCharm
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
|
||||||
|
|
@ -161,4 +166,4 @@ cython_debug/
|
||||||
|
|
||||||
# App specific files
|
# App specific files
|
||||||
app.log
|
app.log
|
||||||
config.toml
|
config.toml
|
||||||
|
|
|
||||||
10
konawall/environments/gnome.py
Normal file
10
konawall/environments/gnome.py
Normal 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)
|
||||||
|
|
@ -43,7 +43,7 @@ class Konawall(wx.adv.TaskBarIcon):
|
||||||
# Reload (actually load) the config and modules.
|
# Reload (actually load) the config and modules.
|
||||||
if wx.Platform == "__WXGTK__":
|
if wx.Platform == "__WXGTK__":
|
||||||
from xdg_base_dirs import xdg_config_home
|
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__":
|
if wx.Platform == "__WXMAC__":
|
||||||
config_path_string = "~/Library/Application Support/konawall/config.toml"
|
config_path_string = "~/Library/Application Support/konawall/config.toml"
|
||||||
self.config_path = os.path.expanduser(config_path_string)
|
self.config_path = os.path.expanduser(config_path_string)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue