Add hyprland dispatcher (doesn't do anything yet)
This commit is contained in:
parent
f7b7bef245
commit
3acfc2e9d9
@ -2,6 +2,8 @@
|
|||||||
let
|
let
|
||||||
cfg = config.nixfiles.sessions.hyprland;
|
cfg = config.nixfiles.sessions.hyprland;
|
||||||
mkd = lib.mkDefault;
|
mkd = lib.mkDefault;
|
||||||
|
hyprland-pkg = config.wayland.windowManager.hyprland.finalPackage;
|
||||||
|
|
||||||
terminal = "${pkgs.kitty}/bin/kitty";
|
terminal = "${pkgs.kitty}/bin/kitty";
|
||||||
files = "${pkgs.dolphin}/bin/dolphin";
|
files = "${pkgs.dolphin}/bin/dolphin";
|
||||||
rofi = "${pkgs.rofi-wayland}/bin/rofi";
|
rofi = "${pkgs.rofi-wayland}/bin/rofi";
|
||||||
@ -10,6 +12,8 @@ let
|
|||||||
polkit-agent = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
|
polkit-agent = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
|
||||||
grimblast = "${inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast}/bin/grimblast";
|
grimblast = "${inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast}/bin/grimblast";
|
||||||
|
|
||||||
|
hypr-dispatcher = "${pkgs.callPackage ./dispatcher { hyprland = hyprland-pkg; }}/bin/hypr-dispatcher";
|
||||||
|
|
||||||
# https://github.com/flatpak/xdg-desktop-portal-gtk/issues/440#issuecomment-1900520919
|
# https://github.com/flatpak/xdg-desktop-portal-gtk/issues/440#issuecomment-1900520919
|
||||||
xdpg-workaround = pkgs.writeShellScript "xdg-desktop-portal-gtk-workaround"
|
xdpg-workaround = pkgs.writeShellScript "xdg-desktop-portal-gtk-workaround"
|
||||||
''
|
''
|
||||||
@ -56,6 +60,7 @@ in
|
|||||||
wev
|
wev
|
||||||
dunst
|
dunst
|
||||||
pkgs.brightnessctl
|
pkgs.brightnessctl
|
||||||
|
hypr-dispatcher
|
||||||
];
|
];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
|
19
home/sessions/hyprland/dispatcher/default.nix
Normal file
19
home/sessions/hyprland/dispatcher/default.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
socat,
|
||||||
|
coreutils,
|
||||||
|
hyprland,
|
||||||
|
makeShellWrapper }:
|
||||||
|
let
|
||||||
|
wrappedPath = lib.makeBinPath [ coreutils socat hyprland ];
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
name = "hyprland-dispatcher";
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
nativeBuildInputs = [ makeShellWrapper ];
|
||||||
|
src = ./.;
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm555 $src/dispatcher.sh $out/bin/hypr-dispatcher
|
||||||
|
wrapProgramShell $out/bin/hypr-dispatcher --prefix PATH : "${wrappedPath}"
|
||||||
|
'';
|
||||||
|
}
|
23
home/sessions/hyprland/dispatcher/dispatcher.sh
Executable file
23
home/sessions/hyprland/dispatcher/dispatcher.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
state_gd_rebind=0
|
||||||
|
|
||||||
|
log() {
|
||||||
|
echo "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_active_window() {
|
||||||
|
case "$1" in
|
||||||
|
# geometry dash
|
||||||
|
*'>>'steam_app_322170,*) log matched Geometry Dash ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle() {
|
||||||
|
case "$1" in
|
||||||
|
activewindow*) handle_active_window "$1" ;;
|
||||||
|
esac
|
||||||
|
};
|
||||||
|
|
||||||
|
socat - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | \
|
||||||
|
while read -r line ; do handle "$line"; done
|
Loading…
x
Reference in New Issue
Block a user