[hyprland] move more configs to nix

This commit is contained in:
Simon Cornet 2024-03-24 20:51:24 +01:00
parent ad48ceb007
commit 1387babd6b
14 changed files with 344 additions and 295 deletions

View File

@ -1,85 +0,0 @@
binds {
workspace_back_and_forth = true
}
# bindings
$mainMod = SUPER
# basic key bindings
bind = $mainMod, Return, exec, alacritty
bind = $mainMod, B, exec, blueman-manager
bind = $mainMod, C, exec, alacritty --class clipse --command clipse $PPID
bind = $mainMod, D, exec, ~/.dotfiles/apps/wofi/wofi.sh
bind = $mainMod, E, exec, nautilus --new-window
bind = $mainMod, F, fullscreen
bind = $mainMod, J, togglesplit
bind = $mainMod, K, exec, alacritty --class scratchbox
bind = $mainMod, M, exit,
bind = $mainMod, N, exec, alacritty --class nmtui --command ~/.dotfiles/hyprland/nmtui.sh
bind = $mainMod, P, pseudo
bind = $mainMod, Q, killactive
bind = $mainMod, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh area
bind = ALT SHIFT, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh screen
bind = $mainMod, T, exec, alacritty --class nostt --command nostt
bind = $mainMod, V, togglefloating
# manage lockscreen
bind = $mainMod, L, exec, ~/.dotfiles/apps/swaylock/lock.sh
bindl = ,switch:on:Lid Switch, exec, ~/.dotfiles/apps/swaylock/lock.sh
# focus bindings
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
# switch workspace bindings
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# move window to workspaces bindings
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# move workspaces using the mouse
bind = $mainMod, mouse_up, workspace, e+1
bind = $mainMod, mouse_down, workspace, e-1
# move window using keys
bind = ALT SHIFT, up, movewindow, u
bind = ALT SHIFT, down, movewindow, d
bind = ALT SHIFT, left, movewindow, l
bind = ALT SHIFT, right, movewindow, r
# move windows using the mouse
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# resize window bindings
bind = $mainMod SHIFT, up, resizeactive, 0 -50
bind = $mainMod SHIFT, down, resizeactive, 0 50
bind = $mainMod SHIFT, left, resizeactive, -50 0
bind = $mainMod SHIFT, right, resizeactive, 50 0
# multimedia key bindings
bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SINK@ toggle
bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind = ,XF86MonBrightnessDown, exec, brightnessctl set 10%-
bind = ,XF86MonBrightnessUp, exec, brightnessctl set 10%+

View File

@ -1,41 +0,0 @@
# start waybar
exec = ~/.dotfiles/apps/waybar/startup.sh
# set monitor workspaces
exec = ~/.dotfiles/hyprland/monitor.sh
# start tailscale
exec-once = tailscale up
# clear and start clipse
exec-once = clipse -clear
exec-once = clipse -listen
# start blueman
exec = blueman-tray
# theming
exec = ~/.dotfiles/apps/wallpaper/startup.sh
# set volume
exec-once = wpctl set-volume @DEFAULT_AUDIO_SINK@ 80%
# solaar
exec-once = ~/.dotfiles/hyprland/startup/solaar.sh
# nextcloud desktop
exec-once = ~/.dotfiles/hyprland/startup/nextcloud_desktop.sh
# center apps
exec = ~/.dotfiles/hyprland/centre_app.sh --class "solaar" --title "solaar"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "nostt" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "nmtui" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "Rofi" --title "rofi -  Apps"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "scratchbox" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "blueman-manager" --title "Bluetooth Devices"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "com.gabm.satty" --title "satty"
# start default apps
exec-once = [workspace 1 silent] bitwarden
exec-once = [workspace 2 silent] firefox
exec-once = [workspace 3 silent] alacritty

View File

@ -1,23 +0,0 @@
# dwindle secion
dwindle {
pseudotile = yes
preserve_split = yes
}
# general section
general {
border_size = 3
col.active_border = rgba(528bffaa)
col.inactive_border = rgba(595959aa)
gaps_in = 5
gaps_out = 20
layout = dwindle
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}

View File

@ -1,51 +0,0 @@
# monitors
monitor = eDP-1, 1920x1200@60, 760x1440, 1 # laptop (native: 2560x1600@60, preffered 1920x1200)
monitor = , preferred, 0x0, 1 # default resolution on any other screen
# unscale xwayland
xwayland {
force_zero_scaling = true
}
# animation section
animations {
enabled = yes
bezier = fade, 0.05, 1, 0.1, 1
bezier = smoothOut, 0.36, 0, 0.66, 1
bezier = smoothIn, 0.25, 1, 0.5, 1
animation = windows, 1, 3, smoothIn,
animation = windowsOut, 1, 3, smoothOut,
animation = windowsMove, 1, 3, default
animation = border, 1, 10, default
animation = fade, 1, 5, smoothIn
animation = fadeDim, 1, 5, smoothIn
animation = workspaces, 1, 8, fade
}
# decoration section
decoration {
# blur
blur {
enabled = true
size = 2
passes = 2
}
# windows
rounding = 16
# shadows
drop_shadow = true
shadow_offset = 2 2
shadow_range = 8
shadow_render_power = 2
shadow_ignore_window = true
col.shadow = 0x66000000
# opacity
active_opacity = 1.0
inactive_opacity = 1.0
}

View File

@ -1,19 +0,0 @@
# gesture secion
gestures {
workspace_swipe = true
workspace_swipe_min_speed_to_force = 80
workspace_swipe_cancel_ratio = 0.2
}
# input section
input {
kb_layout = us
follow_mouse = 1
sensitivity = 0
touchpad {
disable_while_typing = true
natural_scroll = yes
}
}

View File

@ -1,69 +0,0 @@
# master section
master {
new_is_master = true
}
# window rules
windowrule = float, confirm|confirmreset
windowrule = float, dialog|download
windowrule = float, error|eog
windowrule = float, file-roller|file_progress
windowrule = float, Lxappearance|notification
windowrule = float, splash
windowrule = float, title:branchdialog
windowrule = float, title:Nextcloud
# alacritty
windowrulev2 = float, class:(scratchbox)
windowrulev2 = size 1200 800, class:(scratchbox)
windowrulev2 = move center, class:(scratchbox)
# blueman
windowrulev2 = float, class:(blueman-manager), title:(Bluetooth Devices)
windowrulev2 = size 1000 800, class:(blueman-manager), title:(Bluetooth Devices)
windowrulev2 = move center, class:(blueman-manager), title:(Bluetooth Devices)
# clipse
windowrulev2 = float, class:(clipse)
windowrulev2 = size 1000 800, class:(clipse)
windowrulev2 = move center, class:(clipse)
# save as
windowrulev2 = float, title:(Save As)
windowrulev2 = size 1000 800, title:(Save As)
windowrulev2 = move center, title:(Save As)
# open file
windowrulev2 = float, title:(Open File)
windowrulev2 = size 1000 800, title:(Open File)
windowrulev2 = move center, title:(Open File)
# add folder to workspace
windowrulev2 = float, title:(Add Folder to Workspace)
windowrulev2 = size 1000 800, title:(Add Folder to Workspace)
windowrulev2 = move center, title:(Add Folder to Workspace)
# network manager tui
windowrulev2 = float, class:(nmtui), title:(Alacritty)
windowrulev2 = size 1180 792, class:(nmtui), title:(Alacritty)
windowrulev2 = move center, class:(nmtui), title:(Alacritty)
# nos teletekst
windowrulev2 = float, class:(nostt), title:(Alacritty)
windowrulev2 = size 455 660, class:(nostt), title:(Alacritty)
windowrulev2 = move center, class:(nostt), title:(Alacritty)
# satty
windowrulev2 = float, class:(com.gabm.satty), title:(satty)
windowrulev2 = size 85% 80%, class:(com.gabm.satty), title:(satty)
windowrulev2 = move center, class:(com.gabm.satty), title:(satty)
# solaar
windowrulev2 = float, class:(solaar), title:(solaar)
windowrulev2 = size 1000 800, class:(solaar), title:(solaar)
windowrulev2 = move center, class:(solaar), title:(solaar)
# volume control
windowrulev2 = float, title:(Volume Control)
windowrulev2 = size 1000 800, title:(Volume Control)
windowrulev2 = move center, title:(Volume Control)

View File

@ -1 +1,8 @@
{ ... }: { imports = [ ./hyprland.nix ]; } { ... }:
{
imports = [
./hyprland.nix
./hyprland-execution.nix
./hyprland-execution.nix
];
}

View File

@ -0,0 +1,93 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/bindings.conf".text = ''
binds {
workspace_back_and_forth = true
}
# bindings
$mainMod = SUPER
# basic key bindings
bind = $mainMod, Return, exec, alacritty
bind = $mainMod, B, exec, blueman-manager
bind = $mainMod, C, exec, alacritty --class clipse --command clipse $PPID
bind = $mainMod, D, exec, ~/.dotfiles/apps/wofi/wofi.sh
bind = $mainMod, E, exec, nautilus --new-window
bind = $mainMod, F, fullscreen
bind = $mainMod, J, togglesplit
bind = $mainMod, K, exec, alacritty --class scratchbox
bind = $mainMod, M, exit,
bind = $mainMod, N, exec, alacritty --class nmtui --command ~/.dotfiles/hyprland/nmtui.sh
bind = $mainMod, P, pseudo
bind = $mainMod, Q, killactive
bind = $mainMod, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh area
bind = ALT SHIFT, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh screen
bind = $mainMod, T, exec, alacritty --class nostt --command nostt
bind = $mainMod, V, togglefloating
# manage lockscreen
bind = $mainMod, L, exec, ~/.dotfiles/apps/swaylock/lock.sh
bindl = ,switch:on:Lid Switch, exec, ~/.dotfiles/apps/swaylock/lock.sh
# focus bindings
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
# switch workspace bindings
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# move window to workspaces bindings
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# move workspaces using the mouse
bind = $mainMod, mouse_up, workspace, e+1
bind = $mainMod, mouse_down, workspace, e-1
# move window using keys
bind = ALT SHIFT, up, movewindow, u
bind = ALT SHIFT, down, movewindow, d
bind = ALT SHIFT, left, movewindow, l
bind = ALT SHIFT, right, movewindow, r
# move windows using the mouse
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# resize window bindings
bind = $mainMod SHIFT, up, resizeactive, 0 -50
bind = $mainMod SHIFT, down, resizeactive, 0 50
bind = $mainMod SHIFT, left, resizeactive, -50 0
bind = $mainMod SHIFT, right, resizeactive, 50 0
# multimedia key bindings
bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SINK@ toggle
bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind = ,XF86MonBrightnessDown, exec, brightnessctl set 10%-
bind = ,XF86MonBrightnessUp, exec, brightnessctl set 10%+
'';
}

View File

@ -0,0 +1,48 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/executions.conf".text = ''
# start waybar
exec = ~/.dotfiles/apps/waybar/startup.sh
# set monitor workspaces
exec = ~/.dotfiles/hyprland/monitor.sh
# start tailscale
exec-once = tailscale up
# clear and start clipse
exec-once = clipse -clear
exec-once = clipse -listen
# start blueman
exec = blueman-tray
# theming
exec = ~/.dotfiles/apps/wallpaper/startup.sh
# set volume
exec-once = wpctl set-volume @DEFAULT_AUDIO_SINK@ 80%
# solaar
exec-once = ~/.dotfiles/hyprland/startup/solaar.sh
# nextcloud desktop
exec-once = ~/.dotfiles/hyprland/startup/nextcloud_desktop.sh
# center apps
exec = ~/.dotfiles/hyprland/centre_app.sh --class "solaar" --title "solaar"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "nostt" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "nmtui" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "Rofi" --title "rofi - Apps"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "scratchbox" --title "Alacritty"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "blueman-manager" --title "Bluetooth Devices"
exec = ~/.dotfiles/hyprland/centre_app.sh --class "com.gabm.satty" --title "satty"
# start default apps
exec-once = [workspace 1 silent] bitwarden
exec-once = [workspace 2 silent] firefox
exec-once = [workspace 3 silent] alacritty
'';
}

View File

@ -0,0 +1,30 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/general.conf".text = ''
# dwindle secion
dwindle {
pseudotile = yes
preserve_split = yes
}
# general section
general {
border_size = 3
col.active_border = rgba(528bffaa)
col.inactive_border = rgba(595959aa)
gaps_in = 5
gaps_out = 20
layout = dwindle
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}
'';
}

View File

@ -0,0 +1,58 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/graphics.conf".text = ''
# monitors
monitor = eDP-1, 1920x1200@60, 760x1440, 1 # laptop (native: 2560x1600@60, preffered 1920x1200)
monitor = , preferred, 0x0, 1 # default resolution on any other screen
# unscale xwayland
xwayland {
force_zero_scaling = true
}
# animation section
animations {
enabled = yes
bezier = fade, 0.05, 1, 0.1, 1
bezier = smoothOut, 0.36, 0, 0.66, 1
bezier = smoothIn, 0.25, 1, 0.5, 1
animation = windows, 1, 3, smoothIn,
animation = windowsOut, 1, 3, smoothOut,
animation = windowsMove, 1, 3, default
animation = border, 1, 10, default
animation = fade, 1, 5, smoothIn
animation = fadeDim, 1, 5, smoothIn
animation = workspaces, 1, 8, fade
}
# decoration section
decoration {
# blur
blur {
enabled = true
size = 2
passes = 2
}
# windows
rounding = 16
# shadows
drop_shadow = true
shadow_offset = 2 2
shadow_range = 8
shadow_render_power = 2
shadow_ignore_window = true
col.shadow = 0x66000000
# opacity
active_opacity = 1.0
inactive_opacity = 1.0
}
'';
}

View File

@ -0,0 +1,25 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/input.conf".text = ''
# gesture secion
gestures {
workspace_swipe = true
workspace_swipe_min_speed_to_force = 80
workspace_swipe_cancel_ratio = 0.2
}
# input section
input {
kb_layout = us
follow_mouse = 1
sensitivity = 0
touchpad {
disable_while_typing = true
natural_scroll = yes
}
}
'';
}

View File

@ -0,0 +1,76 @@
{ config, ... }:
{
# include hyprland configs
home.file.".config/hypr/window_rules.conf".text = ''
# master section
master {
new_is_master = true
}
# window rules
windowrule = float, confirm|confirmreset
windowrule = float, dialog|download
windowrule = float, error|eog
windowrule = float, file-roller|file_progress
windowrule = float, Lxappearance|notification
windowrule = float, splash
windowrule = float, title:branchdialog
windowrule = float, title:Nextcloud
# alacritty
windowrulev2 = float, class:(scratchbox)
windowrulev2 = size 1200 800, class:(scratchbox)
windowrulev2 = move center, class:(scratchbox)
# blueman
windowrulev2 = float, class:(blueman-manager), title:(Bluetooth Devices)
windowrulev2 = size 1000 800, class:(blueman-manager), title:(Bluetooth Devices)
windowrulev2 = move center, class:(blueman-manager), title:(Bluetooth Devices)
# clipse
windowrulev2 = float, class:(clipse)
windowrulev2 = size 1000 800, class:(clipse)
windowrulev2 = move center, class:(clipse)
# save as
windowrulev2 = float, title:(Save As)
windowrulev2 = size 1000 800, title:(Save As)
windowrulev2 = move center, title:(Save As)
# open file
windowrulev2 = float, title:(Open File)
windowrulev2 = size 1000 800, title:(Open File)
windowrulev2 = move center, title:(Open File)
# add folder to workspace
windowrulev2 = float, title:(Add Folder to Workspace)
windowrulev2 = size 1000 800, title:(Add Folder to Workspace)
windowrulev2 = move center, title:(Add Folder to Workspace)
# network manager tui
windowrulev2 = float, class:(nmtui), title:(Alacritty)
windowrulev2 = size 1180 792, class:(nmtui), title:(Alacritty)
windowrulev2 = move center, class:(nmtui), title:(Alacritty)
# nos teletekst
windowrulev2 = float, class:(nostt), title:(Alacritty)
windowrulev2 = size 455 660, class:(nostt), title:(Alacritty)
windowrulev2 = move center, class:(nostt), title:(Alacritty)
# satty
windowrulev2 = float, class:(com.gabm.satty), title:(satty)
windowrulev2 = size 85% 80%, class:(com.gabm.satty), title:(satty)
windowrulev2 = move center, class:(com.gabm.satty), title:(satty)
# solaar
windowrulev2 = float, class:(solaar), title:(solaar)
windowrulev2 = size 1000 800, class:(solaar), title:(solaar)
windowrulev2 = move center, class:(solaar), title:(solaar)
# volume control
windowrulev2 = float, title:(Volume Control)
windowrulev2 = size 1000 800, title:(Volume Control)
windowrulev2 = move center, title:(Volume Control)
'';
}

View File

@ -3,11 +3,11 @@
# include hyprland configs # include hyprland configs
home.file.".config/hypr/hyprland.conf".text = '' home.file.".config/hypr/hyprland.conf".text = ''
source = ~/.dotfiles/hyprland/conf.d/executions.conf source = ~/.config/hypr/executions.conf
source = ~/.dotfiles/hyprland/conf.d/general.conf source = ~/.config/hypr/general.conf
source = ~/.dotfiles/hyprland/conf.d/graphics.conf source = ~/.config/hypr/graphics.conf
source = ~/.dotfiles/hyprland/conf.d/input.conf source = ~/.config/hypr/input.conf
source = ~/.dotfiles/hyprland/conf.d/window_rules.conf source = ~/.config/hypr/window_rules.conf
source = ~/.dotfiles/hyprland/conf.d/bindings.conf source = ~/.config/hypr/bindings.conf
''; '';
} }