autorandr: Split out
This commit is contained in:
parent
e9a8d16ece
commit
26e70acb2f
4 changed files with 38 additions and 30 deletions
|
|
@ -232,7 +232,7 @@ in
|
|||
return_bindings = false;
|
||||
};
|
||||
"${mode_pres_sec}" = {
|
||||
mod_enter = "Shift+p+2";
|
||||
mod_enter = "Shift+p+2"; # Bogus, just so I don't have to implement no binding
|
||||
bindings = {
|
||||
"b" = "workspace 1, workspace 2, mode ${mode_pres_main}";
|
||||
"q" = "mode default";
|
||||
|
|
@ -240,28 +240,6 @@ in
|
|||
};
|
||||
return_bindings = false;
|
||||
};
|
||||
"Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default" =
|
||||
let
|
||||
builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ];
|
||||
autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu"
|
||||
''
|
||||
shopt -s nullglob globstar
|
||||
profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')"
|
||||
profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")"
|
||||
[[ -n "$profile" ]] || exit
|
||||
${pkgs.autorandr}/bin/autorandr ${option} "$profile"
|
||||
'';
|
||||
in
|
||||
{
|
||||
bindings = {
|
||||
"a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default";
|
||||
"l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default";
|
||||
"s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default";
|
||||
"r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default";
|
||||
"d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default";
|
||||
};
|
||||
mod_enter = "t";
|
||||
};
|
||||
"Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue" = {
|
||||
bindings = {
|
||||
"r" = "exec ${pkgs.sct}/bin/sct 1000";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue