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

@ -25,7 +25,7 @@
# SOFTWARE. # SOFTWARE.
from libqtile.config import Key, Screen, Group, Drag, Click from libqtile.config import Key, Screen, Group, Drag, Click
from libqtile.command import lazy from libqtile.lazy import lazy
from libqtile import layout, bar, widget from libqtile import layout, bar, widget

View file

@ -1,5 +1,5 @@
from libqtile import layout as libqtile_layout, layout, bar, widget from libqtile import layout as libqtile_layout, layout, bar, widget
from libqtile.command import lazy from libqtile.lazy import lazy
from libqtile.config import Key, Group, Screen, Drag, Click, Match from libqtile.config import Key, Group, Screen, Drag, Click, Match
# Initialize logging # Initialize logging

View file

@ -19,8 +19,7 @@ class Config(BaseConfig):
cmd_brightness_down = "sudo /usr/bin/xbacklight -dec 10" cmd_brightness_down = "sudo /usr/bin/xbacklight -dec 10"
cmd_screenshot = "/home/kevin/bin/screenshot.sh" cmd_screenshot = "/home/kevin/bin/screenshot.sh"
cmd_alt_screenshot = "/home/kevin/bin/screenshot.sh" cmd_alt_screenshot = "/home/kevin/bin/screenshot.sh"
app_terminal = "ghostty"
app_terminal = "terminator"
web_browser = "firefox" web_browser = "firefox"
file_manager = "thunar" file_manager = "thunar"
app_launcher = "wofi --show drun,run" app_launcher = "wofi --show drun,run"
@ -30,7 +29,7 @@ class Config(BaseConfig):
# Autostart applications # Autostart applications
apps_autostart_group = [ apps_autostart_group = [
{'group': "", 'command': ["firefox"]}, {'group': "", 'command': ["firefox"]},
{'group': "", 'command': ["terminator"]}, {'group': "", 'command': ["ghostty", "--gtk-single-instance=true", "--quit-after-last-window-close=false", "--initial-window=true"]},
{'group': "", 'command': ["/usr/bin/rambox"]}, {'group': "", 'command': ["/usr/bin/rambox"]},
{'group': "", 'command': ["thunar"]}, {'group': "", 'command': ["thunar"]},
{'group': "", 'command': ["thunderbird"]}, {'group': "", 'command': ["thunderbird"]},

View file

@ -15,7 +15,7 @@ from libqtile.log_utils import logger
logger.warning("Importing qtile theme requirements...") logger.warning("Importing qtile theme requirements...")
from libqtile.config import Key, Screen, Group, Drag, Click, Match 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 libqtile import layout, bar, widget, qtile
from qtile_extras import widget as extra_widget from qtile_extras import widget as extra_widget
@ -214,7 +214,7 @@ class Kuro(BaseTheme):
## ##
# Debug keyboard shortcuts # 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 # Show extensive window info
Key([self.mod, "shift", "control"], "i", lazy.function(self.show_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...") logger.warning("Restoring wallpaper...")
if self.current_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() p.wait()
else: else:
wallpaper = None wallpaper = None
@ -622,6 +622,9 @@ class Kuro(BaseTheme):
# Update color scheme # Update color scheme
self.update_colorscheme() self.update_colorscheme()
# Setup XDG Desktop Portal
self.setup_xdg_desktop_portal()
# After first startup is complete, autostart configured apps # After first startup is complete, autostart configured apps
logger.warning("Autostarting apps...") logger.warning("Autostarting apps...")
for app in Config.get("apps_autostart", []): for app in Config.get("apps_autostart", []):
@ -745,7 +748,7 @@ class Kuro(BaseTheme):
def update_colorscheme(self, *args, **kwargs): def update_colorscheme(self, *args, **kwargs):
if self.current_wallpaper: if self.current_wallpaper:
logger.warning(f"Updating wal colors for wallpaper {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() p.wait()
colors = None colors = None
@ -843,3 +846,12 @@ class Kuro(BaseTheme):
utils.notify(qtile, utils.notify(qtile,
"Updated colorscheme!", "Updated colorscheme!",
f"active: {colors['color15']}, inactive: {colors['color1']}") 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"])

View file

@ -201,18 +201,18 @@ class DualPaneTextboxBase(base._Widget):
self.changed = False self.changed = False
@expose_command() @expose_command()
def set_font(self, font=base.UNSPECIFIED, fontsize_left=base.UNSPECIFIED, fontsize_right=base.UNSPECIFIED, fontshadow=base.UNSPECIFIED): def set_font(self, font=None, fontsize_left=0, fontsize_right=0, fontshadow=""):
""" """
Change the font used by this widget. If font is None, the current Change the font used by this widget. If font is None, the current
font is used. font is used.
""" """
if font is not base.UNSPECIFIED: if font is not None:
self.font = font self.font = font
if fontsize_left is not base.UNSPECIFIED: if fontsize_left != 0:
self.fontsize_left = fontsize_left self.fontsize_left = fontsize_left
if fontsize_right is not base.UNSPECIFIED: if fontsize_right != 0:
self.fontsize_right = fontsize_right self.fontsize_right = fontsize_right
if fontshadow is not base.UNSPECIFIED: if fontshadow != "":
self.fontshadow = fontshadow self.fontshadow = fontshadow
self.bar.draw() self.bar.draw()