mirror of
https://github.com/EdenQwQ/nixos.git
synced 2026-01-27 18:27:12 +08:00
add zjuconnect passwd; add swhkd mode
This commit is contained in:
parent
3da9555cfd
commit
e3057eeb07
6 changed files with 79 additions and 43 deletions
|
|
@ -19,17 +19,42 @@ let
|
|||
swallow ? true,
|
||||
oneoff ? false,
|
||||
keyBindings,
|
||||
enterKeys ? [ ],
|
||||
escapeKeys ? [ ],
|
||||
}:
|
||||
let
|
||||
swallowStr = if swallow then "swallow" else "";
|
||||
oneoffStr = if oneoff then "oneoff" else "";
|
||||
in
|
||||
''
|
||||
(
|
||||
map (
|
||||
key:
|
||||
mkKeyBinding {
|
||||
inherit key;
|
||||
command = "notify-send 'entering mode ${name}' && @enter ${name}";
|
||||
}
|
||||
) enterKeys
|
||||
|> builtins.concatStringsSep "\n"
|
||||
)
|
||||
+ "\n"
|
||||
+ ''
|
||||
mode ${name} ${swallowStr} ${oneoffStr}
|
||||
''
|
||||
+ (map mkKeyBinding keyBindings |> builtins.concatStringsSep "\n")
|
||||
+ "\n"
|
||||
+ (
|
||||
map (
|
||||
key:
|
||||
mkKeyBinding {
|
||||
inherit key;
|
||||
command = "notify-send 'exiting mode ${name}' && @escape";
|
||||
}
|
||||
) escapeKeys
|
||||
|> builtins.concatStringsSep "\n"
|
||||
)
|
||||
+ "\n"
|
||||
+ ''
|
||||
\nendmode
|
||||
endmode
|
||||
'';
|
||||
mkSwhkdrc =
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,48 +1,47 @@
|
|||
{ user, config, ... }:
|
||||
let
|
||||
niriAction = key: action: {
|
||||
inherit key;
|
||||
command = "niri msg action ${action}";
|
||||
};
|
||||
in
|
||||
{
|
||||
xdg.configFile."niri/swhkd/niri.swhkdrc".text = config.lib.swhkd.mkSwhkdrc {
|
||||
includes = [
|
||||
"/home/${user}/.config/swhkd/basic.swhkdrc"
|
||||
"/home/${user}/.config/swhkd/tofi.swhkdrc"
|
||||
];
|
||||
keyBindings =
|
||||
let
|
||||
niriAction = key: action: {
|
||||
inherit key;
|
||||
command = "niri msg action ${action}";
|
||||
};
|
||||
in
|
||||
[
|
||||
{
|
||||
key = "super + shift + w";
|
||||
command = "/home/${user}/scripts/change-wal-niri";
|
||||
}
|
||||
(niriAction "super + q" "close-window")
|
||||
(niriAction "super + e" "expand-column-to-available-width")
|
||||
(niriAction "super + t" "toggle-column-tabbed-display")
|
||||
(niriAction "super + {left, down, up, right}" "focus-column-{left, down, up, right}")
|
||||
(niriAction "super + {h, l}" "focus-column-or-monitor-{left, right}")
|
||||
(niriAction "super + {j, k}" "focus-window-or-workspace-{down, up}")
|
||||
(niriAction "super + shift + h" "move-column-left-or-to-monitor-left")
|
||||
(niriAction "super + shift + l" "move-column-right-or-to-monitor-right")
|
||||
(niriAction "super + shift + j" "move-window-down-or-to-workspace-down")
|
||||
(niriAction "super + shift + k" "move-window-up-or-to-workspace-up")
|
||||
(niriAction "super + ctrl + {left, down, up, right}" "focus-monitor-{left, down, up, right}")
|
||||
(niriAction "super + ctrl + {h, j, k, l}" "focus-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + ctrl + {left, down, up, right}" "move-window-to-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + ctrl + {h, j, k, l}" "move-window-to-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + space" "toggle-window-floating")
|
||||
(niriAction "super + space" "switch-focus-between-floating-and-tiling")
|
||||
(niriAction "super + {_, shift +} {1-9}" "{focus\\-workspace, move\\-window\\-to\\-workspace} {1-9}")
|
||||
(niriAction "super + comma" "consume-window-into-column")
|
||||
(niriAction "super + period" "expel-window-from-column")
|
||||
(niriAction "super + r" "switch-preset-column-width")
|
||||
(niriAction "super + f" "maximize-column")
|
||||
(niriAction "super + shift + f" "fullscreen-window")
|
||||
(niriAction "super + c" "center-column")
|
||||
(niriAction "super + {_, shift +} {minus, equal}" "set-{column\\-width, window\\-height} \"{\\-, +}10%\"")
|
||||
(niriAction "{ctrl +, alt +} print" "screenshot-{screen, window}")
|
||||
(niriAction "print" "screenshot")
|
||||
];
|
||||
keyBindings = [
|
||||
{
|
||||
key = "super + shift + w";
|
||||
command = "/home/${user}/scripts/change-wal-niri";
|
||||
}
|
||||
(niriAction "super + q" "close-window")
|
||||
(niriAction "super + e" "expand-column-to-available-width")
|
||||
(niriAction "super + t" "toggle-column-tabbed-display")
|
||||
(niriAction "super + {left, down, up, right}" "focus-column-{left, down, up, right}")
|
||||
(niriAction "super + {h, l}" "focus-column-or-monitor-{left, right}")
|
||||
(niriAction "super + {j, k}" "focus-window-or-workspace-{down, up}")
|
||||
(niriAction "super + shift + h" "move-column-left-or-to-monitor-left")
|
||||
(niriAction "super + shift + l" "move-column-right-or-to-monitor-right")
|
||||
(niriAction "super + shift + j" "move-window-down-or-to-workspace-down")
|
||||
(niriAction "super + shift + k" "move-window-up-or-to-workspace-up")
|
||||
(niriAction "super + ctrl + {left, down, up, right}" "focus-monitor-{left, down, up, right}")
|
||||
(niriAction "super + ctrl + {h, j, k, l}" "focus-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + ctrl + {left, down, up, right}" "move-window-to-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + ctrl + {h, j, k, l}" "move-window-to-monitor-{left, down, up, right}")
|
||||
(niriAction "super + shift + space" "toggle-window-floating")
|
||||
(niriAction "super + space" "switch-focus-between-floating-and-tiling")
|
||||
(niriAction "super + {_, shift +} {1-9}" "{focus\\-workspace, move\\-window\\-to\\-workspace} {1-9}")
|
||||
(niriAction "super + comma" "consume-window-into-column")
|
||||
(niriAction "super + period" "expel-window-from-column")
|
||||
(niriAction "super + r" "switch-preset-column-width")
|
||||
(niriAction "super + f" "maximize-column")
|
||||
(niriAction "super + shift + f" "fullscreen-window")
|
||||
(niriAction "super + c" "center-column")
|
||||
(niriAction "super + {_, shift +} {minus, equal}" "set-{column\\-width, window\\-height} \"{\\-, +}10%\"")
|
||||
(niriAction "{ctrl +, alt +} print" "screenshot-{screen, window}")
|
||||
(niriAction "print" "screenshot")
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
zju-connect = pkgs.callPackage ../../../pkgs/zju-connect.nix { };
|
||||
zjuconnect = pkgs.writeShellScriptBin "zjuconnect" ''exec ${zju-connect}/bin/zju-connect --config ~/.config/zju-connect/config.toml'';
|
||||
zjuconnect = pkgs.writeShellScriptBin "zjuconnect" ''exec ${zju-connect}/bin/zju-connect --username 3220101015 --password $(cat ${config.age.secrets.zjuconnect_password.path})'';
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
|
|
|
|||
|
|
@ -5,5 +5,6 @@
|
|||
deepseek_token.file = ./deepseek_token.age;
|
||||
zjuchat_token.file = ./zjuchat_token.age;
|
||||
tavily_token.file = ./tavily_token.age;
|
||||
zjuconnect_password.file = ./zjuconnect_password.age;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,4 +23,8 @@ in
|
|||
eden
|
||||
eden-inspiron
|
||||
];
|
||||
"zjuconnect_password.age".publicKeys = [
|
||||
eden
|
||||
eden-inspiron
|
||||
];
|
||||
}
|
||||
|
|
|
|||
7
secrets/zjuconnect_password.age
Normal file
7
secrets/zjuconnect_password.age
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 MpnI9A 5MHjqlCeFX/9z5kPj0TJ8XzPbw5M0nbup0rF0XWj0xw
|
||||
hrfRmBDynxDIpHKXjk/WbX2rUhg3fyyBQyHjh0Ai1zc
|
||||
-> ssh-ed25519 6VlDkQ WwWIa8SJTGTCKmyBitGSYj7ge3jjtqOA4zdGYY+mCgY
|
||||
hOxarqMMfd+E/AvzSmCJrWQHuM7Gpyc7q99QyXm6kgg
|
||||
--- lbh+ISVSh1vtRzc+s9kFfBnw2v+lmjCkfggSmFynZzY
|
||||
€aÆÂ%ç/<2F><>ÁX¦´0©.C¦]5ÒXqëÿ¶ba¬„;¸Gè¦ÂÔ:
|
||||
Loading…
Add table
Add a link
Reference in a new issue