Compare commits

..

No commits in common. "aa8cc541404eb4ef0670f468860f57f4d32947be" and "c5074480ecc6c661897b8fdf1071115123b289be" have entirely different histories.

12 changed files with 150 additions and 417 deletions

View file

@ -1,6 +1,5 @@
_: {
imports = [
./shared.nix
./desktop.nix
];
}

View file

@ -1,18 +0,0 @@
{
osConfig,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
devType = osConfig.myOptions.device.roles.type;
acceptedTypes = [ "laptop" "desktop" ];
in {
config = mkIf (builtins.elem devType acceptedTypes) {
home.packages = with pkgs; [
trash-cli
bitwarden-cli
];
};
}

View file

@ -1,6 +1,5 @@
{
wayland.windowManager.hyprland = {
settings = {
wayland.windowManager.hyprland.settings = {
"$MOUSE_LMB" = "mouse:272";
"$MOUSE_RMB" = "mouse:273";
"$MOUSE_MMB" = "mouse:274";
@ -30,7 +29,6 @@
#
# TODO: Requires programs
"SUPER_SHIFT, L, exec, wlogout -p layer-shell"
"SUPER_CTRL, L, exec, loginctl lock-session"
#
# Screenshots
@ -40,17 +38,18 @@
#
# Brightness control
#
"SUPER, Right, exec, brightness 5%+"
"SUPER, Left, exec, brightness 5%-"
", XF86MonBrightnessUp, exec, brightness 5%+"
", XF86MonBrightnessDown, exec, brightness 5%-"
# TODO: requires script
#
# Audio/Volume control
#
"SUPER, Down, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
"SUPER, Up, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
# (rest in binde section)
#
# Notifications
@ -90,10 +89,7 @@
#
# Move floating windows
#
"SUPER_ALT, left, exec, hyprland-move-window 100 l"
"SUPER_ALT, right, exec, hyprland-move-window 100 r"
"SUPER_ALT, up, exec, hyprland-move-window 100 u"
"SUPER_ALT, down, exec, hyprland-move-window 100 d"
# TODO: requires script (move-window.sh)
#
# Override split direction for next window (manual tiling)
@ -157,101 +153,22 @@
"SUPER_SHIFT, mouse_up, focusmonitor, -1"
"SUPER_SHIFT, bracketright, focusmonitor, +1"
"SUPER_SHIFT, bracketleft, focusmonitor, -1"
];
# Mouse bindings
bindm = [
#
# Mouse window resizing
#
"SUPER, $MOUSE_LMB, movewindow"
"SUPER, $MOUSE_RMB, resizewindow"
];
# Repeat bindings
binde = [
#
# Audio/Volume control
#
"SUPER, Down, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
"SUPER, Up, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
# (rest in bind section)
#
# Window resizing
#
"ALT, right, resizeactive, 10 0"
"ALT, left, resizeactive, -10 0"
"ALT, up, resizeactive, 0 -10"
"ALT, down, resizeactive, 0 10 "
"ALT, H, resizeactive, -10 0"
"ALT, K, resizeactive, 0 -10"
"ALT, J, resizeactive, 0 10"
"ALT, L, resizeactive, 10 0"
];
};
# TODO: Submaps + binde
# Used for submaps, which don't support `settings`
extraConfig = ''
#
# Isolation group
#
# TODO: Submaps
];
# Useful to prevent keybind capturing (for games, etc)
# SUPER + Fn + F12 (Favorites)
bind = SUPER, XF86Favorites, exec, hyprctl dispatch submap isolate && notify-send "Keybind isolation" "Keybind isolation on"
submap = isolate
bind = SUPER, XF86Favorites, exec, hyprctl dispatch submap reset && notify-send "Keybind isolation" "Keybind isolation off"
submap = reset
#
# Precise keyboard window resizing
#
bind = SUPER, slash, submap, resize
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = SUPER, right, resizeactive, 30 0
binde = SUPER, left, resizeactive, -30 0
binde = SUPER, up, resizeactive, 0 -30
binde = SUPER, down, resizeactive, 0 30
binde = SHIFT, right, resizeactive, 1 0
binde = SHIFT, left, resizeactive, -1 0
binde = SHIFT, up, resizeactive, 0 -1
binde = SHIFT, down, resizeactive, 0 1
binde = , H, resizeactive, -10 0
binde = , K, resizeactive, 0 -10
binde = , J, resizeactive, 0 10
binde = , L, resizeactive, 10 0
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = SUPER, H, resizeactive, -30 0
binde = SUPER, K, resizeactive, 0 -30
binde = SUPER, J, resizeactive, 0 30
binde = SUPER, L, resizeactive, 30 0
binde = SHIFT, H, resizeactive, -1 0
binde = SHIFT, K, resizeactive, 0 -1
binde = SHIFT, J, resizeactive, 0 1
binde = SHIFT, L, resizeactive, 1 0
bind = , escape, submap, reset
bind = , return, submap, reset
bind = SUPER, slash, submap, reset
submap = reset
'';
bindm = [
# Mouse window resizing
"SUPER, $MOUSE_LMB, movewindow"
"SUPER, $MOUSE_RMB, resizewindow"
];
};
}

View file

@ -1,101 +1,7 @@
{
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
#
# Assigned workspaces
#
"workspace, 2, class:^(firefox)$"
"workspace 4, class:^(discord)$"
"workspace 4, class:^(vesktop)$"
"workspace 4, class:^(WebCord)$"
"workspace 5, class:^(Spotify)$"
"workspace 6, class:^(Stremio)$"
"workspace 6, class:^(com.stremio.stremio)$"
#
# Idle inhibition
#
"idleinhibit focus, class:^(Stremio)$"
"idleinhibit focus, class:^(com.stremio.stremio)$"
"idleinhibit focus, class:^(mpv)$"
"idleinhibit focus, class:^(firefox)$,title:^(.+ - YouTube Mozilla Firefox)$"
"idleinhibit focus, class:^(firefox)$,title:^(Picture-in-Picture)$"
#
# Correct size / Auto tile
#
"size 800 550, class:^(qalculate-gtk)$"
"tile, class:^(Spotify)$"
#
# Auto float
#
"float, class:^(Lxappearance)$"
"float, class:^(Rofi)$"
"float, class:^(feh)$"
"float, class:^(pavucontrol-qt)$"
"float, class:^(pavucontrol)$"
"float, class:^(file-roller)$"
"float, class:^(qalculate-gtk)$"
"float, class:^(com.github.wwmm.easyeffects)"
"float, class:^(opensnitch_ui)$"
"float, class:^(Brave-browser)$,title:^(_crx_.+)$"
"float, class:^(hyprland-share-picker)$"
"float,class:^(floating)$"
"center, class:^(hyprland-share-picker)$"
"animation slide, class:^(hyprland-share-picker)$"
# Float firefox windows (like bookmark menus, or some extension windows)
"float, class:^(firefox)$,title:^(Revert Bookmarks)$"
"float, class:^(firefox)$,title:^(Library)$"
"float, class:^(firefox)$,title:^(Extension: \(uBlock Origin\))"
"float, class:^(firefox)$,title:^(Firefox Sharing Indicator)$"
"float, class:^(firefox)$,title:^(Opening .+)$"
"float, class:^(firefox)$,title:^$"
# Float some pcmanfm windows
"float, class:^(pcmanfm-qt)$,title:^(Mount)$"
"float, class:^(pcmanfm-qt)$,title:^(Preferences)$"
"float, class:^(pcmanfm-qt)$,title:^(Move files)$"
"float, class:^(pcmanfm-qt)$,title:^(Search Files)$"
"float, class:^(pcmanfm-qt)$,title:^(Copy Files)$"
"float, class:^(pcmanfm-qt)$,title:^(Confirm to replace files)$"
# Float some windows from other apps
"float, class:^(Spotify)$,title:^(Ozone X11)$"
"float, class:^(python3)$,title:^(Tor Browser Launcher Settings)$"
"float, class:^(python3)$,title:^(Tor Browser)$"
# General float rules
"float, class:^(file_progress)$"
"float, class:^(confirm)$"
"float, class:^(dialog)$"
"float, class:^(download)$"
"float, class:^(notification)$"
"float, class:^(error)$"
"float, class:^(splash)$"
"float, class:^(confirmreset)$"
#
# Fixes
#
# Jetbrains
"windowdance, class:^(jetbrains-.*)$,floating:1"
"center, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"nofocus, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"noborder, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"center, class:^(jetbrains-.*)$,title:^( )$,floating:1"
"stayfocused, class:^(jetbrains-.*)$,title:^( )$,floating:1"
"noborder, class:^(jetbrains-.*)$,title:^( )$,floating:1"
"nofocus, class:^(jetbrains-.*)$,title:^(win.*)$,floating:1"
"noinitialfocus, class:^(jetbrains-.*)$,title:^(win.*)$"
];
layerrule = [
# Don't add borders to grim selections when taking screenshots
"noanim, ^(selection)$"
# TODO: Add these
];
};
}

View file

@ -6,7 +6,7 @@
}: let
inherit (lib) mkIf;
hyprPkgs = (import ./packages {inherit pkgs;});
inherit (import ./packages {inherit pkgs;}) hyprland-swap-workspace;
cfg = osConfig.myOptions.home-manager.wms.hyprland;
in {
@ -15,11 +15,8 @@ in {
];
config = mkIf cfg.enable {
home.packages = [
hyprPkgs.hyprland-swap-workspace
hyprPkgs.hyprland-move-window
pkgs.brightnessctl
hyprPkgs.brightness
home.packages = with pkgs; [
hyprland-swap-workspace
];
wayland.windowManager.hyprland = {

View file

@ -1,22 +0,0 @@
#!/bin/sh
# This is mainly a wrapper, acting as just: `brightnessctl s $1`
# However, in addition, this will also produce a notification with
# the brightness level shown as a progress bar.
# Send brightness level desktop notification, showing the given brightness level
# as progress bar, along with given message.
# $1 - brightness level (number 0-100)
send_brightness_notify() {
percent_brightness="$1"
notify-send \
--app-name="brightness" \
--urgency="normal" \
-h int:value:$percent_brightness \
-h string:synchronous:brightness \
"brightness" "Level: $percent_brightness"
}
out="$(brightnessctl s "$1")"
cur_percent="$(echo "$out" | grep "Current" | grep -oP '\(\d+%' | tr -d '()%')"
send_brightness_notify "$cur_percent"

View file

@ -1,4 +0,0 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "brightness" ''
${builtins.readFile ./brightness.sh}
''

View file

@ -3,9 +3,7 @@
...
}: let
packages = {
hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace {};
hyprland-move-window = pkgs.callPackage ./hyprland-move-window {};
brightness = pkgs.callPackage ./brightness {};
hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace.nix {};
};
in
packages

View file

@ -1,5 +0,0 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "hyprland-move-window" ''
${builtins.readFile ./hyprland-move-window.sh}
''

View file

@ -1,35 +0,0 @@
#!/bin/sh
RESIZE_SIZE=${1:?Missing resize size}
RESIZE_PARAMS_X=0
RESIZE_PARAMS_Y=0
DIRECTION=${2:?Missing move direction}
case $DIRECTION in
l)
RESIZE_PARAMS_X=-$RESIZE_SIZE
;;
r)
RESIZE_PARAMS_X=$RESIZE_SIZE
;;
u)
RESIZE_PARAMS_Y=-$RESIZE_SIZE
;;
d)
RESIZE_PARAMS_Y=$RESIZE_SIZE
;;
*)
echo "kbye"
return 1
;;
esac
ACTIVE_WINDOW=$(hyprctl activewindow -j)
IS_FLOATING=$(echo "$ACTIVE_WINDOW" | jq .floating)
if [ "$IS_FLOATING" = "true" ]; then
hyprctl dispatch moveactive "$RESIZE_PARAMS_X" "$RESIZE_PARAMS_Y"
else
hyprctl dispatch movewindow "$DIRECTION"
fi