From 9c779766b7ed33d769601f39501a881a6b437701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 1 Dec 2023 19:06:44 +0100 Subject: [PATCH 01/10] Add HyprLand config --- hypr/hyprland.conf | 134 ++++++++++++++++++++++++++++++++++++++++++++ hypr/hyprpaper.conf | 3 + 2 files changed, 137 insertions(+) create mode 100644 hypr/hyprland.conf create mode 100644 hypr/hyprpaper.conf diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf new file mode 100644 index 0000000..c11dc0a --- /dev/null +++ b/hypr/hyprland.conf @@ -0,0 +1,134 @@ +monitor=,preferred,auto,1 +exec-once=hyprpaper + +input { + kb_layout = us + follow_mouse = 1 +} + +general { + gaps_in = 2 + gaps_out = 5 + border_size = 2 + col.active_border = rgba(002f5fee) + col.inactive_border = rgba(ffffff00) + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 1 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 2 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +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, 2, myBezier + animation = windowsOut, 1, 2, default, popin 80% + animation = border, 1, 2, default + animation = borderangle, 1, 2, default + animation = fade, 1, 2, default + animation = workspaces, 1, 1, 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=1 +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bindr = $mainMod, SUPER_L, exec, /home/user/.config/awesome/scripts/toggle_rofi.sh +bind = $mainMod, return, exec, alacritty +bind = $mainMod, Q, killactive, +bind = $mainMod, A, exec, nautilus +bind = $mainMod, B, exec, firefox +bind = $mainMod, F, togglefloating, +bind = $mainMod, SPACE, togglesplit, # dwindle +bind = $mainMod, C, exec, CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu +bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu + + +# Move focus with mainMod + arrow keys +bind = $mainMod, H, movefocus, l +bind = $mainMod, L, movefocus, r +bind = $mainMod, K, movefocus, u +bind = $mainMod, J, movefocus, d + +# Switch workspaces with mainMod + [0-9] +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 active window to a workspace with mainMod + SHIFT + [0-9] +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 +bind = $mainMod SHIFT, T, movetoworkspace, empty + + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, TAB, workspace, e+1 +bind = $mainMod SHIFT, TAB, workspace, e-1 +bind = $mainMod, T, workspace, empty + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf new file mode 100644 index 0000000..42dfc88 --- /dev/null +++ b/hypr/hyprpaper.conf @@ -0,0 +1,3 @@ +ipc = off +preload = ~/.config/awesome/images/wallpaper.png +wallpaper = eDP-1,~/.config/awesome/images/wallpaper.png From 79609ea132b50072aaece7308252c6b3b747a1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 1 Dec 2023 21:11:36 +0100 Subject: [PATCH 02/10] Add Waybar --- hypr/hyprland.conf | 35 +++++++++--- waybar/config | 85 ++++++++++++++++++++++++++++ waybar/style.css | 137 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+), 7 deletions(-) create mode 100644 waybar/config create mode 100644 waybar/style.css diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index c11dc0a..b94f82a 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -21,9 +21,7 @@ decoration { rounding = 1 blur { - enabled = true - size = 3 - passes = 1 + enabled = false } drop_shadow = yes @@ -48,9 +46,7 @@ animations { } 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 + preserve_split = yes no_gaps_when_only=1 } @@ -82,21 +78,46 @@ $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bindr = $mainMod, SUPER_L, exec, /home/user/.config/awesome/scripts/toggle_rofi.sh -bind = $mainMod, return, exec, alacritty +bind = $mainMod, return, exec, /home/user/.config/awesome/scripts/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid) +bind = $mainMod SHIFT, return, exec, alacritty bind = $mainMod, Q, killactive, bind = $mainMod, A, exec, nautilus bind = $mainMod, B, exec, firefox +bind = $mainMod, M, fullscreen, 1 +bind = $mainMod, F11, fullscreen bind = $mainMod, F, togglefloating, bind = $mainMod, SPACE, togglesplit, # dwindle +bind = CONTROL_L ALT_L, L, exec, swaylock bind = $mainMod, C, exec, CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu +bind = $mainMod, Y, exec, /home/user/.config/rofi/rofi-ykman.sh +bind = Control Mod2 Mod4, Q, exec, systemctl suspend bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu +bind = ,XF86PowerOff, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu +bind = ,XF86MonBrightnessUp, exec, xbacklight -inc 10 +bind = ,XF86MonBrightnessDown, exec, xbacklight -dec 10 +bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0 +bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%- +bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind = ,XF86AudioNext, exec, playerctl next +bind = ,XF86AudioPrev, exec, playerctl previous +bind = $mainMod,XF86AudioMute, exec, playerctl play-pause +bind = $mainMod,XF86AudioRaiseVolume, exec, playerctl next +bind = $mainMod,XF86AudioLowerVolume, exec, playerctl previous # Move focus with mainMod + arrow keys bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d +bind = $mainMod SHIFT, H, movewindow, l +bind = $mainMod SHIFT, L, movewindow, r +bind = $mainMod SHIFT, K, movewindow, u +bind = $mainMod SHIFT, J, movewindow, d +bind = $mainMod CONTROL_L, L, resizeactive, 20 0 +bind = $mainMod CONTROL_L, H, resizeactive, -20 0 +bind = $mainMod CONTROL_L, K, resizeactive, 0 -20 +bind = $mainMod CONTROL_L, J, resizeactive, 0 20 # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..9a8b042 --- /dev/null +++ b/waybar/config @@ -0,0 +1,85 @@ +{ + "layer": "top", // Waybar at top layer + "height": 28, // Waybar height (to be removed for auto height) + "spacing": 4, // Gaps between modules (4px) + "modules-left": ["hyprland/window"], + "modules-center": ["hyprland/workspaces"], + "modules-right": ["tray", "wireplumber", "cpu", "memory", "temperature", "battery", "clock"], + "wireplumber": { + "format": "{icon} {volume}%", + "on-click": "helvum", + "format-muted": "", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "format-icons": ["", "", ""] + }, + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": false, + "warp-on-scroll": false + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "timezone": "Europe/Brussels", + "format": "{:%H:%M:%S}", + "interval": 1, + "format-alt": "{:%Y-%m-%d}" + + }, + "cpu": { + "format": "{max_frequency}GHz", + "tooltip": false, + "interval": 5 + }, + "memory": { + "interval": 5, + "format": "{used:0.2f}G" + }, + "temperature": { + "thermal-zone": 6, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C", + // "format-icons": ["", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon}", + "format-plugged": "{capacity}% ", + "format-alt": "{capacity}% {time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": [" ", " ", " ", " ", " "] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + } +} diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..09aca33 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,137 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Ubuntu; + font-size: 14px; + font-weight:500; +} + +window#waybar { + background-color: rgba(0, 0, 0, 0.3); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +/* window#waybar.hidden { */ +/* opacity: 0.2; */ +/* } */ + +button { + border: none; + border-radius: 0; +} + +button:hover { + background: inherit; + box-shadow: inset 0 0 #ffffff; +} + +#workspaces button { + padding: 0 8px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background-color: #002F5F; +} + +#workspaces button.focused { + background-color: #002F5F; +} + +#workspaces button.active { + background-color: #002F5F; +} + +#workspaces button.urgent { + background-color: #ed8274; +} + +#window, +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#tray { + padding: 0 10px; + border-radius: 3px; + color: #ffffff; + background-color: #002F5F; + margin-left:1.5px; + margin-right:1.5px; +} + +#window { + font-weight:400; + font-size:14px; + margin-left:0; +} + +#clock { + margin-right:0; +} + +#workspaces { + margin: 0 10px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} From 2f0c0617d8bcdadf01843342ec057dd153428cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 1 Dec 2023 21:12:21 +0100 Subject: [PATCH 03/10] Add awesome full-screen --- awesome/keys.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/awesome/keys.lua b/awesome/keys.lua index 575dfa8..7824c3d 100644 --- a/awesome/keys.lua +++ b/awesome/keys.lua @@ -258,13 +258,6 @@ keys.globalkeys = gears.table.join( {description = "-10%", group = "hotkeys"} ), - -- Brightness - awful.key({ }, "XF86MonBrightnessDown", function () - awful.spawn("xbacklight -dec 15") end), - - awful.key({ }, "XF86MonBrightnessUp", function () - awful.spawn("xbacklight -inc 15") end), - -- ALSA volume control awful.key({}, "XF86AudioRaiseVolume", function() @@ -665,6 +658,15 @@ keys.clientkeys = gears.table.join( c:raise() end, {description = "(un)maximize", group = "client"} + ), + + -- Full Screen + awful.key({modkey}, "F11", + function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = "(un)fullscreen", group = "client"} ) ) From 6557a6d94eea6fa95a9225bad6d98921aa8d9604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 00:03:50 +0100 Subject: [PATCH 04/10] Update Hyprland config --- awesome/scripts/launch_alacritty.sh | 12 ++++++- hypr/hyprland.conf | 49 +++++++++++------------------ waybar/config | 11 ++++++- waybar/style.css | 14 ++++++--- 4 files changed, 50 insertions(+), 36 deletions(-) diff --git a/awesome/scripts/launch_alacritty.sh b/awesome/scripts/launch_alacritty.sh index 05d8d78..28cfa4d 100755 --- a/awesome/scripts/launch_alacritty.sh +++ b/awesome/scripts/launch_alacritty.sh @@ -8,10 +8,20 @@ CHILD_PID=$(pgrep -P $1) GRAND_CHILD_PID=$(pgrep -P $CHILD_PID) [[ $? == 0 ]] && [[ $(ps -p $GRAND_CHILD_PID -o comm=) == "ssh" ]] && RUNNING_SSH=true && CHILD_PID=$GRAND_CHILD_PID + if [ $RUNNING_SSH == true ]; then CLIENT=$(ps -p $CHILD_PID -o args --no-headers | awk '{ print $2 }') PORT=$(ss -tnpa | grep ssh | grep "pid=$CHILD_PID" | awk '{ print $4 }' | grep -o '[0-9]*$') alacritty -e ssh $CLIENT -t "cd \"\$(readlink -e /proc/\$(cat /tmp/ssh_session_$PORT)/cwd)\"; zsh --login" else - alacritty --working-directory "$(readlink -e /proc/$CHILD_PID/cwd)" + if [ $(ps -p $1 -o comm=) == "alacritty" ]; then + CWD=$(readlink -e /proc/$CHILD_PID/cwd) + if [ $CWD != "" ]; then + alacritty --working-directory "$CWD" + else + alacritty + fi + else + alacritty + fi fi diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index b94f82a..1a1a25f 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,13 +1,18 @@ -monitor=,preferred,auto,1 exec-once=hyprpaper +env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 +monitor=,preferred,auto,1 +exec-once=waybar +exec-once=sudo wg-quick up wg0 +exec-once=sleep 0.7 && swaylock input { kb_layout = us follow_mouse = 1 + kb_options = compose:rctrl } general { - gaps_in = 2 + gaps_in = 1 gaps_out = 5 border_size = 2 col.active_border = rgba(002f5fee) @@ -15,19 +20,21 @@ general { layout = dwindle } +xwayland { + force_zero_scaling = true +} + +misc { + disable_hyprland_logo = 1 +} + decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 1 blur { enabled = false } - - drop_shadow = yes - shadow_range = 2 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) } animations { @@ -36,7 +43,6 @@ animations { # 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, 2, myBezier animation = windowsOut, 1, 2, default, popin 80% animation = border, 1, 2, default @@ -47,33 +53,16 @@ animations { dwindle { preserve_split = yes - no_gaps_when_only=1 -} - -master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true + no_gaps_when_only = 1 + force_split = 2 } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = on + workspace_swipe_invert = false } -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic-mouse-v1 { - sensitivity = -0.5 -} - -# Example windowrule v1 -# windowrule = float, ^(kitty)$ -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more @@ -82,7 +71,7 @@ bind = $mainMod, return, exec, /home/user/.config/awesome/scripts/launch_alacrit bind = $mainMod SHIFT, return, exec, alacritty bind = $mainMod, Q, killactive, bind = $mainMod, A, exec, nautilus -bind = $mainMod, B, exec, firefox +bind = $mainMod, B, exec, MOZ_ENABLE_WAYLAND=1 firefox bind = $mainMod, M, fullscreen, 1 bind = $mainMod, F11, fullscreen bind = $mainMod, F, togglefloating, diff --git a/waybar/config b/waybar/config index 9a8b042..6d1b606 100644 --- a/waybar/config +++ b/waybar/config @@ -4,7 +4,7 @@ "spacing": 4, // Gaps between modules (4px) "modules-left": ["hyprland/window"], "modules-center": ["hyprland/workspaces"], - "modules-right": ["tray", "wireplumber", "cpu", "memory", "temperature", "battery", "clock"], + "modules-right": ["tray", "wireplumber", "cpu", "memory", "custom/updates", "temperature", "battery", "clock"], "wireplumber": { "format": "{icon} {volume}%", "on-click": "helvum", @@ -17,6 +17,9 @@ "all-outputs": false, "warp-on-scroll": false }, + "hyprland/window": { + "max-length": 50, + }, "tray": { // "icon-size": 21, "spacing": 10 @@ -33,6 +36,12 @@ "tooltip": false, "interval": 5 }, + "custom/updates": { + "exec": "bash -c \"checkupdates | wc -l\"", + "on-click": "alacritty -e bash -c \"yay ; echo '\nDone, press any key to exit...' ; read\"", + "interval": 60, + "format": "{}  ", + }, "memory": { "interval": 5, "format": "{used:0.2f}G" diff --git a/waybar/style.css b/waybar/style.css index 09aca33..83e6dcd 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -48,6 +48,7 @@ button:hover { background-color: #ed8274; } + #window, #clock, #battery, @@ -59,13 +60,15 @@ button:hover { #network, #pulseaudio, #wireplumber, +#custom-updates, +#custom-powermode, #tray { - padding: 0 10px; - border-radius: 3px; + padding: 0 12px; + border-radius: 5px; color: #ffffff; background-color: #002F5F; - margin-left:1.5px; - margin-right:1.5px; + margin-left:2px; + margin-right:2px; } #window { @@ -73,6 +76,9 @@ button:hover { font-size:14px; margin-left:0; } +window#waybar.empty #window { + background-color: transparent; +} #clock { margin-right:0; From 933322768fd6c0217fd763c27df6f61609897e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 12:42:53 +0100 Subject: [PATCH 05/10] Add hyprsome --- hypr/hyprland.conf | 94 +++++++++++++++++++++++++++++++-------------- hypr/hyprpaper.conf | 4 +- waybar/config | 31 ++------------- waybar/style.css | 3 +- 4 files changed, 74 insertions(+), 58 deletions(-) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 1a1a25f..3a091e6 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,9 +1,48 @@ exec-once=hyprpaper env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 -monitor=,preferred,auto,1 +env = WLR_NO_HARDWARE_CURSORS,1 +monitor=DP-2,preferred,0x550,1 +monitor=DP-1,preferred,1920x0,1,bitdepth,10 +monitor=HDMI-A-1,preferred,5760x550,1 +workspace=DP-1,11 +workspace=DP-2,21 +workspace=HDMI-A-1,1 + +workspace=1,monitor:HDMI-A-1, default:true +workspace=2,monitor:HDMI-A-1 +workspace=3,monitor:HDMI-A-1 +workspace=4,monitor:HDMI-A-1 +workspace=5,monitor:HDMI-A-1 +workspace=6,monitor:HDMI-A-1 +workspace=7,monitor:HDMI-A-1 +workspace=8,monitor:HDMI-A-1 +workspace=9,monitor:HDMI-A-1 + +workspace=11,monitor:DP-1, default:true +workspace=12,monitor:DP-1 +workspace=13,monitor:DP-1 +workspace=14,monitor:DP-1 +workspace=15,monitor:DP-1 +workspace=16,monitor:DP-1 +workspace=17,monitor:DP-1 +workspace=18,monitor:DP-1 +workspace=19,monitor:DP-1 + +workspace=21,monitor:DP-2 +workspace=22,monitor:DP-2 +workspace=23,monitor:DP-2 +workspace=24,monitor:DP-2 +workspace=25,monitor:DP-2 +workspace=26,monitor:DP-2 +workspace=27,monitor:DP-2 +workspace=28,monitor:DP-2 +workspace=29,monitor:DP-2 + exec-once=waybar -exec-once=sudo wg-quick up wg0 -exec-once=sleep 0.7 && swaylock + +binds { + scroll_event_delay=1 +} input { kb_layout = us @@ -79,7 +118,7 @@ bind = $mainMod, SPACE, togglesplit, # dwindle bind = CONTROL_L ALT_L, L, exec, swaylock bind = $mainMod, C, exec, CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu bind = $mainMod, Y, exec, /home/user/.config/rofi/rofi-ykman.sh -bind = Control Mod2 Mod4, Q, exec, systemctl suspend +bind = Super_L Control_L, Q, exec, systemctl suspend bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu bind = ,XF86PowerOff, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu @@ -87,6 +126,8 @@ bind = ,XF86MonBrightnessUp, exec, xbacklight -inc 10 bind = ,XF86MonBrightnessDown, exec, xbacklight -dec 10 bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0 bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%- +bind = ,mouse_right, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1.0 +bind = ,mouse_left, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bind = ,XF86AudioNext, exec, playerctl next bind = ,XF86AudioPrev, exec, playerctl previous @@ -108,35 +149,32 @@ bind = $mainMod CONTROL_L, H, resizeactive, -20 0 bind = $mainMod CONTROL_L, K, resizeactive, 0 -20 bind = $mainMod CONTROL_L, J, resizeactive, 0 20 -# Switch workspaces with mainMod + [0-9] -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 +bind = $mainMod, 1, exec, hyprsome workspace 1 +bind = $mainMod, 2, exec, hyprsome workspace 2 +bind = $mainMod, 3, exec, hyprsome workspace 3 +bind = $mainMod, 4, exec, hyprsome workspace 4 +bind = $mainMod, 5, exec, hyprsome workspace 5 +bind = $mainMod, 6, exec, hyprsome workspace 6 +bind = $mainMod, 7, exec, hyprsome workspace 7 +bind = $mainMod, 8, exec, hyprsome workspace 8 +bind = $mainMod, 9, exec, hyprsome workspace 9 + +bind = $mainMod SHIFT, 1, exec, hyprsome move 1 +bind = $mainMod SHIFT, 2, exec, hyprsome move 2 +bind = $mainMod SHIFT, 3, exec, hyprsome move 3 +bind = $mainMod SHIFT, 4, exec, hyprsome move 4 +bind = $mainMod SHIFT, 5, exec, hyprsome move 5 +bind = $mainMod SHIFT, 6, exec, hyprsome move 6 +bind = $mainMod SHIFT, 7, exec, hyprsome move 7 +bind = $mainMod SHIFT, 8, exec, hyprsome move 8 +bind = $mainMod SHIFT, 9, exec, hyprsome move 9 -# Move active window to a workspace with mainMod + SHIFT + [0-9] -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 bind = $mainMod SHIFT, T, movetoworkspace, empty # Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, TAB, workspace, e+1 -bind = $mainMod SHIFT, TAB, workspace, e-1 +bind = $mainMod, TAB, workspace, m+1 +bind = $mainMod SHIFT, TAB, workspace, m-1 bind = $mainMod, T, workspace, empty # Move/resize windows with mainMod + LMB/RMB and dragging diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf index 42dfc88..6dd5230 100644 --- a/hypr/hyprpaper.conf +++ b/hypr/hyprpaper.conf @@ -1,3 +1,5 @@ ipc = off preload = ~/.config/awesome/images/wallpaper.png -wallpaper = eDP-1,~/.config/awesome/images/wallpaper.png +wallpaper = DP-1,~/.config/awesome/images/wallpaper.png +wallpaper = DP-2,~/.config/awesome/images/wallpaper.png +wallpaper = HDMI-A-1,~/.config/awesome/images/wallpaper.png diff --git a/waybar/config b/waybar/config index 6d1b606..9a94139 100644 --- a/waybar/config +++ b/waybar/config @@ -1,13 +1,13 @@ { "layer": "top", // Waybar at top layer - "height": 28, // Waybar height (to be removed for auto height) + "height": 30, // Waybar height (to be removed for auto height) "spacing": 4, // Gaps between modules (4px) + "output": "DP-1", "modules-left": ["hyprland/window"], "modules-center": ["hyprland/workspaces"], "modules-right": ["tray", "wireplumber", "cpu", "memory", "custom/updates", "temperature", "battery", "clock"], "wireplumber": { "format": "{icon} {volume}%", - "on-click": "helvum", "format-muted": "", "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", "format-icons": ["", "", ""] @@ -15,7 +15,8 @@ "hyprland/workspaces": { "disable-scroll": true, "all-outputs": false, - "warp-on-scroll": false + "warp-on-scroll": false, + "format": "{name}" }, "hyprland/window": { "max-length": 50, @@ -67,28 +68,4 @@ // "format-full": "", "format-icons": [" ", " ", " ", " ", " "] }, - "battery#bat2": { - "bat": "BAT2" - }, - "network": { - // "interface": "wlp2*", // (Optional) To force the use of this interface - "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "{ipaddr}/{cidr} ", - "tooltip-format": "{ifname} via {gwaddr} ", - "format-linked": "{ifname} (No IP) ", - "format-disconnected": "Disconnected ⚠", - "format-alt": "{ifname}: {ipaddr}/{cidr}" - }, - "custom/media": { - "format": "{icon} {}", - "return-type": "json", - "max-length": 40, - "format-icons": { - "spotify": "", - "default": "🎜" - }, - "escape": true, - "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder - // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name - } } diff --git a/waybar/style.css b/waybar/style.css index 83e6dcd..d3774e1 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -1,7 +1,7 @@ * { /* `otf-font-awesome` is required to be installed for icons */ font-family: Ubuntu; - font-size: 14px; + font-size: 17px; font-weight:500; } @@ -73,7 +73,6 @@ button:hover { #window { font-weight:400; - font-size:14px; margin-left:0; } window#waybar.empty #window { From dcd09dee2a1ed49da5bfc4a5a03024f4877a582f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 13:49:32 +0100 Subject: [PATCH 06/10] Add hyprsome fork --- hypr/hyprsome/.gitignore | 2 + hypr/hyprsome/Cargo.lock | 1207 +++++++++++++++++++ hypr/hyprsome/Cargo.toml | 17 + hypr/hyprsome/LICENSE.txt | 16 + hypr/hyprsome/README.md | 76 ++ hypr/hyprsome/flake.lock | 159 +++ hypr/hyprsome/flake.nix | 23 + hypr/hyprsome/src/hyprland_ipc/client.rs | 17 + hypr/hyprsome/src/hyprland_ipc/mod.rs | 37 + hypr/hyprsome/src/hyprland_ipc/monitor.rs | 43 + hypr/hyprsome/src/hyprland_ipc/option.rs | 19 + hypr/hyprsome/src/hyprland_ipc/workspace.rs | 23 + hypr/hyprsome/src/main.rs | 350 ++++++ 13 files changed, 1989 insertions(+) create mode 100644 hypr/hyprsome/.gitignore create mode 100644 hypr/hyprsome/Cargo.lock create mode 100644 hypr/hyprsome/Cargo.toml create mode 100644 hypr/hyprsome/LICENSE.txt create mode 100644 hypr/hyprsome/README.md create mode 100644 hypr/hyprsome/flake.lock create mode 100644 hypr/hyprsome/flake.nix create mode 100644 hypr/hyprsome/src/hyprland_ipc/client.rs create mode 100644 hypr/hyprsome/src/hyprland_ipc/mod.rs create mode 100644 hypr/hyprsome/src/hyprland_ipc/monitor.rs create mode 100644 hypr/hyprsome/src/hyprland_ipc/option.rs create mode 100644 hypr/hyprsome/src/hyprland_ipc/workspace.rs create mode 100644 hypr/hyprsome/src/main.rs diff --git a/hypr/hyprsome/.gitignore b/hypr/hyprsome/.gitignore new file mode 100644 index 0000000..d787b70 --- /dev/null +++ b/hypr/hyprsome/.gitignore @@ -0,0 +1,2 @@ +/target +/result diff --git a/hypr/hyprsome/Cargo.lock b/hypr/hyprsome/Cargo.lock new file mode 100644 index 0000000..706551c --- /dev/null +++ b/hypr/hyprsome/Cargo.lock @@ -0,0 +1,1207 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.102", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "dyn-clone" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" + +[[package]] +name = "futures-executor" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" + +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "futures-sink" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" + +[[package]] +name = "futures-task" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" + +[[package]] +name = "futures-util" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hyprland" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d341e36a776cd092622daf2439a484247f3dc7d25eab7b286cc88ac85120d3" +dependencies = [ + "async-trait", + "derive_more", + "doc-comment", + "futures", + "hex", + "hyprland-macros", + "lazy_static", + "num-traits", + "paste", + "regex", + "serde", + "serde_json", + "serde_repr", + "strum", + "tokio", +] + +[[package]] +name = "hyprland-macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0088021091c08e29e9d1f735142ab811bd4d4d7f82fd4d4673407cb96fffb062" +dependencies = [ + "quote", + "syn 2.0.12", +] + +[[package]] +name = "hyprsome" +version = "0.1.11" +dependencies = [ + "clap", + "hyprland", + "ipc-rpc", + "schemars", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipc-channel" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cb1d9211085f0ea6f1379d944b93c4d07e8207aa3bcf49f37eda12b85081887" +dependencies = [ + "bincode", + "crossbeam-channel", + "fnv", + "lazy_static", + "libc", + "mio 0.6.23", + "rand", + "serde", + "tempfile", + "uuid 0.8.2", + "winapi 0.3.9", +] + +[[package]] +name = "ipc-rpc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a06b6be6ca53e9aabea482d2cc45d651aecb8bc3515442909fcd73ab11d692" +dependencies = [ + "futures", + "ipc-channel", + "log", + "schemars", + "serde", + "serde_json", + "thiserror", + "tokio", + "uuid 1.2.1", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.36.1", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "net2" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.102", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "schemars" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.102", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "serde_json" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.102", +] + +[[package]] +name = "syn" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.9", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio 0.8.4", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.102", +] + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.7", + "serde", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/hypr/hyprsome/Cargo.toml b/hypr/hyprsome/Cargo.toml new file mode 100644 index 0000000..83a36ba --- /dev/null +++ b/hypr/hyprsome/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "hyprsome" +description = "A small CLI apps that allows to make Hyprland's workspaces work like Awesome in multi-monitor setup" +license = "GPL-3.0" +version = "0.1.11" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4.0.15", features = ["derive"] } +ipc-rpc = "1.2.2" +schemars = "0.8.11" +serde = "1.0.145" +serde_json = "1.0.86" +tokio = "1.21.2" +hyprland = "0.3.1" diff --git a/hypr/hyprsome/LICENSE.txt b/hypr/hyprsome/LICENSE.txt new file mode 100644 index 0000000..736f7b0 --- /dev/null +++ b/hypr/hyprsome/LICENSE.txt @@ -0,0 +1,16 @@ +The GPLv3 License (GPLv3) + +Copyright (c) 2022 Author + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/hypr/hyprsome/README.md b/hypr/hyprsome/README.md new file mode 100644 index 0000000..0a26688 --- /dev/null +++ b/hypr/hyprsome/README.md @@ -0,0 +1,76 @@ +# Hyprsome +Hyprsome is a binary that interacts with Hyprland's Unix socket to make workspaces behave similarly to AwesomeWM in a multi-monitor setup. + +If you're focused on a monitor and press SUPER+[1-9], you'll only switch to the workspaces that are bound to that monitor. + +It is inspired by Swaysome, which does a similar thing for Sway. + +# Installation +` +cargo install hyprsome +` + +# Usage +Once the binary is installed, you can modify your ~/.config/hypr/hyprland.conf to accomodate it. +Here is an example of a dual monitor setup: + +``` +monitor=DP-1,1920x1080@60,0x0,1.33 +monitor=DP-1,transform,1 +workspace=DP-1,1 +monitor=HDMI-A-1,3440x1440@100,813x0,1 +workspace=HDMI-A-1,11 +``` + +Most noteworthy thing here is the 'workspace' keyword that I use to bind a default workspace for each monitor. + + +Then you can bind workspaces to your different monitors. + +It is very important that you bind your workspaces in order. + +Check the results of `hyprctl monitors`. Bind workspaces from 1 to 9 on your monitor that has 0 as an id. + +Then just bind workspaces by prefixing numbers by the id of the monitor they're bound to. + +Here, HDMI-A-1's id is 1, so I bind workspaces from 11 to 19 to it. + +``` + workspace=1,monitor:DP-1 + workspace=2,monitor:DP-1 + workspace=3,monitor:DP-1 + workspace=4,monitor:DP-1 + workspace=5,monitor:DP-1 + + workspace=11,monitor:HDMI-A-1 + workspace=12,monitor:HDMI-A-1 + workspace=13,monitor:HDMI-A-1 + workspace=14,monitor:HDMI-A-1 + workspace=15,monitor:HDMI-A-1 +``` + +Then it's just a matter of making sure your regular workspace keybinds call hyprsome. + +``` +bind=SUPER,1,exec,hyprsome workspace 1 +bind=SUPER,2,exec,hyprsome workspace 2 +bind=SUPER,3,exec,hyprsome workspace 3 +bind=SUPER,4,exec,hyprsome workspace 4 +bind=SUPER,5,exec,hyprsome workspace 5 + +bind=SUPERSHIFT,1,exec,hyprsome move 1 +bind=SUPERSHIFT,2,exec,hyprsome move 2 +bind=SUPERSHIFT,3,exec,hyprsome move 3 +bind=SUPERSHIFT,4,exec,hyprsome move 4 +bind=SUPERSHIFT,5,exec,hyprsome move 5 + +``` + +# Limitations +This is alpha software and my first program in Rust, bugs are bound to happen but nothing that will break your system. + +Some features are most likely missing. + +You can only have 9 workspaces per monitor as of now. + +I haven't worked on supporting monitor hot-plug at all. It may work but it's unlikely. diff --git a/hypr/hyprsome/flake.lock b/hypr/hyprsome/flake.lock new file mode 100644 index 0000000..51f0f15 --- /dev/null +++ b/hypr/hyprsome/flake.lock @@ -0,0 +1,159 @@ +{ + "nodes": { + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1684981077, + "narHash": "sha256-68X9cFm0RTZm8u0rXPbeBzOVUH5OoUGAfeHHVoxGd9o=", + "owner": "ipetkov", + "repo": "crane", + "rev": "35110cccf28823320f4fd697fcafcb5038683982", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1685498995, + "narHash": "sha256-rdyjnkq87tJp+T2Bm1OD/9NXKSsh/vLlPeqCc/mm7qs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9cfaa8a1a00830d17487cb60a19bb86f96f09b27", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "crane", + "flake-utils" + ], + "nixpkgs": [ + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1683080331, + "narHash": "sha256-nGDvJ1DAxZIwdn6ww8IFwzoHb2rqBP4wv/65Wt5vflk=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "d59c3fa0cba8336e115b376c2d9e91053aa59e56", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/hypr/hyprsome/flake.nix b/hypr/hyprsome/flake.nix new file mode 100644 index 0000000..31bb13e --- /dev/null +++ b/hypr/hyprsome/flake.nix @@ -0,0 +1,23 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + crane.url = "github:ipetkov/crane"; + crane.inputs.nixpkgs.follows = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, crane, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + craneLib = crane.lib.${system}; + in + { + packages.default = craneLib.buildPackage { + src = craneLib.cleanCargoSource (craneLib.path ./.); + # Add extra inputs here or any other derivation settings + # doCheck = true; + # buildInputs = []; + # nativeBuildInputs = []; + }; + }); +} diff --git a/hypr/hyprsome/src/hyprland_ipc/client.rs b/hypr/hyprsome/src/hyprland_ipc/client.rs new file mode 100644 index 0000000..0821534 --- /dev/null +++ b/hypr/hyprsome/src/hyprland_ipc/client.rs @@ -0,0 +1,17 @@ +use hyprland::{ + data::{Client, Clients}, + dispatch::{Direction, Dispatch, DispatchType}, + shared::{HyprData, HyprDataActiveOptional}, +}; + +pub fn get_active() -> Option { + Client::get_active().unwrap() +} + +pub fn get() -> Clients { + Clients::get().unwrap() +} + +pub fn focus_by_direction(direction: Direction) { + let _ = Dispatch::call(DispatchType::MoveFocus(direction)); +} diff --git a/hypr/hyprsome/src/hyprland_ipc/mod.rs b/hypr/hyprsome/src/hyprland_ipc/mod.rs new file mode 100644 index 0000000..ff83b2b --- /dev/null +++ b/hypr/hyprsome/src/hyprland_ipc/mod.rs @@ -0,0 +1,37 @@ +pub mod client; +pub mod monitor; +pub mod option; +pub mod workspace; + +use std::env; +use std::io::prelude::*; +use std::os::unix::net::UnixStream; + +extern crate serde_json; + +fn send_message(action: &str, args: Vec<&str>) -> String { + let env_var_name = "HYPRLAND_INSTANCE_SIGNATURE"; + + let hyprland_instance_sig = match env::var(env_var_name) { + Ok(v) => v, + Err(e) => panic!("${} is not set ({})", env_var_name, e), + }; + + let socket_path = format!("/tmp/hypr/{}/.socket.sock", hyprland_instance_sig); + let mut stream = match UnixStream::connect(socket_path) { + Err(_) => panic!("server is not running"), + Ok(stream) => stream, + }; + + let mut message = format!("j/{}", action); + args.into_iter() + .for_each(|a| message.push_str(&format!(" {}", a))); + + // TODO: stop being stinky and manage errors + let _ = stream.write_all(message.as_bytes()); + let mut response = String::new(); + + // TODO: stop being stinky and manage errors + let _ = stream.read_to_string(&mut response); + response +} diff --git a/hypr/hyprsome/src/hyprland_ipc/monitor.rs b/hypr/hyprsome/src/hyprland_ipc/monitor.rs new file mode 100644 index 0000000..f08e4e9 --- /dev/null +++ b/hypr/hyprsome/src/hyprland_ipc/monitor.rs @@ -0,0 +1,43 @@ +use hyprland::data::{Monitor, Monitors}; +use hyprland::dispatch::*; +use hyprland::shared::HyprData; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug)] +pub struct ActiveWorkspace { + pub id: u64, + pub name: String, +} + +pub fn get_by_id(id: i16) -> Monitor { + let mut monitors = get(); + monitors.find(|m| m.id == id).unwrap() +} + +pub fn get() -> Monitors { + Monitors::get().unwrap() +} + +pub fn focus_left() { + let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( + Direction::Left, + ))); +} + +pub fn focus_right() { + let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( + Direction::Right, + ))); +} + +pub fn focus_up() { + let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( + Direction::Up, + ))); +} + +pub fn focus_down() { + let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( + Direction::Down, + ))); +} diff --git a/hypr/hyprsome/src/hyprland_ipc/option.rs b/hypr/hyprsome/src/hyprland_ipc/option.rs new file mode 100644 index 0000000..368403f --- /dev/null +++ b/hypr/hyprsome/src/hyprland_ipc/option.rs @@ -0,0 +1,19 @@ +use serde::{Deserialize, Serialize}; + +const GETOPTIONS: &str = "getoptions"; +const GENERAL_GAPS_OUT: &str = "general:gaps_out"; + +#[derive(Serialize, Deserialize, Debug)] +pub struct HyprlandOption { + pub option: String, + pub int: i32, + pub float: f64, + pub str: String, +} + +pub fn get_gaps() -> i16 { + let response = super::send_message(GETOPTIONS, vec![GENERAL_GAPS_OUT]); + let gap_option: HyprlandOption = serde_json::from_str(&response).unwrap(); + + gap_option.int as i16 +} diff --git a/hypr/hyprsome/src/hyprland_ipc/workspace.rs b/hypr/hyprsome/src/hyprland_ipc/workspace.rs new file mode 100644 index 0000000..82c606c --- /dev/null +++ b/hypr/hyprsome/src/hyprland_ipc/workspace.rs @@ -0,0 +1,23 @@ +// TODO: change this file to hyprland-rs +const WORKSPACE: &str = "workspace"; +const DISPATCH: &str = "dispatch"; +const MOVETOWORKSPACESILENT: &str = "movetoworkspacesilent"; +const MOVETOWORKSPACE: &str = "movetoworkspace"; + +pub fn focus(workspace_number: &u64) { + let _ = super::send_message(DISPATCH, vec![WORKSPACE, &workspace_number.to_string()]); +} + +pub fn move_to(workspace_number: &u64) { + super::send_message( + DISPATCH, + vec![MOVETOWORKSPACESILENT, &workspace_number.to_string()], + ); +} + +pub fn move_focus(workspace_number: &u64) { + super::send_message( + DISPATCH, + vec![MOVETOWORKSPACE, &workspace_number.to_string()], + ); +} diff --git a/hypr/hyprsome/src/main.rs b/hypr/hyprsome/src/main.rs new file mode 100644 index 0000000..6ba836a --- /dev/null +++ b/hypr/hyprsome/src/main.rs @@ -0,0 +1,350 @@ +use clap::{Parser, Subcommand, ValueEnum}; + +mod hyprland_ipc; +use hyprland::{ + data::{Client, Monitor, Transforms, Workspaces}, + dispatch::Direction, shared::HyprData, +}; +use hyprland_ipc::{client, monitor, option, workspace}; + +#[derive(Parser)] +#[command(name = "hyprsome")] +#[command(author = "sopa0")] +#[command(version = "0.1.11")] +#[command(about = "Makes hyprland workspaces behave like awesome", long_about = None)] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + Focus { direction: Directions }, + Workspace { workspace_number: u64 }, + Move { workspace_number: u64 }, + Movefocus { workspace_number: u64 }, + MoveEmpty, + FocusEmpty, +} + +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)] +enum Directions { + L, + R, + U, + D, +} + +pub trait MonitorDimensions { + fn real_width(&self) -> f32; + fn real_height(&self) -> f32; +} + +impl MonitorDimensions for Monitor { + fn real_width(&self) -> f32 { + match self.transform { + Transforms::Normal + | Transforms::Normal180 + | Transforms::Flipped + | Transforms::Flipped180 => self.width as f32 / self.scale, + Transforms::Normal90 | Transforms::Normal270 | Transforms::Flipped90 => { + self.height as f32 / self.scale + } + _ => self.width as f32, + } + } + + fn real_height(&self) -> f32 { + match self.transform { + Transforms::Normal + | Transforms::Flipped + | Transforms::Normal180 + | Transforms::Flipped180 => self.height as f32 / self.scale, + Transforms::Normal90 | Transforms::Normal270 | Transforms::Flipped90 => { + self.width as f32 / self.scale + } + _ => self.height as f32, + } + } +} + +pub fn get_current_monitor() -> Monitor { + monitor::get().find(|m| m.focused).unwrap() +} + +//TODO: refactor this nonsense +pub fn select_workspace(workspace_number: &u64) { + let mon = get_current_monitor(); + match mon.id { + 0 => workspace::focus(workspace_number), + _ => { + workspace::focus( + &format!("{}{}", mon.id, workspace_number) + .parse::() + .unwrap(), + ); + } + } +} + +pub fn get_empty_workspace() -> u64 { + let mon = get_current_monitor(); + let mut found = Vec::new(); + for workspaces in Workspaces::get().iter() { + for workspace in workspaces.iter() { + if workspace.monitor == mon.name { + let mut id = workspace.name.clone(); + if id.len() > 1 { + id = id.chars().nth(1).unwrap().to_string(); + } + found.push(id); + } + } + } + for i in 1..9 { + if !found.contains(&i.to_string()) { + return i; + } + } + return 1; // Send to the first workspace if no others are available +} + +//TODO: refactor this nonsense +pub fn send_to_workspace(workspace_number: &u64) { + let mon = get_current_monitor(); + match mon.id { + 0 => workspace::move_to(workspace_number), + _ => { + workspace::move_to( + &format!("{}{}", mon.id, workspace_number) + .parse::() + .unwrap(), + ); + } + } +} + +//TODO: refactor this nonsense +pub fn movefocus(workspace_number: &u64) { + let mon = get_current_monitor(); + match mon.id { + 0 => workspace::move_focus(workspace_number), + _ => { + workspace::move_focus( + &format!("{}{}", mon.id, workspace_number) + .parse::() + .unwrap(), + ); + } + } +} + +pub fn get_leftmost_client_for_monitor(mon_id: i16) -> Client { + let clients = client::get(); + + clients + .into_iter() + .filter(|c| c.monitor == mon_id) + .min_by_key(|c| c.at.0) + .unwrap() +} + +pub fn focus_left(aw: Client) { + let mon = monitor::get_by_id(aw.monitor); + let is_leftmost_client = is_leftmost_client(&aw, &mon); + + if is_leftmost_monitor(&mon) && is_leftmost_client { + return; + } + + if is_leftmost_client { + monitor::focus_left(); + + return; + } + + client::focus_by_direction(Direction::Left); +} + +pub fn focus_right(aw: Client) { + let mon = monitor::get_by_id(aw.monitor); + + if is_rightmost_monitor(&mon) && is_rightmost_client(&aw, &mon) { + return; + } + + if is_rightmost_client(&aw, &mon) { + monitor::focus_right(); + + return; + } + + client::focus_by_direction(Direction::Right); +} + +pub fn focus_up(aw: Client) { + let mon = monitor::get_by_id(aw.monitor); + let is_top_client = is_top_client(&aw, &mon); + + if is_top_monitor(&mon) && is_top_client { + return; + } + + if is_top_client { + monitor::focus_up(); + + return; + } + + client::focus_by_direction(Direction::Up); +} + +pub fn focus_down(aw: Client) { + let mon = monitor::get_by_id(aw.monitor); + let is_bottom_client = is_bottom_client(&aw, &mon); + + if is_bottom_monitor(&mon) && is_bottom_client { + return; + } + + if is_bottom_client { + monitor::focus_down(); + + return; + } + + client::focus_by_direction(Direction::Down); +} + +pub fn is_leftmost_client(aw: &Client, mon: &Monitor) -> bool { + let gaps = option::get_gaps(); + + if (aw.at.0 - gaps) as i32 == mon.x { + return true; + } + + false +} + +pub fn is_rightmost_client(aw: &Client, mon: &Monitor) -> bool { + let gaps = option::get_gaps(); + + if mon.real_width() + mon.x as f32 - gaps as f32 == aw.size.0 as f32 + aw.at.0 as f32 { + return true; + } + + false +} + +pub fn is_top_client(aw: &Client, mon: &Monitor) -> bool { + let gaps = option::get_gaps(); + + if mon.y + (gaps as i32) + (mon.reserved.1 as i32) == (aw.at.1 as i32) { + return true; + } + + false +} + +pub fn is_bottom_client(aw: &Client, mon: &Monitor) -> bool { + let gaps = option::get_gaps(); + + if mon.real_height() + mon.y as f32 - gaps as f32 - mon.reserved.1 as f32 + == aw.size.1 as f32 + gaps as f32 + { + return true; + } + + false +} + +pub fn is_rightmost_monitor(mon: &Monitor) -> bool { + let monitors = monitor::get(); + let max = monitors.into_iter().max_by_key(|m| m.x).unwrap(); + if max.x == mon.x { + return true; + } + false +} + +pub fn is_leftmost_monitor(mon: &Monitor) -> bool { + let monitors = monitor::get(); + let min = monitors.into_iter().min_by_key(|m| m.x).unwrap(); + if min.x == mon.x { + return true; + } + false +} + +pub fn is_top_monitor(mon: &Monitor) -> bool { + let monitors = monitor::get(); + let min = monitors.into_iter().min_by_key(|m| m.y).unwrap(); + if min.y == mon.y { + return true; + } + false +} + +pub fn is_bottom_monitor(mon: &Monitor) -> bool { + let monitors = monitor::get(); + let max = monitors.into_iter().max_by_key(|m| m.y).unwrap(); + if max.y == mon.y { + return true; + } + false +} + +fn main() { + let cli = Cli::parse(); + match &cli.command { + Commands::Focus { direction } => match direction { + Directions::L => { + let aw = client::get_active(); + + match aw { + Some(aw) => focus_left(aw), + None => monitor::focus_left(), + }; + } + Directions::R => { + let aw = client::get_active(); + + match aw { + Some(aw) => focus_right(aw), + None => monitor::focus_right(), + }; + } + Directions::U => { + let aw = client::get_active(); + + match aw { + Some(aw) => focus_up(aw), + None => monitor::focus_up(), + }; + } + Directions::D => { + let aw = client::get_active(); + + match aw { + Some(aw) => focus_down(aw), + None => monitor::focus_down(), + }; + } + }, + Commands::Workspace { workspace_number } => { + select_workspace(workspace_number); + } + Commands::Move { workspace_number } => { + send_to_workspace(workspace_number); + } + Commands::Movefocus { workspace_number } => { + movefocus(workspace_number); + } + Commands::MoveEmpty => { + movefocus(&get_empty_workspace()); + }, + Commands::FocusEmpty => { + send_to_workspace(&get_empty_workspace()); + }, + } +} From e78cec1387d3d0ff3e8013930f91d3347534cb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 13:55:28 +0100 Subject: [PATCH 07/10] Integrate with new Hyprsome functionality --- hypr/hyprland.conf | 23 ++++++++++++----------- hypr/hyprsome/src/main.rs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 3a091e6..25ed405 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -48,6 +48,7 @@ input { kb_layout = us follow_mouse = 1 kb_options = compose:rctrl + numlock_by_default = true } general { @@ -159,23 +160,23 @@ bind = $mainMod, 7, exec, hyprsome workspace 7 bind = $mainMod, 8, exec, hyprsome workspace 8 bind = $mainMod, 9, exec, hyprsome workspace 9 -bind = $mainMod SHIFT, 1, exec, hyprsome move 1 -bind = $mainMod SHIFT, 2, exec, hyprsome move 2 -bind = $mainMod SHIFT, 3, exec, hyprsome move 3 -bind = $mainMod SHIFT, 4, exec, hyprsome move 4 -bind = $mainMod SHIFT, 5, exec, hyprsome move 5 -bind = $mainMod SHIFT, 6, exec, hyprsome move 6 -bind = $mainMod SHIFT, 7, exec, hyprsome move 7 -bind = $mainMod SHIFT, 8, exec, hyprsome move 8 -bind = $mainMod SHIFT, 9, exec, hyprsome move 9 +bind = $mainMod SHIFT, 1, exec, hyprsome movefocus 1 +bind = $mainMod SHIFT, 2, exec, hyprsome movefocus 2 +bind = $mainMod SHIFT, 3, exec, hyprsome movefocus 3 +bind = $mainMod SHIFT, 4, exec, hyprsome movefocus 4 +bind = $mainMod SHIFT, 5, exec, hyprsome movefocus 5 +bind = $mainMod SHIFT, 6, exec, hyprsome movefocus 6 +bind = $mainMod SHIFT, 7, exec, hyprsome movefocus 7 +bind = $mainMod SHIFT, 8, exec, hyprsome movefocus 8 +bind = $mainMod SHIFT, 9, exec, hyprsome movefocus 9 -bind = $mainMod SHIFT, T, movetoworkspace, empty +bind = $mainMod SHIFT, T, exec, hyprsome move-empty +bind = $mainMod, T, exec, hyprsome focus-empty # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, TAB, workspace, m+1 bind = $mainMod SHIFT, TAB, workspace, m-1 -bind = $mainMod, T, workspace, empty # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow diff --git a/hypr/hyprsome/src/main.rs b/hypr/hyprsome/src/main.rs index 6ba836a..8db2946 100644 --- a/hypr/hyprsome/src/main.rs +++ b/hypr/hyprsome/src/main.rs @@ -344,7 +344,7 @@ fn main() { movefocus(&get_empty_workspace()); }, Commands::FocusEmpty => { - send_to_workspace(&get_empty_workspace()); + select_workspace(&get_empty_workspace()); }, } } From 2a60cd75077866ad392822310439f482c6611acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 17:26:32 +0100 Subject: [PATCH 08/10] Kill rofi when already running --- awesome/scripts/toggle_rofi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesome/scripts/toggle_rofi.sh b/awesome/scripts/toggle_rofi.sh index 39b689d..82adeaf 100755 --- a/awesome/scripts/toggle_rofi.sh +++ b/awesome/scripts/toggle_rofi.sh @@ -1,6 +1,6 @@ if ps -C rofi > /dev/null then - echo "Already running" + killall rofi else export TERMINAL=alacritty rofi -show combi -combi-modi drun,calc:~/.config/rofi/show-calculator.sh -sort -levenshtein-sort From 80cf417932f9f3a00d9a0b7b251c8f45193b9d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 2 Dec 2023 17:32:38 +0100 Subject: [PATCH 09/10] Move scripts --- awesome/keys.lua | 10 +++++----- i3/config | 18 +++++++++--------- polybar/config.ini | 2 +- .../scripts => scripts}/launch_alacritty.sh | 0 {awesome/scripts => scripts}/performance.sh | 0 {awesome/scripts => scripts}/powersave.sh | 0 {awesome/scripts => scripts}/rofi-power-menu | 0 {awesome/scripts => scripts}/setup_display.sh | 0 .../scripts => scripts}/toggle_performance.sh | 0 {awesome/scripts => scripts}/toggle_rofi.sh | 0 10 files changed, 15 insertions(+), 15 deletions(-) rename {awesome/scripts => scripts}/launch_alacritty.sh (100%) rename {awesome/scripts => scripts}/performance.sh (100%) rename {awesome/scripts => scripts}/powersave.sh (100%) rename {awesome/scripts => scripts}/rofi-power-menu (100%) rename {awesome/scripts => scripts}/setup_display.sh (100%) rename {awesome/scripts => scripts}/toggle_performance.sh (100%) rename {awesome/scripts => scripts}/toggle_rofi.sh (100%) diff --git a/awesome/keys.lua b/awesome/keys.lua index 7824c3d..121bdfe 100644 --- a/awesome/keys.lua +++ b/awesome/keys.lua @@ -166,7 +166,7 @@ keys.globalkeys = gears.table.join( function() local c = client.focus if c and c.class == "Alacritty" then - awful.spawn(string.format(os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/launch_alacritty.sh %d", c.pid)) + awful.spawn(string.format(os.getenv("XDG_CONFIG_HOME") .. "/scripts/launch_alacritty.sh %d", c.pid)) else awful.spawn('bash -c "WINIT_X11_SCALE_FACTOR=1 alacritty"') end @@ -211,14 +211,14 @@ keys.globalkeys = gears.table.join( -- launch rofi awful.key({modkey}, "XF86Launch5", function() - awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/toggle_rofi.sh") + awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/scripts/toggle_rofi.sh") end, {description = "application launcher", group = "launcher"} ), -- launch rofi awful.key({modkey}, "d", function() - awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/toggle_rofi.sh") + awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/scripts/toggle_rofi.sh") end, {description = "application launcher", group = "launcher"} ), @@ -335,7 +335,7 @@ keys.globalkeys = gears.table.join( awful.key({modkey}, "Escape", function() -- emit signal to show the exit screen - awful.spawn("rofi -show power-menu -modi power-menu:" .. os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/rofi-power-menu") + awful.spawn("rofi -show power-menu -modi power-menu:" .. os.getenv("XDG_CONFIG_HOME") .. "/scripts/rofi-power-menu") end, {description = "toggle exit screen", group = "hotkeys"} ), @@ -343,7 +343,7 @@ keys.globalkeys = gears.table.join( awful.key({}, "XF86PowerOff", function() -- emit signal to show the exit screen - awful.spawn("rofi -show power-menu -modi power-menu:~/.config/awesome/scripts/rofi-power-menu") + awful.spawn("rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu") end, {description = "toggle exit screen", group = "hotkeys"} ), diff --git a/i3/config b/i3/config index 41b5e6d..8b27bf9 100644 --- a/i3/config +++ b/i3/config @@ -1,8 +1,8 @@ set $mod Mod4 font pango:monospace 0 -exec --no-startup-id "/home/user/.config/awesome/scripts/setup_display.sh" -exec_always --no-startup-id "feh --no-fehbg --bg-fill /home/user/.config/awesome/wallpaper/wallpaper.png" +exec --no-startup-id "/home/user/.config/scripts/setup_display.sh" +exec_always --no-startup-id "feh --no-fehbg --bg-fill /home/user/.config/wallpaper/wallpaper.png" exec --no-startup-id "picom -b" exec_always --no-startup-id "killall polybar; polybar -r &" exec --no-startup-id "nm-applet &" @@ -36,21 +36,21 @@ floating_modifier $mod tiling_drag modifier titlebar # start a terminal -bindsym $mod+Return exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) +bindsym $mod+Return exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) -bindsym $mod+minus split v; exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) +bindsym $mod+minus split v; exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) -bindsym $mod+bar split h; exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) +bindsym $mod+bar split h; exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2) # kill focused window bindsym $mod+q kill # start dmenu (a program launcher) -bindsym $mod+d exec "~/.config/awesome/scripts/toggle_rofi.sh" -bindsym $mod+XF86Launch5 exec "~/.config/awesome/scripts/toggle_rofi.sh" -bindsym $mod+Escape exec "rofi -show power-menu -modi power-menu:~/.config/awesome/scripts/rofi-power-menu" -bindsym XF86PowerOff exec "rofi -show power-menu -modi power-menu:~/.config/awesome/scripts/rofi-power-menu" +bindsym $mod+d exec "~/.config/scripts/toggle_rofi.sh" +bindsym $mod+XF86Launch5 exec "~/.config/scripts/toggle_rofi.sh" +bindsym $mod+Escape exec "rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu" +bindsym XF86PowerOff exec "rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu" bindsym $mod+c exec CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu bindsym $mod+b exec firefox bindsym $mod+a exec nautilus diff --git a/polybar/config.ini b/polybar/config.ini index 3833912..a2f2f48 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -151,7 +151,7 @@ format-foreground = ${colors.white} format-warn-background = ${self.background} exec = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor format = "