From 0221b9abb16ec69ea28a5c0bf50082916b71984a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 27 Apr 2023 15:36:14 +0200 Subject: [PATCH] Trying to get xdg portals to work --- home/adrielus/features/cli/default.nix | 4 +++- home/adrielus/features/desktop/common/firefox.nix | 12 ++++++------ home/adrielus/tethys.nix | 5 +++++ hosts/nixos/common/optional/xdg-portal.nix | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/home/adrielus/features/cli/default.nix b/home/adrielus/features/cli/default.nix index f65cbec..11c4a12 100644 --- a/home/adrielus/features/cli/default.nix +++ b/home/adrielus/features/cli/default.nix @@ -19,14 +19,16 @@ comma # Intstall and run programs by sticking a , before them bc # Calculator ncdu # TUI disk usage + du-dust # Similar to du and ncdu in purpose. ripgrep # Better grep fd # Better find + sd # Better sed httpie # Better curl mkpasswd # Hash passwords neofetch # Display system information zip # Zipping files unzip # Unzipping files unrar # For extracting shit from rars - sloc # Useless but fun line of code counter + tokei # Useless but fun line of code counter (sloc alternative) ]; } diff --git a/home/adrielus/features/desktop/common/firefox.nix b/home/adrielus/features/desktop/common/firefox.nix index b3be627..4ee2965 100644 --- a/home/adrielus/features/desktop/common/firefox.nix +++ b/home/adrielus/features/desktop/common/firefox.nix @@ -184,12 +184,12 @@ # {{{ Make firefox the default # Use firefox as the default browser to open stuff. - # xdg.mimeApps.defaultApplications = { - # "text/html" = [ "firefox.desktop" ]; - # "text/xml" = [ "firefox.desktop" ]; - # "x-scheme-handler/http" = [ "firefox.desktop" ]; - # "x-scheme-handler/https" = [ "firefox.desktop" ]; - # }; + xdg.mimeApps.defaultApplications = { + "text/html" = [ "firefox.desktop" ]; + "text/xml" = [ "firefox.desktop" ]; + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + }; # Tell apps firefox is the default browser using an env var. home.sessionVariables.BROWSER = "firefox"; diff --git a/home/adrielus/tethys.nix b/home/adrielus/tethys.nix index 0059745..7a766b2 100644 --- a/home/adrielus/tethys.nix +++ b/home/adrielus/tethys.nix @@ -32,4 +32,9 @@ home.sessionVariables.QT_SCREEN_SCALE_FACTORS = 1.4; # Bigger text in qt apps satellite.dev.enable = true; # Simlink some stuff outside the store + + # Temp stuff + xsession.initExtra = '' + command -v dbus-update-activation-environment >/dev/null 2>&1 && dbus-update-activation-environment --systemd XDG_SESSION_CLASS XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_SESSION_DESKTOP XDG_CURRENT_DESKTOP XDG_SESSION_TYPE DCONF_PROFILE XDG_DESKTOP_PORTAL_DIR DISPLAY WAYLAND_DISPLAY SWAYSOCK XMODIFIERS XCURSOR_SIZE XCURSOR_THEME GDK_PIXBUF_MODULE_FILE GIO_EXTRA_MODULES GTK_IM_MODULE QT_PLUGIN_PATH QT_QPA_PLATFORMTHEME QT_STYLE_OVERRIDE QT_IM_MODULE NIXOS_OZONE_WL || systemctl --user import-environment XDG_SESSION_CLASS XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_SESSION_DESKTOP XDG_CURRENT_DESKTOP XDG_SESSION_TYPE DCONF_PROFILE XDG_DESKTOP_PORTAL_DIR DISPLAY WAYLAND_DISPLAY SWAYSOCK XMODIFIERS XCURSOR_SIZE XCURSOR_THEME GDK_PIXBUF_MODULE_FILE GIO_EXTRA_MODULES GTK_IM_MODULE QT_PLUGIN_PATH QT_QPA_PLATFORMTHEME QT_STYLE_OVERRIDE QT_IM_MODULE NIXOS_OZONE_WL + ''; } diff --git a/hosts/nixos/common/optional/xdg-portal.nix b/hosts/nixos/common/optional/xdg-portal.nix index 4187ad1..b51721d 100644 --- a/hosts/nixos/common/optional/xdg-portal.nix +++ b/hosts/nixos/common/optional/xdg-portal.nix @@ -2,7 +2,7 @@ xdg.portal = { enable = true; xdgOpenUsePortal = true; - extraPortals = [ pkgs.xdg-desktop-portal ]; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; # HACK: copied from @lily on discord.