Improve wayland configs

This commit is contained in:
Tobias Reisinger 2023-06-30 20:47:01 +02:00
parent 35f4e0c88f
commit ceea1c316a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
18 changed files with 549 additions and 41 deletions

85
.config/hypr/base.conf Normal file
View file

@ -0,0 +1,85 @@
source = ~/.config/hypr/dracula.conf
# See https://wiki.hyprland.org/Configuring/Monitors/
#monitor=,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Some default env vars.
env = XCURSOR_SIZE,24
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = de
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
accel_profile = flat
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 3
gaps_out = 6
border_size = 1
no_cursor_warps = true
layout = dwindle
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 3
blur = yes
blur_size = 3
blur_passes = 1
blur_new_optimizations = on
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
no_gaps_when_only = yes # whether to apply gaps when there is only one window
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
source = ~/.config/hypr/binds.conf
source = ~/.config/hypr/rules.conf
exec-once = autostart-manage run-wayland

54
.config/hypr/binds.conf Normal file
View file

@ -0,0 +1,54 @@
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, return, exec, $TERMINAL
bind = $mainMod, Q, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, dolphin
bind = $mainMod, V, togglefloating,
bind = $mainMod, D, exec, j4-dmenu-desktop --dmenu="$DMENU"
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod SHIFT, R, exec, autostart-manage run-wayland
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, $ws01
bind = $mainMod, 2, workspace, $ws02
bind = $mainMod, 3, workspace, $ws03
bind = $mainMod, 4, workspace, $ws04
bind = $mainMod, 5, workspace, $ws05
bind = $mainMod, 6, workspace, $ws06
bind = $mainMod, 7, workspace, $ws07
bind = $mainMod, 8, workspace, $ws08
bind = $mainMod, 9, workspace, $ws09
bind = $mainMod, 0, workspace, $ws10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, $ws01
bind = $mainMod SHIFT, 2, movetoworkspacesilent, $ws02
bind = $mainMod SHIFT, 3, movetoworkspacesilent, $ws03
bind = $mainMod SHIFT, 4, movetoworkspacesilent, $ws04
bind = $mainMod SHIFT, 5, movetoworkspacesilent, $ws05
bind = $mainMod SHIFT, 6, movetoworkspacesilent, $ws06
bind = $mainMod SHIFT, 7, movetoworkspacesilent, $ws07
bind = $mainMod SHIFT, 8, movetoworkspacesilent, $ws08
bind = $mainMod SHIFT, 9, movetoworkspacesilent, $ws09
bind = $mainMod SHIFT, 0, movetoworkspacesilent, $ws10
bind = $mainMod, dead_circumflex, workspace, $ws_focus
bind = $mainMod SHIFT, dead_circumflex, movetoworkspacesilent, $ws_focus
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

View file

@ -0,0 +1,18 @@
$ws01 = name:[01]
$ws02 = name:[02]
$ws03 = name:[03]
$ws04 = name:[04]
$ws05 = name:[05]
$ws06 = name:[06]
$ws07 = name:[07]
$ws08 = name:[08]
$ws09 = name:[09]
$ws10 = name:[10]
$ws_web = $ws01
$ws_focus = $ws07
$ws_media = $ws08
$ws_voip = $ws09
$ws_msg = $ws10
$ws_steam = $ws_media

18
.config/hypr/dracula.conf Normal file
View file

@ -0,0 +1,18 @@
# dracula/hyprland
general {
col.active_border = rgb(bd93f9)
col.inactive_border = rgba(44475aaa)
col.group_border = rgba(282a36dd)
col.group_border_active = rgb(bd93f9)
}
decoration {
col.shadow = rgba(1E202966)
# suggested shadow setting
drop_shadow = yes
shadow_range = 60
shadow_offset = 1 2
shadow_render_power = 3
shadow_scale = 0.97
}
#windowrulev2 = bordercolor rgb(ff5555),xwayland:1 # check if window is xwayland

23
.config/hypr/handler.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -i sh -p socat jq
ws_media="[08]"
ws_voip="[09]"
_handler_check_ws_media_empty() {
has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0")
if [ "$has_zero_windows" == "true" ]; then
hyprctl dispatch workspace "$ws_voip"
fi
}
handle() {
case $1 in
movewindow*) _handler_check_ws_media_empty "$1" ;;
closewindow*) _handler_check_ws_media_empty "$1" ;;
esac
}
socat -U - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do handle "$line"; done

View file

@ -0,0 +1,21 @@
source = ~/.config/hypr/defaults.conf
$mon1 = DP-1
$mon2 = HDMI-A-1
workspace=$ws01, monitor:$mon1, default:true
workspace=$ws02, monitor:$mon1
workspace=$ws03, monitor:$mon1
workspace=$ws04, monitor:$mon1
workspace=$ws05, monitor:$mon1
workspace=$ws06, monitor:$mon1
workspace=$ws07, monitor:$mon1
workspace=$ws08, monitor:$mon2
workspace=$ws09, monitor:$mon2, default:true
workspace=$ws10, monitor:$mon2
monitor = $mon1,2560x1440@144,1920x0,auto
monitor = $mon2,1920x1080@60,0x0,auto
source = ~/.config/hypr/base.conf

24
.config/hypr/rules.conf Normal file
View file

@ -0,0 +1,24 @@
### Workspace rules
windowrulev2 = workspace $ws_web,class:(qutebrowser)
windowrulev2 = workspace $ws_web,class:(firefox)
windowrulev2 = workspace $ws_focus,class:^(jetbrains-)
windowrulev2 = workspace $ws_media,class:(Chromium)
windowrulev2 = workspace $ws_media,class:(FreeTube)
windowrulev2 = workspace $ws_voip,class:(discord)
windowrulev2 = workspace $ws_voip,class:(Element)
windowrulev2 = workspace $ws_voip,class:(TeamSpeak 3)
windowrulev2 = workspace $ws_msg,class:(thunderbird)
windowrulev2 = workspace $ws_msg,class:(Signal)
### Specific rules
#windowrulev2 = workspace $ws_steam silent,class:(steam) # Moves menues too :/
#windowrulev2 = noinitialfocus,class:(steam) # No focus on menues :/
windowrulev2 = fullscreen,class:(FreeTube)