Compare commits
5 commits
37cb01915d
...
7665a9a4cc
Author | SHA1 | Date | |
---|---|---|---|
7665a9a4cc | |||
cfe0a8b886 | |||
bdb72136a6 | |||
f2e4cb2a3c | |||
9a764b27d5 |
12 changed files with 163 additions and 21 deletions
|
@ -11,7 +11,7 @@ with lib; let
|
|||
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
|
||||
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
||||
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
|
||||
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
|
||||
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
|
||||
inhibit = "~/.local/bin/inhibit";
|
||||
|
@ -153,6 +153,8 @@ in {
|
|||
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen
|
||||
(key "Right" "Super" "movewindow" "r")
|
||||
(key "Right" "Super+Shift" "movewindoworgroup" "r")
|
||||
(key "Semicolon" "Super" "exec" "${hyprpicker} --autocopy")
|
||||
(key "Semicolon" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
|
||||
(key "Slash" "Super" "exec" vrr)
|
||||
(key "Space" "Ctrl" "exec" (concatStringsSep " " [
|
||||
"${toggle}"
|
||||
|
@ -225,8 +227,9 @@ in {
|
|||
(key "O" "Super" "togglespecialworkspace" "office")
|
||||
(key "O" "Super+Ctrl" "exec" "${onlyoffice}")
|
||||
(key "O" "Super+Shift" "movetoworkspacesilent" "special:office")
|
||||
(key "P" "Super" "exec" "${hyprpicker} --autocopy")
|
||||
(key "P" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
|
||||
(key "P" "Ctrl+Alt" "exec" "${pkill} 1password")
|
||||
(key "P" "Super" "togglespecialworkspace" "password")
|
||||
(key "P" "Super+Shift" "movetoworkspacesilent" "special:password")
|
||||
(key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)")
|
||||
(key "Q" "Ctrl+Alt+Shift" "exec" "close") # Quit all windows
|
||||
(key "Q" "Super" "killactive" null)
|
||||
|
@ -236,8 +239,8 @@ in {
|
|||
(key "S" "Super+Shift" "exec" steam)
|
||||
(key "T" "Ctrl+Alt" "exec" "${pkill} kitty")
|
||||
(key "T" "Super" "togglespecialworkspace" "terminal")
|
||||
(key "T" "Super+Ctrl" "exec" kitty)
|
||||
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
|
||||
(key "T" "Super+Shift" "exec" kitty)
|
||||
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
||||
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
||||
(key "W" "Super" "togglespecialworkspace" "vm")
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
|
||||
cfg = config.custom.desktops.hyprland.plugins;
|
||||
in {
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
_1password = "${config.programs._1password-gui.package}/bin/1password";
|
||||
gamescope = "${config.programs.gamescope.package}/bin/gamescope";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
|
||||
launch = "~/.local/bin/launch";
|
||||
loupe = "${pkgs.loupe}/bin/loupe";
|
||||
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors";
|
||||
pgrep = "${pkgs.procps}/bin/pgrep";
|
||||
|
@ -29,6 +32,7 @@ in {
|
|||
"special:android, on-created-empty:${waydroid} app launch com.YoStarEN.Arknights"
|
||||
"special:music, on-created-empty:${youtube-music}"
|
||||
"special:office, on-created-empty:[tile] ${onlyoffice}"
|
||||
"special:password, on-created-empty:${launch} --tile ${_1password}"
|
||||
"special:steam, on-created-empty:${steam}"
|
||||
"special:terminal, on-created-empty:${kitty}"
|
||||
"special:vm, on-created-empty:${pgrep} -x vm || ${virt-manager}"
|
||||
|
@ -168,6 +172,10 @@ in {
|
|||
(class "libreoffice.+" rules)
|
||||
(class "ONLYOFFICE Desktop Editors" rules)
|
||||
];
|
||||
password = rules: [
|
||||
(class "1Password" rules)
|
||||
(class "Bitwarden" rules)
|
||||
];
|
||||
pip = rules: [
|
||||
(title "Picture.in.[Pp]icture" rules)
|
||||
];
|
||||
|
@ -211,6 +219,7 @@ in {
|
|||
(tag.game ["fullscreen" "group barred" "idleinhibit always" "noborder" "noshadow" "renderunfocused" "workspace name:game"])
|
||||
(tag.music ["tile" "workspace special:music"])
|
||||
(tag.office ["workspace special:office"])
|
||||
(tag.password ["center" "workspace special:password"])
|
||||
(tag.pip ["keepaspectratio" "move ${pip.x} ${pip.y}" "pin" "size ${pip.w} ${pip.h}"])
|
||||
(tag.social ["group" "tile"])
|
||||
(tag.steam ["workspace special:steam"])
|
||||
|
@ -223,10 +232,6 @@ in {
|
|||
(class "Tap Wizard 2.x86_64" ["workspace 0"])
|
||||
|
||||
#!! Expressions are not wrapped in ^$
|
||||
(fields {
|
||||
class = "^1Password$";
|
||||
title = "^1Password$";
|
||||
} ["center"])
|
||||
(fields {
|
||||
class = "^com\\.github\\.wwmm\\.easyeffects$";
|
||||
title = "^Easy Effects$"; # Main window
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
_1password = "${config.programs._1password-gui.package}/bin/1password";
|
||||
clipse = "${pkgs.clipse}/bin/clipse";
|
||||
firefox-esr = "${
|
||||
config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage
|
||||
|
@ -73,6 +74,7 @@ in {
|
|||
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
||||
"${clipse} --clear" # Clear clipboard history
|
||||
"${clipse} --listen" # Monitor clipboard
|
||||
"${_1password} --silent" # Launch password manager in background
|
||||
"[group new lock; tile] ${firefox-esr}"
|
||||
];
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.programs."1password";
|
||||
cfg = config.custom.programs._1password;
|
||||
in {
|
||||
options.custom.programs."1password".enable = mkOption {default = false;};
|
||||
options.custom.programs._1password.enable = mkOption {default = false;};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
|
|
|
@ -37,7 +37,7 @@ with lib; {
|
|||
})
|
||||
|
||||
(mkIf config.custom.full {
|
||||
"1password".enable = true;
|
||||
_1password.enable = true;
|
||||
adb.enable = true;
|
||||
ags.enable = true;
|
||||
#// anyrun.enable = true;
|
||||
|
|
|
@ -14,5 +14,23 @@ in {
|
|||
programs.ssh.extraConfig = ''
|
||||
StrictHostKeyChecking no
|
||||
'';
|
||||
|
||||
home-manager.users.${config.custom.username} = {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
Host *
|
||||
IdentityAgent ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
|
||||
# Work around FHS permissions
|
||||
# https://github.com/nix-community/home-manager/issues/322#issuecomment-1856128020
|
||||
home.file.".ssh/config" = {
|
||||
target = ".ssh/config_source";
|
||||
onChange = "cat ~/.ssh/config_source > ~/.ssh/config && chmod 400 ~/.ssh/config";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,9 +10,7 @@ with lib; let
|
|||
bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl";
|
||||
easyeffects = "${pkgs.easyeffects}/bin/easyeffects";
|
||||
echo = "${pkgs.coreutils}/bin/echo";
|
||||
hyprctl = "${
|
||||
config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage
|
||||
}/bin/hyprctl";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
|
||||
jq = "${pkgs.jq}/bin/jq";
|
||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||
|
@ -172,6 +170,7 @@ in {
|
|||
game = "";
|
||||
music = "";
|
||||
office = "";
|
||||
password = "";
|
||||
pip = "";
|
||||
scratchpad = "";
|
||||
steam = "";
|
||||
|
|
|
@ -91,6 +91,12 @@ in {
|
|||
libnotify
|
||||
systemd
|
||||
])
|
||||
(bash "launch" [
|
||||
argc
|
||||
coreutils
|
||||
hyprland
|
||||
jq
|
||||
])
|
||||
(bash "left" [
|
||||
argc
|
||||
hyprland
|
||||
|
|
113
options/custom/scripts/launch.sh
Normal file
113
options/custom/scripts/launch.sh
Normal file
|
@ -0,0 +1,113 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# @describe Wrapper for launching applications with window rules
|
||||
# Relies on polling for the next open window, not the process id
|
||||
# Race conditions are possible with active usage during application start
|
||||
#
|
||||
# https://github.com/sigoden/argc
|
||||
|
||||
# @meta combine-shorts
|
||||
# @option -M --move Move next window to absolute position (X[%] Y[%]) (requires floating)
|
||||
# @option -R --resize Resize next window to absolute dimensions (W[%] H[%]) (requires floating)
|
||||
# @option -W --workspace Move next window to workspace
|
||||
# @flag -a --active Focus and raise next window (raise requires floating)
|
||||
# @flag -c --center Center next window (requires floating)
|
||||
# @flag -f --float Float next window
|
||||
# @flag -g --group Add next window to the active group
|
||||
# @flag -l --lock Lock next window's group
|
||||
# @flag -m --maximize Maximize next window
|
||||
# @flag -n --new Add next window to a new group
|
||||
# @flag -p --pin Pin next window (requires floating)
|
||||
# @flag -s --fullscreen Fullscreen next window
|
||||
# @flag -t --tile Tile next window
|
||||
# @arg commands+ Commands to execute in an exec dispatcher
|
||||
|
||||
eval "$(argc --argc-eval "$0" "$@")"
|
||||
|
||||
# Get initial count of open windows
|
||||
count="$(hyprctl -j clients | jq length)"
|
||||
|
||||
# Launch application
|
||||
hyprctl dispatch exec "${argc_commands[@]:-}"
|
||||
|
||||
# Poll for next window
|
||||
c=0
|
||||
|
||||
while (("$(hyprctl -j clients | jq length)" <= "$count")); do
|
||||
# Increment timeout counter
|
||||
((c += 1))
|
||||
|
||||
# Time out after 60 seconds
|
||||
if (("$c" >= 60 * 10)); then
|
||||
notify-send "> launch" "Polling timed out" --urgency critical
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# Get address of last window
|
||||
window="address:$(hyprctl -j clients | jq -r ".[-1].address")"
|
||||
|
||||
# Set batch rules on window
|
||||
batch=
|
||||
|
||||
### Floating rules
|
||||
if [[ "${argc_float:-}" ]]; then
|
||||
batch+="dispatch setfloating $window;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_center:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch centerwindow;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_move:-}" ]]; then
|
||||
batch+="dispatch movewindowpixel exact ${argc_move:-},$window;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_pin:-}" ]]; then
|
||||
batch+="dispatch pin $window;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_resize:-}" ]]; then
|
||||
batch+="dispatch resizewindowpixel exact ${argc_resize:-},$window;"
|
||||
fi
|
||||
|
||||
### Group rules
|
||||
if [[ "${argc_new:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch togglegroup;" # Requires no initial group
|
||||
fi
|
||||
|
||||
if [[ "${argc_lock:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch lockactivegroup lock;"
|
||||
fi
|
||||
|
||||
### Global rules
|
||||
if [[ "${argc_active:-}" ]]; then
|
||||
batch+="dispatch alterzorder top,$window; dispatch focuswindow $window;" # Handles floating
|
||||
fi
|
||||
|
||||
if [[ "${argc_fullscreen:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch fullscreen 0;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_group:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch moveintogroup up;" # Assumes up direction
|
||||
fi
|
||||
|
||||
if [[ "${argc_maximize:-}" ]]; then
|
||||
batch+="dispatch focuswindow $window; dispatch fullscreen 1;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_tile:-}" ]]; then
|
||||
batch+="dispatch settiled $window;"
|
||||
fi
|
||||
|
||||
if [[ "${argc_workspace:-}" ]]; then
|
||||
batch+="dispatch movetoworkspacesilent ${argc_workspace:-},$window;"
|
||||
fi
|
||||
|
||||
# Dispatch batch commands
|
||||
if [[ "${batch:-}" ]]; then
|
||||
hyprctl --batch "$batch"
|
||||
fi
|
|
@ -6,9 +6,7 @@
|
|||
}:
|
||||
with lib; let
|
||||
grep = "${pkgs.gnugrep}/bin/grep";
|
||||
hyprctl = "${
|
||||
config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage
|
||||
}/bin/hyprctl";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
hyprlock = "${
|
||||
config.home-manager.users.${config.custom.username}.programs.hyprlock.package
|
||||
}/bin/hyprlock";
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
}:
|
||||
with lib; let
|
||||
chayang = "${pkgs.chayang}/bin/chayang";
|
||||
hyprctl = "${
|
||||
config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.package
|
||||
}/bin/hyprctl";
|
||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||
pgrep = "${pkgs.procps}/bin/pgrep";
|
||||
swaylock = "${
|
||||
|
|
Loading…
Add table
Reference in a new issue