Compare commits
7 commits
342a3b0012
...
ef1f0b0513
Author | SHA1 | Date | |
---|---|---|---|
ef1f0b0513 | |||
c67fe3587f | |||
ae1ec3a572 | |||
cdbcb7bca2 | |||
c35f995fed | |||
36f5b8c15f | |||
138eed12d3 |
9 changed files with 96 additions and 5 deletions
|
@ -135,6 +135,7 @@ in {
|
||||||
(key "O" "Mod" (spawn [loupe "/tmp/wallpaper.png"]))
|
(key "O" "Mod" (spawn [loupe "/tmp/wallpaper.png"]))
|
||||||
(key "P" "Ctrl+Alt" (spawn [pkill "1password"]))
|
(key "P" "Ctrl+Alt" (spawn [pkill "1password"]))
|
||||||
(key "P" "Mod" (spawn _1password))
|
(key "P" "Mod" (spawn _1password))
|
||||||
|
(key "P" "Mod+Shift" (spawn [_1password "--quick-access"]))
|
||||||
(key "Q" "Mod" close-window)
|
(key "Q" "Mod" close-window)
|
||||||
(key "R" "Mod" focus-window-or-workspace-down)
|
(key "R" "Mod" focus-window-or-workspace-down)
|
||||||
(key "R" "Mod+Shift" move-window-down-or-to-workspace-down)
|
(key "R" "Mod+Shift" move-window-down-or-to-workspace-down)
|
||||||
|
|
|
@ -35,8 +35,13 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
# Enable rootless Xwayland
|
# Enable rootless Xwayland
|
||||||
services.xwayland-satellite.enable = cfg.xwayland;
|
xwayland-satellite.enable = cfg.xwayland;
|
||||||
|
|
||||||
|
# Enable X11/Wayland clipboard sync
|
||||||
|
clipsync.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/YaLTeR/niri
|
# https://github.com/YaLTeR/niri
|
||||||
|
|
|
@ -53,7 +53,6 @@ in {
|
||||||
home = hm.home.homeDirectory;
|
home = hm.home.homeDirectory;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
{command = [_1password "--silent"];} # Launch password manager in background
|
|
||||||
{command = [audio "--init"];} # Enforce audio profile state
|
{command = [audio "--init"];} # Enforce audio profile state
|
||||||
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
|
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
|
||||||
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
||||||
|
|
|
@ -203,6 +203,21 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
### Overrides
|
### Overrides
|
||||||
|
# TODO: Remove when switching 1Password to Wayland
|
||||||
|
(let
|
||||||
|
height = builtins.floor (config.custom.height / config.custom.scale * 0.4); # 40%
|
||||||
|
in {
|
||||||
|
matches = [
|
||||||
|
{
|
||||||
|
app-id = "^1Password";
|
||||||
|
title = "^Quick Access — 1Password$";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
max-height = height;
|
||||||
|
min-height = height;
|
||||||
|
open-floating = true;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,14 @@
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.custom.programs._1password;
|
cfg = config.custom.programs._1password;
|
||||||
|
|
||||||
|
_1password = getExe config.programs._1password-gui.package;
|
||||||
in {
|
in {
|
||||||
options.custom.programs._1password = {
|
options.custom.programs._1password = {
|
||||||
enable = mkOption {default = false;};
|
enable = mkOption {default = false;};
|
||||||
agent = mkOption {default = true;};
|
agent = mkOption {default = true;};
|
||||||
browser = mkOption {default = null;};
|
browser = mkOption {default = null;};
|
||||||
|
service = mkOption {default = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -38,6 +41,26 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services."1password" = mkIf cfg.service {
|
||||||
|
enable = true;
|
||||||
|
wantedBy = ["graphical-session.target"];
|
||||||
|
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Launch 1Password in the background";
|
||||||
|
|
||||||
|
After =
|
||||||
|
["graphical-session.target"]
|
||||||
|
++ optionals config.custom.services.xwayland-satellite.enable ["xwayland-satellite.service"];
|
||||||
|
};
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
|
||||||
|
# FIXME: 1password clipboard does not work in wayland
|
||||||
|
ExecStart = "${_1password} --silent --ozone-platform=x11";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.${config.custom.username} = {
|
home-manager.users.${config.custom.username} = {
|
||||||
programs.ssh.extraConfig = mkIf cfg.agent ''
|
programs.ssh.extraConfig = mkIf cfg.agent ''
|
||||||
Host *
|
Host *
|
||||||
|
|
43
options/custom/services/clipnotify.nix
Normal file
43
options/custom/services/clipnotify.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.services.clipsync;
|
||||||
|
|
||||||
|
clipnotify = getExe pkgs.clipnotify;
|
||||||
|
wl-copy = getExe' pkgs.wl-clipboard "wl-copy";
|
||||||
|
xclip = getExe pkgs.xclip;
|
||||||
|
in {
|
||||||
|
options.custom.services.clipsync = {
|
||||||
|
enable = mkOption {default = false;};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# https://github.com/cdown/clipnotify
|
||||||
|
systemd.user.services.clipsync = {
|
||||||
|
enable = true;
|
||||||
|
wantedBy = ["graphical-session.target"];
|
||||||
|
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Sync clipboard between Wayland and X11";
|
||||||
|
|
||||||
|
After =
|
||||||
|
["graphical-session.target"]
|
||||||
|
++ optionals config.custom.services.xwayland-satellite.enable ["xwayland-satellite.service"];
|
||||||
|
};
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
|
||||||
|
ExecStart = pkgs.writeShellScript "clipsync" ''
|
||||||
|
while ${clipnotify}; do
|
||||||
|
${xclip} -selection clipboard -out | ${wl-copy}
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
|
@ -24,7 +25,7 @@ in {
|
||||||
control.esc = "toggle(qwerty)"; # Control+Esc toggles qwerty
|
control.esc = "toggle(qwerty)"; # Control+Esc toggles qwerty
|
||||||
shift.shift = "capslock"; # Both Shifts toggle Capslock
|
shift.shift = "capslock"; # Both Shifts toggle Capslock
|
||||||
|
|
||||||
meta = {
|
"meta+control+shift" = {
|
||||||
# Mouse repeat macro
|
# Mouse repeat macro
|
||||||
"," = "macro2(300, 100, leftmouse)";
|
"," = "macro2(300, 100, leftmouse)";
|
||||||
"." = "macro2(300, 100, rightmouse)";
|
"." = "macro2(300, 100, rightmouse)";
|
||||||
|
@ -132,5 +133,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [pkgs.keyd];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ in {
|
||||||
|
|
||||||
# https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/configSchema.json
|
# https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/configSchema.json
|
||||||
settings = {
|
settings = {
|
||||||
control-center-height = builtins.floor (config.custom.height * 0.75); # 75%
|
control-center-height = builtins.floor (config.custom.height * 0.5); # 50%
|
||||||
control-center-positionY = "bottom";
|
control-center-positionY = "bottom";
|
||||||
control-center-width = 750;
|
control-center-width = 750;
|
||||||
fit-to-screen = false;
|
fit-to-screen = false;
|
||||||
|
|
|
@ -38,8 +38,10 @@ in {
|
||||||
testdisk # Data recovery tool
|
testdisk # Data recovery tool
|
||||||
trashy # CLI trash
|
trashy # CLI trash
|
||||||
waypipe # Wayland proxy
|
waypipe # Wayland proxy
|
||||||
|
wev # Wayland keysym tester
|
||||||
wl-clipboard # Wayland clipboard
|
wl-clipboard # Wayland clipboard
|
||||||
xclip # X11 clipboard
|
xclip # X11 clipboard
|
||||||
|
xorg.xev # X11 keysym tester
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
man-pages
|
man-pages
|
||||||
|
|
Loading…
Add table
Reference in a new issue