From 124de2356c399eb2e7ac54dfac58f079540dd846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Fri, 21 Feb 2025 12:30:47 +0100 Subject: [PATCH] hypr: improvements --- dot_config/hypr/hyprland.conf | 91 +++++++++++++------ dot_config/systemd/user/hyprland.target | 3 + .../symlink_waybar.service | 1 + dot_config/systemd/user/hyprlock.service | 6 ++ dot_config/systemd/user/waybar.service | 9 ++ dot_config/waybar/config | 39 +++++--- dot_config/waybar/style.css | 16 ++++ 7 files changed, 127 insertions(+), 38 deletions(-) create mode 100644 dot_config/systemd/user/hyprland.target create mode 100644 dot_config/systemd/user/hyprland.target.wants/symlink_waybar.service create mode 100644 dot_config/systemd/user/hyprlock.service create mode 100644 dot_config/systemd/user/waybar.service diff --git a/dot_config/hypr/hyprland.conf b/dot_config/hypr/hyprland.conf index 793ef45..3de22fe 100644 --- a/dot_config/hypr/hyprland.conf +++ b/dot_config/hypr/hyprland.conf @@ -46,6 +46,12 @@ $faded_orange = 0xffaf3a03 # load plugins exec-once = hyprpm reload -n +monitor = DP-10, preferred, 0x0, 1 +monitor = DP-8, preferred, 0x0, 1 +monitor = eDP-1, preferred, 1920x0, 1.5 +monitor = DP-9, preferred, 3200x0, 1 +monitor = DP-11, preferred, 3200x0, 1 + debug { # enable_stdout_logs = true } @@ -122,7 +128,8 @@ dwindle { pseudotile = false # col.group_border = 0x66777700 # col.group_border_active = 0x66ffff00 - # force_split = 0 + # 2 = always bottom/right + force_split = 2 preserve_split = true # special_scale_factor = 0.8f # split_width_multiplier = 1.0f @@ -171,36 +178,25 @@ plugin { #windowrule=pseudo,abc #windowrule=monitor 0,xyz +### BINDS {{{ +## wm control {{{ + # some nice mouse binds bindm=SUPER,mouse:272,movewindow bindm=SUPER,mouse:273,resizewindow -# example binds -bind=SUPER,RETURN,exec,kitty bind=SUPER,Q,killactive, bind=SUPER_SHIFT,Q,exit, # bind=SUPER,E,exec,dolphin bind=SUPER_SHIFT,F,togglefloating, bind=SUPER,F,fullscreen, -bind=SUPER,X,exec,wofi --show drun +bind=SUPER,m,fullscreenstate,1 # hyprgrass-bind=,edge:d:u,exec, wofi --show drun # hyprgrass-bind=,edge:l:r,exec, busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true # hyprgrass-bind=,edge:r:l,exec, busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false bind=SUPER,P,pseudo, bind=SUPER,S,workspaceopt,allfloat -bind=SUPER,M,focusmonitor,0 -bind=SUPER,N,focusmonitor,1 -# Laptop multimedia keys for volume and LCD brightness -bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle -bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle -bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ -bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- - -# XF86ScreenSaver -bind=,160,exec,loginctl lock-session bind=SUPER,left,movefocus,l bind=SUPER,right,movefocus,r @@ -211,14 +207,22 @@ bind=SUPER,l,movefocus,r bind=SUPER,k,movefocus,u bind=SUPER,j,movefocus,d -bind=SUPER_SHIFT,left,movewindow,l -bind=SUPER_SHIFT,right,movewindow,r -bind=SUPER_SHIFT,up,movewindow,u -bind=SUPER_SHIFT,down,movewindow,d -bind=SUPER_SHIFT,h,movewindow,l -bind=SUPER_SHIFT,l,movewindow,r -bind=SUPER_SHIFT,k,movewindow,u -bind=SUPER_SHIFT,j,movewindow,d +# bind=SUPER_SHIFT,left, movewindow,l +# bind=SUPER_SHIFT,right, movewindow,r +# bind=SUPER_SHIFT,up, movewindow,u +# bind=SUPER_SHIFT,down, movewindow,d +# bind=SUPER_SHIFT,h, movewindow,l +# bind=SUPER_SHIFT,l, movewindow,r +# bind=SUPER_SHIFT,k, movewindow,u +# bind=SUPER_SHIFT,j, movewindow,d +bind=SUPER_SHIFT,left, movewindoworgroup,l +bind=SUPER_SHIFT,right, movewindoworgroup,r +bind=SUPER_SHIFT,up, movewindoworgroup,u +bind=SUPER_SHIFT,down, movewindoworgroup,d +bind=SUPER_SHIFT,h, movewindoworgroup,l +bind=SUPER_SHIFT,l, movewindoworgroup,r +bind=SUPER_SHIFT,k, movewindoworgroup,u +bind=SUPER_SHIFT,j, movewindoworgroup,d bind=SUPER,1,focusworkspaceoncurrentmonitor,1 bind=SUPER,2,focusworkspaceoncurrentmonitor,2 @@ -248,13 +252,46 @@ bind=SUPER,mouse_down,workspace,e+1 bind=SUPER,mouse_up,workspace,e-1 bind=SUPER,space,layoutmsg,togglesplit -bind=SUPER_CONTROL,space,layoutmsg,movetoroot + +bind=SUPER_CONTROL, space, togglegroup +bind=SUPER_CONTROL, left, moveintogroup,l +bind=SUPER_CONTROL, right, moveintogroup,r +bind=SUPER_CONTROL, up, moveintogroup,u +bind=SUPER_CONTROL, down, moveintogroup,d +bind=SUPER, tab, changegroupactive,f +bind=SUPER_SHIFT, tab, changegroupactive,b + + +# }}} + +# os control {{{ +# Laptop multimedia keys for volume and LCD brightness +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ +bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- + +# XF86ScreenSaver +bind=,160,exec,loginctl lock-session + +# }}} + +# launchers {{{ +bind=SUPER,RETURN,exec,kitty bind=,Print,exec,slurp | grim -g - - | wl-copy +bind=SUPER,X,exec,systemd-run --scope --user rofi -modi drun -show drun +bind=SUPER,c,exec,systemd-run --scope --user rofi -lines 0 -show calc -modi calc -no-show-match -no-sort -no-history -calc-command "wl-copy '{result}'" +bind=SUPER,a,exec,systemd-run --scope --user $HOME/bin/gopassmenu -bind=SUPER,a,exec,~/bin/gopassmenu +# 453 - PickupPhone +bind=,453,exec,systemd-run --scope --user $HOME/bin/mprisctl toggle -bind=SUPER,m,fullscreenstate,1 + +# }}} +# }}} exec-once=systemctl --user import-environment WAYLAND_DISPLAY HYPRLAND_CMD HYPRLAND_INSTANCE_SIGNATURE diff --git a/dot_config/systemd/user/hyprland.target b/dot_config/systemd/user/hyprland.target new file mode 100644 index 0000000..0f10744 --- /dev/null +++ b/dot_config/systemd/user/hyprland.target @@ -0,0 +1,3 @@ +[Unit] +Description=Support services for hyprland session +Wants=hypridle.service hyprpaper.service diff --git a/dot_config/systemd/user/hyprland.target.wants/symlink_waybar.service b/dot_config/systemd/user/hyprland.target.wants/symlink_waybar.service new file mode 100644 index 0000000..044caf6 --- /dev/null +++ b/dot_config/systemd/user/hyprland.target.wants/symlink_waybar.service @@ -0,0 +1 @@ +/home/vladimir/.config/systemd/user/waybar.service diff --git a/dot_config/systemd/user/hyprlock.service b/dot_config/systemd/user/hyprlock.service new file mode 100644 index 0000000..61eb7c8 --- /dev/null +++ b/dot_config/systemd/user/hyprlock.service @@ -0,0 +1,6 @@ +[Unit] +Description=Hyprland screen lock + +[Service] +Type=simple +ExecStart=hyprlock diff --git a/dot_config/systemd/user/waybar.service b/dot_config/systemd/user/waybar.service new file mode 100644 index 0000000..85d1e6a --- /dev/null +++ b/dot_config/systemd/user/waybar.service @@ -0,0 +1,9 @@ +[Unit] +Description="Waybar wayland bar" +Before=hyprland.target + +[Service] +ExecStart=/usr/bin/waybar + +[Install] +WantedBy=hyprland.target diff --git a/dot_config/waybar/config b/dot_config/waybar/config index 791d413..d12422c 100644 --- a/dot_config/waybar/config +++ b/dot_config/waybar/config @@ -9,18 +9,22 @@ "modules-left": ["hyprland/workspaces", "hyprland/window"], // "modules-center": [], "modules-right": [ - "idle_inhibitor", - "wireplumber", - "cpu", - "memory", - "temperature", - "network", - "clock", - "upower", - "tray" + "idle_inhibitor", + "mpris", + "wireplumber", + "cpu", + "memory", + "temperature", + "network", + "clock", + "upower", + "tray" ], // Modules configuration - "hyprland-workspaces": {}, + "hyprland/workspaces": { + "all-outputs": true, + "move-to-monitor": true + }, "keyboard-state": { "numlock": true, "capslock": true, @@ -31,7 +35,9 @@ } }, "hyprland/window": { - "format": "{}" + "format": "{}", + "separate-outputs": true, + "icon": true }, "wlr/workspaces": { "all-outputs": true, @@ -90,5 +96,16 @@ "format-linked": "{ifname} (No IP)", "format-disconnected": "󰖪", "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "mpris": { + "format": "{status_icon} {dynamic}", + "tooltip-format": "{player}", + "dynamic-order": ["artist", "title", "comment", "year"], + "dynamic-importance-order": ["title", "date", "artist", "comment" ], + "status-icons": { + "playing": "", + "paused": "", + "stopped": "󰓛" + } } } diff --git a/dot_config/waybar/style.css b/dot_config/waybar/style.css index 495b6ea..b9317a7 100644 --- a/dot_config/waybar/style.css +++ b/dot_config/waybar/style.css @@ -108,6 +108,22 @@ window#waybar.chromium { background-color: @neutral_blue; } +#workspaces button.visible { + background-color: @dark3; +} + +/* #workspaces button.visible.active { */ +/* background-color: @neutral_blue; */ +/* } */ + +#workspaces button.hosting-monitor.visible { + background-color: @dark3; +} + +#workspaces button.hosting-monitor.active { + background-color: @neutral_blue; +} + #clock, #battery, #cpu,