Skip to content

Commit

Permalink
hyprland/uwsm: part 2
Browse files Browse the repository at this point in the history
Switch from run-as-service (homebrew systemd-run wrapper) to `uwsm app`.

This also involved writing a new plugin for anyrun to correctly handle
applications by running them with `uwsm app`. It passes the path to the
desktop ID entry, as this also gives `uwsm app` context about Comment,
which is then used to populate the Description of the generated systemd
unit.
  • Loading branch information
fufexan committed Nov 10, 2024
1 parent 3384ccf commit b946c18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 51 deletions.
23 changes: 11 additions & 12 deletions home/programs/wayland/hyprland/binds.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{lib, ...}: let
let
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
workspaces = builtins.concatLists (builtins.genList (
x: let
Expand All @@ -13,12 +13,11 @@
)
10);

toggle = program: service: let
toggle = program: let
prog = builtins.substring 0 14 program;
runserv = lib.optionalString service "run-as-service";
in "pkill ${prog} || ${runserv} ${program}";
in "pkill ${prog} || uwsm app -- ${program}";

runOnce = program: "pgrep ${program} || ${program}";
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
in {
wayland.windowManager.hyprland.settings = {
# mouse movements
Expand All @@ -45,20 +44,20 @@ in {

# utility
# terminal
"$mod, Return, exec, run-as-service foot"
"$mod, Return, exec, uwsm app -- foot"
# logout menu
"$mod, Escape, exec, ${toggle "wlogout" true} -p layer-shell"
"$mod, Escape, exec, ${toggle "wlogout"} -p layer-shell"
# lock screen
"$mod, L, exec, pgrep hyprlock || hyprlock"
"$mod, L, exec, ${runOnce "hyprlock"}"
# lock screen, to be used with the special key Fn+F10 on my keyboard
"$mod, I, exec, pgrep hyprlock || hyprlock"
"$mod, I, exec, ${runOnce "hyprlock"}"
# select area to perform OCR on
"$mod, O, exec, ${runOnce "wl-ocr"}"
", XF86Favorites, exec, ${runOnce "wl-ocr"}"
# open calculator
", XF86Calculator, exec, ${toggle "gnome-calculator" true}"
", XF86Calculator, exec, ${toggle "gnome-calculator"}"
# open settings
"$mod, U, exec, XDG_CURRENT_DESKTOP=gnome gnome-control-center"
"$mod, U, exec, XDG_CURRENT_DESKTOP=gnome ${runOnce "gnome-control-center"}"

# move focus
"$mod, left, movefocus, l"
Expand Down Expand Up @@ -99,7 +98,7 @@ in {

bindr = [
# launcher
"$mod, SUPER_L, exec, ${toggle "anyrun" true}"
"$mod, SUPER_L, exec, ${toggle "anyrun"}"
];

bindl = [
Expand Down
1 change: 0 additions & 1 deletion home/terminal/programs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
./git.nix
./nix.nix
./skim.nix
./transient-services.nix
./yazi
./xdg.nix
];
Expand Down
38 changes: 0 additions & 38 deletions home/terminal/programs/transient-services.nix

This file was deleted.

0 comments on commit b946c18

Please sign in to comment.