diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-07 12:50:26 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-07 12:50:26 +0200 |
commit | 0863607a87572acda6276b6251778f2294d21ae6 (patch) | |
tree | 50092b650e944c07859cdb10d47ec27dcb6ff4ad /modules/home.legacy/conf/xdg | |
parent | refactor(modules/legacy/ytcc): Remove (diff) | |
download | nixos-config-0863607a87572acda6276b6251778f2294d21ae6.zip |
refactor(modules/xdg): Migrate to by-name and fix firefox dep in url-handler
Diffstat (limited to '')
-rwxr-xr-x | modules/by-name/xd/xdg/scripts/url-handler.sh (renamed from modules/home.legacy/conf/xdg/url-handler.sh) | 4 | ||||
-rw-r--r-- | modules/home.legacy/conf/xdg/default.nix | 59 | ||||
-rw-r--r-- | modules/home.legacy/conf/xdg/xdg_vars.nix | 29 |
3 files changed, 2 insertions, 90 deletions
diff --git a/modules/home.legacy/conf/xdg/url-handler.sh b/modules/by-name/xd/xdg/scripts/url-handler.sh index f15df384..5aa01a48 100755 --- a/modules/home.legacy/conf/xdg/url-handler.sh +++ b/modules/by-name/xd/xdg/scripts/url-handler.sh @@ -10,9 +10,9 @@ if [ "$project" = "nvim" ]; then elif [ "$project" = "zathura" ]; then zathura "$1" elif [ "$project" ]; then - firefox -P "$project" "$1" + tskm open "$project" "$1" else - notify-send "(URL HANDLER) No project selected" && exit 1 + notify-send "(URL HANDLER) No project selected"; exit 1 fi # vim: ft=sh diff --git a/modules/home.legacy/conf/xdg/default.nix b/modules/home.legacy/conf/xdg/default.nix deleted file mode 100644 index ad0cd226..00000000 --- a/modules/home.legacy/conf/xdg/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - url-handler = pkgs.writeShellApplication { - name = "url-handler"; - text = builtins.readFile ./url-handler.sh; - inheritPath = false; - runtimeInputs = [ - pkgs.rofi - pkgs.libnotify - pkgs.zathura - pkgs.tskm - ]; - }; -in { - imports = [ - ./xdg_vars.nix - ]; - - xdg = { - mimeApps = { - enable = true; - defaultApplications = { - "application/pdf" = ["url-handler.desktop"]; - "application/x-pdf" = ["url-handler.desktop"]; - - "text/html" = ["url-handler.desktop"]; - "text/xml" = ["url-handler.desktop"]; - "x-scheme-handler/http" = ["url-handler.desktop"]; - "x-scheme-handler/https" = ["url-handler.desktop"]; - "x-scheme-handler/about" = ["url-handler.desktop"]; - "x-scheme-handler/unknown" = ["url-handler.desktop"]; - }; - }; - desktopEntries = { - url-handler = { - name = "url-handler"; - genericName = "Web Browser"; - exec = "${lib.getExe url-handler} %u"; - terminal = false; - categories = [ - "Application" - "Network" - "WebBrowser" - ]; - mimeType = [ - "text/html" - "text/xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - "x-scheme-handler/about" - "x-scheme-handler/unknown" - ]; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/xdg/xdg_vars.nix b/modules/home.legacy/conf/xdg/xdg_vars.nix deleted file mode 100644 index aa2f30d4..00000000 --- a/modules/home.legacy/conf/xdg/xdg_vars.nix +++ /dev/null @@ -1,29 +0,0 @@ -{config, ...}: let - inherit (config.xdg) dataHome; -in { - # FIXME: Move these options in relevant modules, that are connected to their software. - # <2024-10-21> - - # Variables that only have to be set because special applications fail to set reasonable - # defaults (mostly understandable because of backwards-compatibility, but yeah) - home.sessionVariables = { - CARGO_HOME = "${dataHome}/cargo"; - GRADLE_USER_HOME = "${dataHome}/gradle"; - - #_JAVA_OPTIONS = lib.concatStringsSep " " [ - # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"'' - # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"'' - # ]; - #GOPATH = "${config.xdg.dataHome}/go"; - #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - #RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; - #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; - #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages"; - #XAUTHORITY = "${config.xdg.stateHome}/Xauthority"; - #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}"; - #IPYTHONDIR = "${config.xdg.configHome}/ipython"; - #PARALLEL_HOME = "${config.xdg.configHome}/parallel"; - #STACK_XDG = "1"; - #WINEPREFIX = "${config.xdg.dataHome}/wine"; - }; -} |