From 9a01abb83b0688f8cb4041ddda2ff152186685db Mon Sep 17 00:00:00 2001 From: installer Date: Wed, 7 May 2025 20:11:04 +0200 Subject: [PATCH] Poprawa integracji z portalem XDG i wsparcie dla Ulaunchera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dodano `xdg-desktop-portal-hyprland` do konfiguracji systemowej, Hyprlanda oraz środowiska użytkownika. - Włączono obsługę `dbus` w `initrd`, co może być wymagane przez `xdg-desktop-portal`. - Rozszerzono konfigurację portali XDG o jawne ustawienia priorytetów (`gtk`, `hyprland`). - Dodano `ulauncher` oraz `wmctrl` do listy narzędzi, a także nowe skróty klawiszowe do jego uruchamiania. - Pomimo zmian, integracja portalu XDG nie działa jeszcze zgodnie z oczekiwaniami. --- config/hyprland.nix | 3 + hosts/garand-laptop/config/boot.nix | 1 + hosts/garand-laptop/config/nixpkgs.nix | 16 ++++- hosts/garand-laptop/config/nixpkgs/tools.nix | 2 + hosts/garand-laptop/config/programs.nix | 5 ++ hosts/garand-laptop/home/misc.nix | 23 ++++++- scripts/list-hypr-bindings.nix | 1 + scripts/web-search.nix | 66 ++++++++++---------- 8 files changed, 81 insertions(+), 36 deletions(-) diff --git a/config/hyprland.nix b/config/hyprland.nix index 2c89971..87c121d 100644 --- a/config/hyprland.nix +++ b/config/hyprland.nix @@ -1,5 +1,6 @@ { lib, + pkgs, username, host, config, @@ -18,6 +19,7 @@ in enable = true; xwayland.enable = true; systemd.enable = true; + portalPackage = pkgs.xdg-desktop-portal-hyprland; extraConfig = let modifier = "SUPER"; in @@ -192,6 +194,7 @@ in bind = ${modifier},SPACE,togglespecialworkspace bind = ${modifier},Return,exec,${terminal} bind = ${modifier}SHIFT,Return,exec,rofi-launcher + bind = ${modifier}ALT,SPACE,exec,ulauncher-toggle bind = ${modifier}ALT,W,exec,wallsetter bind = ${modifier}SHIFT,S,exec,screenshootin bind = ${modifier},E,exec,emopicker9000 diff --git a/hosts/garand-laptop/config/boot.nix b/hosts/garand-laptop/config/boot.nix index 7bf4541..8ad8ea2 100644 --- a/hosts/garand-laptop/config/boot.nix +++ b/hosts/garand-laptop/config/boot.nix @@ -18,6 +18,7 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; + initrd.systemd.dbus.enable = true; # Make /tmp a tmpfs tmp = { useTmpfs = false; diff --git a/hosts/garand-laptop/config/nixpkgs.nix b/hosts/garand-laptop/config/nixpkgs.nix index dcb4818..ecc8251 100644 --- a/hosts/garand-laptop/config/nixpkgs.nix +++ b/hosts/garand-laptop/config/nixpkgs.nix @@ -25,6 +25,11 @@ nixpkgs.config = { allowUnfree = true; pulseaudio = true; + # packageOverrides = pkgs: { + # ulauncher = pkgs.ulauncher.override { + # autoStart = true; + # }; + # }; }; # Extra Portal Configuration @@ -34,12 +39,19 @@ wlr.enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk - pkgs.xdg-desktop-portal + pkgs.xdg-desktop-portal-hyprland ]; + config = { + common = { + default = [ + "gtk" + "hyprland" + ]; + }; + }; configPackages = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland - pkgs.xdg-desktop-portal ]; }; diff --git a/hosts/garand-laptop/config/nixpkgs/tools.nix b/hosts/garand-laptop/config/nixpkgs/tools.nix index 762dc5e..5264b06 100644 --- a/hosts/garand-laptop/config/nixpkgs/tools.nix +++ b/hosts/garand-laptop/config/nixpkgs/tools.nix @@ -13,5 +13,7 @@ # lazygit docker-slim dex + ulauncher + wmctrl ]; } diff --git a/hosts/garand-laptop/config/programs.nix b/hosts/garand-laptop/config/programs.nix index c66d10c..c14620f 100644 --- a/hosts/garand-laptop/config/programs.nix +++ b/hosts/garand-laptop/config/programs.nix @@ -69,6 +69,11 @@ }; }; }; + hyprland = { + enable = true; + withUWSM = true; + portalPackage = pkgs.xdg-desktop-portal-hyprland; + }; dconf.enable = true; seahorse.enable = true; fuse.userAllowOther = true; diff --git a/hosts/garand-laptop/home/misc.nix b/hosts/garand-laptop/home/misc.nix index 198bb3d..1d63b5f 100644 --- a/hosts/garand-laptop/home/misc.nix +++ b/hosts/garand-laptop/home/misc.nix @@ -1,10 +1,31 @@ -{...}: { +{pkgs, ...}: { # Create XDG Dirs xdg = { + enable = true; userDirs = { enable = true; createDirectories = true; }; + portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + config = { + common = { + default = [ + "gtk" + "hyprland" + ]; + }; + }; + configPackages = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + }; }; dconf.settings = { diff --git a/scripts/list-hypr-bindings.nix b/scripts/list-hypr-bindings.nix index c286b4b..dc835f0 100755 --- a/scripts/list-hypr-bindings.nix +++ b/scripts/list-hypr-bindings.nix @@ -49,6 +49,7 @@ in " + Prawy przycisk myszy" "Zmień rozmiar okna" "resizewindow" \ " + ENTER" "Otwórz terminal" "${terminal}" \ " + SHIFT + ENTER" "Uruchom launcher aplikacji" "rofi-launcher" \ + " + ALT + SPACE" "Uruchom Ulauncher" "ulauncher-toggle" \ " + ALT + W" "Zmień tapetę" "wallsetter" \ " + SHIFT + S" "Zrób zrzut ekranu" "screenshootin" \ " + E" "Uruchom selektor emotikon" "emopicker9000" \ diff --git a/scripts/web-search.nix b/scripts/web-search.nix index 98ce219..bf0428a 100644 --- a/scripts/web-search.nix +++ b/scripts/web-search.nix @@ -1,43 +1,43 @@ {pkgs}: pkgs.writeShellScriptBin "web-search" '' - declare -A URLS + declare -A URLS - URLS=( - ["🌎 Search"]="https://search.garandplg.com/search?q=" - ["❄️ Unstable Packages"]="https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=" - ["🎞️ YouTube"]="https://www.youtube.com/results?search_query=" - ["❄️ NixOS Wiki"]="https://nixos.wiki/index.php?search=" - ["🔎 Wikipedia"]="https://pl.wikipedia.org/w/index.php?ns0=1&search=" - ["👨‍💻 StackOverflow"]="https://stackoverflow.com/search?q=" - ) + URLS=( + ["🌎 Search"]="https://search.garandplg.com/search?q=" + ["❄️ Unstable Packages"]="https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=" + ["🎞️ YouTube"]="https://www.youtube.com/results?search_query=" + ["❄️ NixOS Wiki"]="https://nixos.wiki/index.php?search=" + ["🔎 Wikipedia"]="https://pl.wikipedia.org/w/index.php?ns0=1&search=" + ["👨‍💻 StackOverflow"]="https://stackoverflow.com/search?q=" + ) - # List for rofi - gen_list() { - for i in "''${!URLS[@]}" - do - echo "$i" - done - } + # List for rofi + gen_list() { + for i in "''${!URLS[@]}" + do + echo "$i" + done + } - main() { - # Pass the list to rofi - platform=$( (gen_list) | ${pkgs.wofi}/bin/wofi -dmenu ) + main() { + # Pass the list to rofi + platform=$( (gen_list) | ${pkgs.wofi}/bin/wofi -dmenu ) - if [[ -n "$platform" ]]; then - query=$( (echo ) | ${pkgs.wofi}/bin/wofi -dmenu ) + if [[ -n "$platform" ]]; then + query=$( (echo ) | ${pkgs.wofi}/bin/wofi -dmenu ) - if [[ -n "$query" ]]; then - url=''${URLS[$platform]}$query - xdg-open "$url" - else - exit - fi - else - exit - fi - } + if [[ -n "$query" ]]; then + url=''${URLS[$platform]}$query + xdg-open "$url" + else + exit + fi + else + exit + fi + } - main + main - exit 0 + exit 0 ''