Various wayland fixes, ghostty, updates etcetera.

This commit is contained in:
Kevin Alberts 2025-07-25 12:36:49 +02:00
parent 5501824875
commit 737800806d
5 changed files with 25 additions and 14 deletions

View file

@ -15,7 +15,7 @@ from libqtile.log_utils import logger
logger.warning("Importing qtile theme requirements...")
from libqtile.config import Key, Screen, Group, Drag, Click, Match
from libqtile.command import lazy
from libqtile.lazy import lazy
from libqtile import layout, bar, widget, qtile
from qtile_extras import widget as extra_widget
@ -214,7 +214,7 @@ class Kuro(BaseTheme):
##
# Debug keyboard shortcuts
##
Key([self.mod, "control"], "w", lazy.function(display_wm_class)),
Key([self.mod, "shift", "control"], "w", lazy.function(display_wm_class)),
# Show extensive window info
Key([self.mod, "shift", "control"], "i", lazy.function(self.show_window_info)),
@ -594,7 +594,7 @@ class Kuro(BaseTheme):
logger.warning("Restoring wallpaper...")
if self.current_wallpaper:
p = utils.execute_once(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
p = utils.execute_once(["wallust", "run", "{}".format(self.current_wallpaper)])
p.wait()
else:
wallpaper = None
@ -622,6 +622,9 @@ class Kuro(BaseTheme):
# Update color scheme
self.update_colorscheme()
# Setup XDG Desktop Portal
self.setup_xdg_desktop_portal()
# After first startup is complete, autostart configured apps
logger.warning("Autostarting apps...")
for app in Config.get("apps_autostart", []):
@ -745,7 +748,7 @@ class Kuro(BaseTheme):
def update_colorscheme(self, *args, **kwargs):
if self.current_wallpaper:
logger.warning(f"Updating wal colors for wallpaper {self.current_wallpaper}")
p = utils.execute(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
p = utils.execute_once(["wallust", "run", "{}".format(self.current_wallpaper)])
p.wait()
colors = None
@ -843,3 +846,12 @@ class Kuro(BaseTheme):
utils.notify(qtile,
"Updated colorscheme!",
f"active: {colors['color15']}, inactive: {colors['color1']}")
def setup_xdg_desktop_portal(self):
# XDG Desktop portal is used for screensharing, screenshots and filepickers in wayland.
# To work correctly, it needs to have two env variables set in the systemd user session
logger.warning(f"Setting XDG_CURRENT_DESKTOP env and updating XDG Desktop Portal configuration...")
os.environ["XDG_CURRENT_DESKTOP"] = "qtile"
subprocess.Popen(["systemctl", "--user", "import-environment", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP"])
subprocess.Popen(["dbus-update-activation-environment", "--systemd", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP=qtile"])
subprocess.Popen(["systemctl", "--user", "restart", "xdg-desktop-portal"])