File tree Expand file tree Collapse file tree 5 files changed +26
-9
lines changed
Expand file tree Collapse file tree 5 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 11# hypr-binds
22
3+ [ ![ ci-badge] ( https://img.shields.io/static/v1?label=Built%20with&message=nix&color=blue&style=flat&logo=nixos&link=https://nixos.org&labelColor=111212 )] ( https://gvolpe.com )
4+ [ ![ built with garnix] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fgvolpe%2Fnix-config%3Fbranch%3Dmaster )] ( https://garnix.io )
5+
36Keybinds helper for Hyprland.
47
58![ binds] ( ./imgs/hypr-binds.png )
Original file line number Diff line number Diff line change 1111 ( system :
1212 let
1313 pkgs = nixpkgs . legacyPackages . ${ system } ;
14- hypr-binds = ( pkgs . callPackage ./nix/binds.nix { } ) { } ;
14+ buildPkg = pkgs . callPackage ./nix/binds.nix { } ;
15+
16+ hypr-binds-wofi = buildPkg { } ;
17+ hypr-binds-rofi = buildPkg { launcher = "rofi" ; } ;
1518 in
1619 {
1720 homeManagerModules . default = {
1821 imports = [ ./nix/hm.nix ] ;
1922 } ;
2023
2124 packages = {
22- default = hypr-binds ;
23- inherit hypr-binds ;
25+ default = hypr-binds-wofi ;
26+ inherit hypr-binds-wofi hypr-binds-rofi ;
2427 } ;
2528 }
2629 ) ;
Original file line number Diff line number Diff line change 1+ builds :
2+ exclude : []
3+ include :
4+ - ' *.x86_64-linux.*'
5+ - ' *.aarch64-linux.*'
Original file line number Diff line number Diff line change 1- { lib , jq , wofi , writeShellScriptBin } :
1+ { lib , jq , pkgs , writeShellScriptBin } :
22
3- { launcher ? "${ lib . getExe wofi } --dmenu -m -i -p 'Hypr binds' "
3+ { launcher ? "wofi"
44, cmdcolor ? "cyan"
55, modkeyStyle ? "<b>$MOD$KEY</b> <i>$DESCRIPTION</i>"
66, dispatch ? true
2121 "59" = "Comma" ;
2222 "60" = "Dot" ;
2323 } ;
24+
25+ launcherCommand =
26+ if launcher == "rofi"
27+ then "${ lib . getExe pkgs . rofi } -dmenu -markup-rows -i -p 'Hypr binds'"
28+ else "${ lib . getExe pkgs . wofi } --dmenu -m -i -p 'Hypr binds'" ;
29+
2430 style =
2531 let
2632 modkey = builtins . replaceStrings
@@ -38,7 +44,7 @@ writeShellScriptBin "hypr-binds" ''
3844 map(.code |= ${ builtins . toJSON keycodes } [.]) |
3945 sort_by(.mod) | .[] |
4046 select(.sub == "") |
41- "${ style } " ' | ${ launcher } |
47+ "${ style } " ' | ${ launcherCommand } |
4248 # extract the command (dispatcher + arg)
4349 sed -n 's/.*<span color=\"${ cmdcolor } \">\(.*\)<\/span>.*/\1/p' |
4450 ${ if dispatch then ''
Original file line number Diff line number Diff line change 1414 settings = {
1515 launcher = {
1616 app = mkOption {
17- type = types . str ;
18- description = "The launcher application (defaults to wofi, but others like rofi can be used) " ;
19- default = "${ lib . getExe pkgs . wofi } --dmenu -m -i -p 'Hypr binds' " ;
17+ type = types . enum [ "rofi" "wofi" ] ;
18+ description = "The launcher application" ;
19+ default = "wofi" ;
2020 } ;
2121
2222 style = {
You can’t perform that action at this time.
0 commit comments