summaryrefslogtreecommitdiffstats
path: root/lass/2configs/xdg-open.nix
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-02-21 07:35:27 +0100
committerlassulus <git@lassul.us>2023-02-21 07:46:15 +0100
commit0ea072393307e5cd250b412dd0026bf8f6f1251b (patch)
tree8d2ad34977bb7dba1ba25c62d6030f4a3be54b1a /lass/2configs/xdg-open.nix
parent92cfeace5435e09b203a1e4f91eee28bd5d198ce (diff)
l browsers: use firefox directly, RIP xjails
Diffstat (limited to 'lass/2configs/xdg-open.nix')
-rw-r--r--lass/2configs/xdg-open.nix26
1 files changed, 13 insertions, 13 deletions
diff --git a/lass/2configs/xdg-open.nix b/lass/2configs/xdg-open.nix
index 88ea7ba59..02c551a2b 100644
--- a/lass/2configs/xdg-open.nix
+++ b/lass/2configs/xdg-open.nix
@@ -1,12 +1,13 @@
{ config, pkgs, lib, ... }: with import <stockholm/lib>; let
xdg-open-wrapper = pkgs.writeDashBin "xdg-open" ''
- /run/wrappers/bin/sudo -u lass ${xdg-open} "$@"
+ exec ${xdg-open}/bin/xdg-open "$@" >> /tmp/xdg-debug.log 2>&1
'';
- xdg-open = pkgs.writeBash "xdg-open" ''
- set -e
+ xdg-open = pkgs.writeBashBin "xdg-open" ''
+ set -xe
FILE="$1"
+ PATH=/run/current-system/sw/bin
mime=
case "$FILE" in
@@ -35,15 +36,13 @@
case "$mime" in
special/mailaddress)
- urxvtc --execute vim "$FILE" ;;
- ${optionalString (hasAttr "browser" config.lass) ''
+ alacritty --execute vim "$FILE" ;;
text/html)
- ${config.lass.browser.select}/bin/browser-select "$FILE" ;;
+ firefox "$FILE" ;;
text/xml)
- ${config.lass.browser.select}/bin/browser-select "$FILE" ;;
- ''}
+ firefox "$FILE" ;;
text/*)
- urxvtc --execute vim "$FILE" ;;
+ alacritty --execute vim "$FILE" ;;
image/*)
sxiv "$FILE" ;;
application/x-bittorrent)
@@ -51,17 +50,18 @@
application/pdf)
zathura "$FILE" ;;
inode/directory)
- sudo -u lass -i urxvtc --execute mc "$FILE" ;;
+ alacritty --execute mc "$FILE" ;;
*)
# open dmenu and ask for program to open with
- $(dmenu_path | dmenu) "$FILE";;
+ runner=$(print -rC1 -- ''${(ko)commands} | dmenu)
+ exec $runner "$FILE";;
esac
'';
in {
environment.systemPackages = [ xdg-open-wrapper ];
security.sudo.extraConfig = ''
- cr ALL=(lass) NOPASSWD: ${xdg-open} *
- ff ALL=(lass) NOPASSWD: ${xdg-open} *
+ cr ALL=(lass) NOPASSWD: ${xdg-open}/bin/xdg-open *
+ ff ALL=(lass) NOPASSWD: ${xdg-open}/bin/xdg-open *
'';
}