Compare commits

..

No commits in common. "ecfbf9a5570ef56077b60118f8c733d03dad6c61" and "139bd596daad19e52cdc4523a14d646a1623c245" have entirely different histories.

14 changed files with 85 additions and 183 deletions

View file

@ -10,7 +10,7 @@ let
local = mkOption { local = mkOption {
type = types.nonEmptyStr; type = types.nonEmptyStr;
default = "$HOME/" + (concatStrings (builtins.match "/*(.+)" config.remote)); default = "$HOME/" + (lib.strings.concatStrings (builtins.match "/*(.+)" config.remote));
description = "local path to sync"; description = "local path to sync";
}; };
}; };

View file

@ -4,7 +4,7 @@ let
screen = with lib; types.submodule { screen = with lib; types.submodule {
options = { options = {
fps = mkOption { fps = mkOption {
type = types.either types.int (types.nonEmptyListOf types.int); type = types.int;
default = 60; default = 60;
description = "max framerate of screen"; description = "max framerate of screen";
}; };

View file

@ -15,12 +15,6 @@ let
description = "set of commands to be run at sway startup"; description = "set of commands to be run at sway startup";
}; };
execAlways = mkOption {
type = types.listOf (types.either types.nonEmptyStr types.package);
default = [ ];
description = "set of commands to be run at sway reload";
};
extraConfig = mkOption { extraConfig = mkOption {
type = types.str; type = types.str;
default = ""; default = "";
@ -40,35 +34,6 @@ let
}; };
}; };
}); });
build_screen_def = fps_func: with lib; let
output_def = mapAttrsToList
(name: value:
"output ${value.id} mode ${value.mode}@${toString (fps_func value.fps)}Hz"
+ (optionalString (value.pos != null) " position ${value.pos}")
)
cfg.screens;
in
''
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
do
uid=$(id -u $(${pkgs.procps}/bin/ps -o user= -p $pid))
export SWAYSOCK="/run/user/$uid/sway-ipc.$uid.$pid.sock"
if [[ -e "$SWAYSOCK" ]] ; then
echo "sock is $SWAYSOCK"
${config.programs.sway.package}/bin/swaymsg '${concatMapStrings (s: s + " ; ") output_def}'
fi
done
'';
inherit (lib) getExe;
fps_min = fps: with lib; if isInt fps then fps else (foldl' min 2147483647 fps);
fps_max = fps: with lib; if isInt fps then fps else (foldl' max 0 fps);
init_screens_min_fps = with lib; pkgs.writeShellScriptBin "init-screens-min"
(build_screen_def fps_min);
init_screens_max_fps = with lib; pkgs.writeShellScriptBin "init-screens-max"
(build_screen_def fps_max);
init_screens_auto = pkgs.writeShellScriptBin "init-screens-auto" "which run-on-ac && which run-on-bat && run-on-ac ${getExe init_screens_max_fps} && run-on-bat ${getExe init_screens_min_fps} || ${getExe init_screens_max_fps}";
in in
{ {
config = config =
@ -81,7 +46,7 @@ in
bar_config = '' bar_config = ''
bar { bar {
swaybar_command ${getExe waybar_full} swaybar_command ${lib.getExe waybar_full}
} }
''; '';
@ -95,16 +60,15 @@ in
let let
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}"); build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
build_keybind_lines = mapAttrsToList (key: value: "bindsym ${key} ${value}"); build_keybind_lines = mapAttrsToList (key: value: "bindsym ${key} ${value}");
build_exec_lines = e: map (item: "${e} " + (if isString item then item else (getExe item))); build_exec_lines = map (item: "exec " + (if isString item then item else (getExe item)));
build_mode_lines = mapAttrsToList (name: value: '' build_mode_lines = mapAttrsToList (name: value: ''
mode "${name}" { mode "${name}" {
${concatLines (map (item: " " + item ) (build_conf value))}}''); ${strings.concatLines (map (item: " " + item ) (build_conf value))}}'');
in in
([ ] ([ ]
++ (build_definition_lines sway_conf.definitions) ++ (build_definition_lines sway_conf.definitions)
++ (build_keybind_lines sway_conf.keybinds) ++ (build_keybind_lines sway_conf.keybinds)
++ (build_exec_lines "exec" sway_conf.autolaunch) ++ (build_exec_lines sway_conf.autolaunch)
++ (build_exec_lines "exec_always" sway_conf.execAlways)
++ (build_mode_lines sway_conf.modes) ++ (build_mode_lines sway_conf.modes)
++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig ++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig
); );
@ -114,7 +78,7 @@ in
++ lib.optional cfg.sway.bar.enable bar_config ++ lib.optional cfg.sway.bar.enable bar_config
++ (lib.mapAttrsToList ++ (lib.mapAttrsToList
(name: value: (name: value:
"output ${value.id} mode ${value.mode}" "output ${value.id} mode ${value.mode}@${toString value.fps}Hz"
+ (lib.optionalString (value.pos != null) " position ${value.pos}") + (lib.optionalString (value.pos != null) " position ${value.pos}")
) )
cfg.screens) cfg.screens)
@ -125,17 +89,11 @@ in
with cfg; lib.mkIf (enable && sway.enable) { with cfg; lib.mkIf (enable && sway.enable) {
environment.etc."${conf_path}".text = sway_conf; environment.etc."${conf_path}".text = sway_conf;
grimmShared.sway.config.execAlways = [ grimmShared.sway.config.autolaunch = lib.singleton dbus-sway-environment;
dbus-sway-environment
init_screens_auto
];
environment.systemPackages = [ environment.systemPackages = [
waybar_full waybar_full
dbus-sway-environment dbus-sway-environment
init_screens_min_fps
init_screens_max_fps
init_screens_auto
] ++ (with pkgs; [ ] ++ (with pkgs; [
procps procps
slurp slurp

View file

@ -11,8 +11,6 @@ in
usbutils usbutils
opentabletdriver opentabletdriver
ddcutil ddcutil
python312Packages.py-cpuinfo
(writeShellScriptBin "lsiommu" ./lsiommu)
] ++ lib.optionals graphical [ ] ++ lib.optionals graphical [
ddcui ddcui
]; ];
@ -46,15 +44,14 @@ in
boot = { boot = {
kernelParams = [ kernelParams = [
# "splash" "splash"
# "quiet" "quiet"
# "intel_iommu=on" "intel_iommu=on"
# "iommu=force" "iommu=force"
# "pcie_acs_override=downstream" "pcie_acs_override=downstream"
# "mmio_stale_data=full,nosmt" "mmio_stale_data=full,nosmt"
# "pcie_aspm=off" "pcie_aspm=off"
]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ]; ]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ];
loader.efi.canTouchEfiVariables = true;
initrd.availableKernelModules = [ initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"ahci" "ahci"
@ -76,10 +73,10 @@ in
})) }))
]; ];
kernelModules = [ kernelModules = [
# "kvm-intel" "kvm-intel"
# "vfio_pci" "vfio_pci"
# "vfio_iommu_type1" "vfio_iommu_type1"
# "vfio" "vfio"
"ddcci_backlight" "ddcci_backlight"
"i2c-dev" "i2c-dev"
]; ];

View file

@ -1,57 +1,23 @@
{ pkgs, config, lib, system, ... }: { pkgs, config, lib, system, ... }:
let let
cfg = config.grimmShared; cfg = config.grimmShared;
inherit (lib) optionals optional optionalString concatLines getExe; perf_policy = lib.optional (lib.systems.elaborate system).isx86 config.boot.kernelPackages.x86_energy_perf_policy;
inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower;
enable_perf_policy = (lib.elem system x86_energy_perf_policy.meta.platforms);
powersave = with pkgs; writeShellScriptBin "powersave-mode" (concatLines ([
"${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed
"${getExe pkgs.brightnessctl} s 20%" # display brightness
] ++ optionals enable_perf_policy [
"${getExe x86_energy_perf_policy} 15" # power save preference
"${getExe x86_energy_perf_policy} --turbo-enable 0" # disable turbo
] ++ optional cfg.sway.enable "init-screens-min"));
performance = pkgs.writeShellScriptBin "performance-mode" (concatLines ([
"${getExe cpupower} frequency-set frequency-set -g performance -u 5000000" # clock speed
"${getExe pkgs.brightnessctl} s 100%" # display brightness
] ++ optionals enable_perf_policy [
"${getExe x86_energy_perf_policy} 0" # performance preference
"${getExe x86_energy_perf_policy} --turbo-enable 1" # enable turbo
] ++ optional cfg.sway.enable "init-screens-max"));
auto = let inherit (pkgs) tlp; in pkgs.writeShellScriptBin "auto-mode" ''
${tlp}/bin/run-on-ac ${getExe performance}
${tlp}/bin/run-on-bat ${getExe powersave}
'';
in in
{ {
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) { config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
acpi acpi
powertop powertop
brightnessctl ] ++ lib.optionals graphical [
cpupower
powersave
performance
auto
] ++ optionals graphical [
tlpui tlpui
] ++ optional enable_perf_policy x86_energy_perf_policy; ] ++ perf_policy;
services.acpid = {
enable = true;
acEventCommands = getExe auto;
};
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power"; powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
powerManagement.cpuFreqGovernor = lib.mkDefault "normal"; powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
services.power-profiles-daemon.enable = false; services.power-profiles-daemon.enable = false;
services.upower.enable = true; services.upower.enable = true;
#boot.extraModulePackages = [ boot.extraModulePackages = perf_policy;
# cpupower
#] ++ optional enable_perf_policy x86_energy_perf_policy;
services.tlp = { services.tlp = {
enable = true; enable = true;

View file

@ -13,6 +13,7 @@ in
config = with cfg; lib.mkIf (enable && tooling.enable) { config = with cfg; lib.mkIf (enable && tooling.enable) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@") (writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
(writeShellScriptBin "lsiommu" ./lsiommu)
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time") (writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
urlencode urlencode
pstree pstree
@ -29,7 +30,7 @@ in
fbcat fbcat
gomuks gomuks
btop gotop
ranger ranger
wget wget
file file

View file

@ -36,7 +36,7 @@ in
{ {
config = with cfg; lib.mkIf (enable && portals && graphical) { config = with cfg; lib.mkIf (enable && portals && graphical) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(callPackage ../../custom/deskwhich/package.nix { }) (callPackage ../../custom/deskwhich/package.nix {})
zathura zathura
imhex imhex
@ -99,7 +99,7 @@ in
"ranger.desktop" "ranger.desktop"
"dolphin.desktop" "dolphin.desktop"
]; ];
"x-scheme-handler/mailto" = "thunderbird.desktop"; "x-scheme-handler/mailto"="thunderbird.desktop";
"application/vnd.oasis.opendocument.chart" = "calc.desktop"; "application/vnd.oasis.opendocument.chart" = "calc.desktop";
"application/vnd.oasis.opendocument.chart-template" = "calc.desktop"; "application/vnd.oasis.opendocument.chart-template" = "calc.desktop";

View file

@ -17,12 +17,12 @@ in
]; ];
wlr.enable = true; wlr.enable = true;
wlr.settings = with lib; mapAttrs' wlr.settings = lib.mapAttrs'
(name: value: nameValuePair ("screencast_" + name) { (name: value: lib.nameValuePair ("screencast_" + name) {
output_name = value.id; output_name = value.id;
max_fps = if isInt value.fps then value.fps else (foldl' min 2147483647 value.fps); max_fps = value.fps;
chooser_type = "simple"; chooser_type = "simple";
chooser_cmd = "${getExe pkgs.slurp} -f %o -or"; chooser_cmd = "${lib.getExe pkgs.slurp} -f %o -or";
}) })
cfg.screens; cfg.screens;
}; };

View file

@ -78,11 +78,11 @@
"yafas": "yafas" "yafas": "yafas"
}, },
"locked": { "locked": {
"lastModified": 1714566321, "lastModified": 1714482312,
"narHash": "sha256-cTWwPbwYtE8r6MuR+0ybG4CFeE8Sid5XHbFJq4itO+A=", "narHash": "sha256-qs41DgEGR2d6Hh+FnfL/6NagoCtRXDXC7yaGD398EXE=",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "5939d3fb76b25a48a8c0db716ebb6fe28eab3719", "rev": "8cfa2aa1528faa6319e2e5ab664ff463ba57708c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,7 +186,7 @@
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://flakehub.com/f/ipetkov/crane/%3D0.16.1.tar.gz" "url": "https://flakehub.com/f/ipetkov/crane/%2A.tar.gz"
} }
}, },
"darwin": { "darwin": {
@ -220,12 +220,12 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1714544767, "lastModified": 1711952616,
"narHash": "sha256-kF1bX+YFMedf1g0PAJYwGUkzh22JmULtj8Rm4IXAQKs=", "narHash": "sha256-WJvDdOph001fA1Ap3AyaQtz/afJAe7meSG5uJAdSE+A=",
"rev": "73124e1356bde9411b163d636b39fe4804b7ca45", "rev": "209048d7c545905c470f6f8c05c5061f391031a8",
"revCount": 1852, "revCount": 1822,
"type": "tarball", "type": "tarball",
"url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.1852%2Brev-73124e1356bde9411b163d636b39fe4804b7ca45/018f333a-c195-795f-9e07-b43b47d5391f/source.tar.gz" "url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.1822%2Brev-209048d7c545905c470f6f8c05c5061f391031a8/018e98ba-d842-7dad-9d6a-0d0ee173b6b1/source.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@ -382,11 +382,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714515075, "lastModified": 1714430505,
"narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=", "narHash": "sha256-SSJQ/KOy8uISnoZgqDoRha7g7PFLSFP/BtMWm0wUz8Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef", "rev": "f8e6694edabe4aaa7a85aac47b43ea5d978b116d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -430,11 +430,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1714532637, "lastModified": 1714411325,
"narHash": "sha256-2oWMEjkJKYzxLXy3OZ/M41VdbZgZLWmwttry551lUE4=", "narHash": "sha256-td58oD5JOlL8LPglrk+c7rP+nJSJmK7zu0kFGF16XPI=",
"owner": "martinvonz", "owner": "martinvonz",
"repo": "jj", "repo": "jj",
"rev": "7093d5d359fb3649be0d12a975f26d5607ad8f61", "rev": "e54e83b0f5c4a5b7d80894c713ae402a5bb280d0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -467,11 +467,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714551038, "lastModified": 1714468768,
"narHash": "sha256-/b4HT/RYfNkKUUpIzIwsHThLLAuKA70O8W/32sh2N0M=", "narHash": "sha256-lxbNfjtTOcY18E9ODj3ZwJiF8UWr58CH+/9V3eHdtoQ=",
"owner": "YaLTeR", "owner": "YaLTeR",
"repo": "niri", "repo": "niri",
"rev": "af9caa1d9b176fe3606323a8c05c0c741c1f6c0a", "rev": "68ff36f6834beecf74b30a724ae3ef31874a3518",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -657,11 +657,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1714501997, "lastModified": 1711885694,
"narHash": "sha256-g31zfxwUFzkPgX0Q8sZLcrqGmOxwjEZ/iqJjNx4fEGo=", "narHash": "sha256-dyezzeSbWMpflma+E9USmvSxuLgGcNGcGw3cOnX36ko=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "49e502b277a8126a9ad10c802d1aaa3ef1a280ef", "rev": "e4a405f877efd820bef9c0e77a02494e47c17512",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -42,10 +42,6 @@
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/307541.patch"; url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/307541.patch";
hash = "sha256-cyxiWCxBOKrET710C8o9Cwksy64HRez6mB1qF+anHMI="; hash = "sha256-cyxiWCxBOKrET710C8o9Cwksy64HRez6mB1qF+anHMI=";
} }
{
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/308476.patch";
hash = "sha256-J/Bvz4RUn9lP7H4s/c6bZEX9dfWsxfG/dpXYF99U3Vs=";
}
]; ];
customNixosSystem = system: definitions: customNixosSystem = system: definitions:

View file

@ -8,6 +8,10 @@
networking.hostName = "grimmauld-nixos"; networking.hostName = "grimmauld-nixos";
environment.sessionVariables = {
OMP_NUM_THREADS = "12";
};
system.stateVersion = "23.05"; system.stateVersion = "23.05";
grimmShared.gaming = true; grimmShared.gaming = true;

View file

@ -2,9 +2,7 @@
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let
cpus = "12";
in
{ {
imports = imports =
[ [
@ -14,7 +12,6 @@ in
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernelParams = [ "possible_cpus=${cpus}" ];
fileSystems."/" = fileSystems."/" =
{ {
@ -35,20 +32,16 @@ in
size = 48 * 1024; size = 48 * 1024;
}]; }];
environment.sessionVariables = {
OMP_NUM_THREADS = cpus;
};
grimmShared = { grimmShared = {
screens = { screens = {
external = { external = {
id = "HDMI-A-1"; id = "HDMI-A-1";
pos = "0 0"; pos = "0,0";
}; };
internal = { internal = {
id = "eDP-1"; id = "eDP-1";
fps = [ 144 60 ]; fps = 144;
}; };
}; };
laptop_hardware.enable = true; laptop_hardware.enable = true;

View file

@ -1,12 +1,12 @@
{ inputs, system, pkgs, config, lib, ... }: { inputs, system, pkgs, config, lib, ... }:
let let
searchclip = pkgs.writeShellScriptBin "searchclip" '' searchclip = pkgs.writeShellScriptBin "searchclip" ''
xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode) xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode)
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//") browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
swaymsg [app_id="$browser" urgent="newest"] focus swaymsg [app_id="$browser" urgent="newest"] focus
''; '';
in in
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alacritty alacritty
rmenu rmenu
@ -18,7 +18,6 @@ in
qt6ct qt6ct
swaynotificationcenter swaynotificationcenter
searchclip searchclip
ydotool
]; ];
grimmShared.sway = { grimmShared.sway = {
@ -30,10 +29,9 @@ in
style = ./bar/style.css; style = ./bar/style.css;
}; };
config = with pkgs; let config = with pkgs; let
inherit (lib) getExe; inherit (lib) getExe;
in in {
{
definitions = { definitions = {
mod = "Mod4"; mod = "Mod4";
left = "h"; left = "h";
@ -154,34 +152,23 @@ in
XF86MonBrightnessDown = "exec ${getExe brightnessctl} s 10-%"; XF86MonBrightnessDown = "exec ${getExe brightnessctl} s 10-%";
XF86Explorer = "exec $term --command ${getExe ranger}"; XF86Explorer = "exec $term --command ${getExe ranger}";
XF86Search = "exec ${getExe searchclip}"; XF86Search = "exec ${getExe searchclip}";
XF86HomePage = XF86HomePage = let open = pkgs.writeShellScriptBin "open_or_switch_browser" ''
let browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
open = pkgs.writeShellScriptBin "open_or_switch_browser" '' swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//") ''; in "exec ${getExe open}";
swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch XF86Tools = let open = pkgs.writeShellScriptBin "open_or_switch_spotify" ''
''; # FIXME: spotify is being weird
in while IFS= read -r pid; do
"exec ${getExe open}"; swaymsg [pid=$pid] focus && exit 0
XF86Tools = done <<< $(pgrep spotify -u "$(whoami)")
let deskwhich spotify | xargs gio launch
open = pkgs.writeShellScriptBin "open_or_switch_spotify" '' ''; in "exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
# FIXME: spotify is being weird XF86Mail = let open = pkgs.writeShellScriptBin "open_or_switch_mail" ''
while IFS= read -r pid; do desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//")
swaymsg [pid=$pid] focus && exit 0 swaymsg [app_id="$desk"] focus || deskwhich $desk | xargs gio launch
done <<< $(pgrep spotify -u "$(whoami)") '';
deskwhich spotify | xargs gio launch in "exec ${getExe open}";
'';
in
"exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
XF86Mail =
let
open = pkgs.writeShellScriptBin "open_or_switch_mail" ''
desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//")
swaymsg [app_id="$desk"] focus || deskwhich $desk | xargs gio launch
'';
in
"exec ${getExe open}";
# XF86Bluetooth = "exec blueman-manager";
}; };
autolaunch = with pkgs; [ autolaunch = with pkgs; [
# fixme: absolute paths # fixme: absolute paths