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 "P" "Ctrl+Alt" (spawn [pkill "1password"]))
|
||||
(key "P" "Mod" (spawn _1password))
|
||||
(key "P" "Mod+Shift" (spawn [_1password "--quick-access"]))
|
||||
(key "Q" "Mod" close-window)
|
||||
(key "R" "Mod" focus-window-or-workspace-down)
|
||||
(key "R" "Mod+Shift" move-window-down-or-to-workspace-down)
|
||||
|
|
|
@ -35,8 +35,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
# Enable rootless Xwayland
|
||||
services.xwayland-satellite.enable = cfg.xwayland;
|
||||
services = {
|
||||
# Enable rootless Xwayland
|
||||
xwayland-satellite.enable = cfg.xwayland;
|
||||
|
||||
# Enable X11/Wayland clipboard sync
|
||||
clipsync.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# https://github.com/YaLTeR/niri
|
||||
|
|
|
@ -53,7 +53,6 @@ in {
|
|||
home = hm.home.homeDirectory;
|
||||
in
|
||||
[
|
||||
{command = [_1password "--silent"];} # Launch password manager in background
|
||||
{command = [audio "--init"];} # Enforce audio profile state
|
||||
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
|
||||
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
||||
|
|
|
@ -203,6 +203,21 @@ in {
|
|||
}
|
||||
|
||||
### 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
|
||||
cfg = config.custom.programs._1password;
|
||||
|
||||
_1password = getExe config.programs._1password-gui.package;
|
||||
in {
|
||||
options.custom.programs._1password = {
|
||||
enable = mkOption {default = false;};
|
||||
agent = mkOption {default = true;};
|
||||
browser = mkOption {default = null;};
|
||||
service = mkOption {default = true;};
|
||||
};
|
||||
|
||||
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} = {
|
||||
programs.ssh.extraConfig = mkIf cfg.agent ''
|
||||
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,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
|
@ -24,7 +25,7 @@ in {
|
|||
control.esc = "toggle(qwerty)"; # Control+Esc toggles qwerty
|
||||
shift.shift = "capslock"; # Both Shifts toggle Capslock
|
||||
|
||||
meta = {
|
||||
"meta+control+shift" = {
|
||||
# Mouse repeat macro
|
||||
"," = "macro2(300, 100, leftmouse)";
|
||||
"." = "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
|
||||
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-width = 750;
|
||||
fit-to-screen = false;
|
||||
|
|
|
@ -38,8 +38,10 @@ in {
|
|||
testdisk # Data recovery tool
|
||||
trashy # CLI trash
|
||||
waypipe # Wayland proxy
|
||||
wev # Wayland keysym tester
|
||||
wl-clipboard # Wayland clipboard
|
||||
xclip # X11 clipboard
|
||||
xorg.xev # X11 keysym tester
|
||||
|
||||
### Dependencies
|
||||
man-pages
|
||||
|
|
Loading…
Add table
Reference in a new issue