From aefc1a93ad5ed65688bfe4afda5f132e8c496274 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Sat, 17 Jun 2023 13:01:49 -0400 Subject: [PATCH] Get vmware shortcut sorted --- home-manager/linux/programs/hyprland.nix | 25 ++++++++++++++++++++---- shortcuts/vmware/1440p | 4 ++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/home-manager/linux/programs/hyprland.nix b/home-manager/linux/programs/hyprland.nix index 3bae7fa..7616c9f 100644 --- a/home-manager/linux/programs/hyprland.nix +++ b/home-manager/linux/programs/hyprland.nix @@ -10,6 +10,7 @@ in with lib; { fuzzel -f "Iosevka Sans Quasi" -b "181818dd" -S "b9b9b9ff" -s "252525dd" -t "777777ff" -B 5 -r 5 -C "70b433dd"''; notif-package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaynotificationcenter; + shortcuts = inputs.self.packages.${pkgs.system}.shortcuts; in { home.packages = with pkgs; [ # General @@ -203,11 +204,14 @@ in with lib; { # Notif bind bind = $mainMod, T, exec, swaync-client -t -sw + # Shortcut dispatcher + bind = $mainMod, W, exec, ${shortcuts}/bin/shortcuts ~/.config/shortcuts/shortcuts.toml + ## Window rules - # Gamescope - windowrulev2 = float,class:^(.gamescope-wrapped)$ - windowrulev2 = noborder,class:^(.gamescope-wrapped)$ - windowrulev2 = rounding 0,class:^(.gamescope-wrapped)$ + # Gamescope - vmware + windowrulev2 = float,class:^(.gamescope-wrapped)$,title:VMware Workstation + windowrulev2 = noborder,class:^(.gamescope-wrapped)$,title:VMware Workstation + windowrulev2 = rounding 0,class:^(.gamescope-wrapped)$,title:VMware Workstation # Clipboard history management exec-once=wl-paste --watch cliphist store @@ -256,6 +260,19 @@ in with lib; { }; Install = { WantedBy = [ "graphical-session.target" ]; }; }; + # Shortcut dispatcher + xdg.configFile."shortcuts/shortcuts.toml" = { + text = '' + directories = ["~/.config/shortcuts/shortcuts", "${shortcuts}/shortcuts"] + picker_command = "${ + builtins.replaceStrings [ ''"'' ] [ ''\"'' ] fuzzel-command + } --dmenu" + ''; + onChange = '' + mkdir -p ~/.config/shortcuts/shortcuts + ''; + + }; ######################### ## SwayNotificationCenter (notifications) ######################### diff --git a/shortcuts/vmware/1440p b/shortcuts/vmware/1440p index e209db8..1d60167 100755 --- a/shortcuts/vmware/1440p +++ b/shortcuts/vmware/1440p @@ -1,5 +1,5 @@ #!/usr/bin/env bash -sleep 3 & -echo "Hello" +hyprctl dispatch exec -- "[float;size 1829 1029] gamescope -W 2560 -w 2560 -H 1440 -h 1440 --scaler integer --force-windows-fullscreen -- vmware" + wait