From 7041c2abd84acd2ffa5561b3a4d27c5ba7a7da03 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sun, 13 Apr 2025 21:05:41 +0200 Subject: [PATCH] Update --- hypr/.gitignore | 1 + hypr/cpu.sh | 2 -- hypr/hyprland.conf | 39 +++++------------------------- hypr/{hyprscript.sh => hyprscript} | 36 +++++++++++++++++---------- hypr/mem.sh | 2 -- 5 files changed, 30 insertions(+), 50 deletions(-) delete mode 100755 hypr/cpu.sh rename hypr/{hyprscript.sh => hyprscript} (75%) delete mode 100755 hypr/mem.sh diff --git a/hypr/.gitignore b/hypr/.gitignore index 6c3fb32..bbf5b1a 100644 --- a/hypr/.gitignore +++ b/hypr/.gitignore @@ -1 +1,2 @@ .stat.txt +monitors.conf diff --git a/hypr/cpu.sh b/hypr/cpu.sh deleted file mode 100755 index 2d78910..0000000 --- a/hypr/cpu.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -head -n 1 ~/.config/dotfiles/hypr/.stat.txt diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 74144de..1803d3c 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -14,33 +14,7 @@ ### MONITORS ### ################ -# See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=DP-3, 2560x1440@59.95100, 0x0, 1 -# monitor=DP-2, 1920x1080@60.00, 2561x0, 1 -monitor=DP-2, disable -monitor=HDMI-A-1, disable - -workspace = 11, monitor:DP-3, default:true -workspace = 12, monitor:DP-3 -workspace = 13, monitor:DP-3 -workspace = 14, monitor:DP-3 -workspace = 15, monitor:DP-3 -workspace = 16, monitor:DP-3 -workspace = 17, monitor:DP-3 -workspace = 18, monitor:DP-3 -workspace = 19, monitor:DP-3 -workspace = 20, monitor:DP-3 - -workspace = 21, monitor:DP-2, default:true -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 -workspace = 30, monitor:DP-2 +source = ~/.config/dotfiles/hypr/monitors.conf ################### @@ -53,7 +27,7 @@ workspace = 30, monitor:DP-2 $terminal = new-terminal $fileManager = dolphin $menu = rofi -show drun -theme ~/.config/rofi/theme.rasi -$hyprscript = ~/.config/dotfiles/hypr/hyprscript.sh +$hyprscript = ~/.config/dotfiles/hypr/hyprscript ################# @@ -255,9 +229,8 @@ bind = $mainMod, Tab, cyclenext bind = $mainMod SHIFT, Q, exec, hyprctl dispatch exit bind = $mainMod CTRL, R, exec, $hyprscript reload -bind = $mainMod, Z, exec, firefox http://jdb.localhost/todo.html https://web.telegram.org https://web.whatsapp.com/ https://discord.com/app https://nuage.polymny.studio/index.php/apps/calendar/ https://mail.infomaniak.com/2 https://mail.infomaniak.com/0 - -bind = $mainMod, E, exec, firefox "ext+container:name=Yuzzit&url=https://yip.atlassian.net/" "ext+container:name=Yuzzit&url=https://app.slack.com/client/T03UFFGJK/D07KS0S1LDT" "ext+container:name=Yuzzit&url=https://app.gather.town/app/bZRkf3gh7MIximOa/ytopenspace" +bind = $mainMod, Z, exec, firefox "http://jdb.localhost/todo.html " "https://web.telegram.org " "https://web.whatsapp.com/ " "https://discord.com/app " "https://nuage.polymny.studio/index.php/apps/calendar/ " "https://mail.infomaniak.com/2 " "https://mail.infomaniak.com/0" +bind = $mainMod, E, exec, firefox "ext+container:name=Yuzzit&url=https://yip.atlassian.net/wiki/spaces/Y/overview" "ext+container:name=Yuzzit&url=https://yip.atlassian.net/" "ext+container:name=Yuzzit&url=https://app.slack.com/client/T03UFFGJK/D07KS0S1LDT" "ext+container:name=Yuzzit&url=https://app.gather.town/app/bZRkf3gh7MIximOa/ytopenspace" bind = $mainMod, C, exec, alacritty -e numbat bind = $mainMod, P, exec, pavucontrol @@ -285,7 +258,7 @@ bind = $mainMod, code:15, exec, $hyprscript workspace 6 bind = $mainMod, code:16, exec, $hyprscript workspace 7 bind = $mainMod, code:17, exec, $hyprscript workspace 8 bind = $mainMod, code:18, exec, $hyprscript workspace 9 -bind = $mainMod, code:19, exec, $hyprscript workspace 10 +bind = $mainMod, code:19, exec, $hyprscript workspace 0 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, code:10, exec, $hyprscript movetoworkspace 1 @@ -297,7 +270,7 @@ bind = $mainMod SHIFT, code:15, exec, $hyprscript movetoworkspace 6 bind = $mainMod SHIFT, code:16, exec, $hyprscript movetoworkspace 7 bind = $mainMod SHIFT, code:17, exec, $hyprscript movetoworkspace 8 bind = $mainMod SHIFT, code:18, exec, $hyprscript movetoworkspace 9 -bind = $mainMod SHIFT, code:19, exec, $hyprscript movetoworkspace 10 +bind = $mainMod SHIFT, code:19, exec, $hyprscript movetoworkspace 0 # Screenshot bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy diff --git a/hypr/hyprscript.sh b/hypr/hyprscript similarity index 75% rename from hypr/hyprscript.sh rename to hypr/hyprscript index 198a842..3f795bb 100755 --- a/hypr/hyprscript.sh +++ b/hypr/hyprscript @@ -31,25 +31,36 @@ get_previous_monitor() { } get_nth_workspace() { - cat /home/thomas/.config/hypr/hyprland.conf \ - | grep "^workspace =" \ - | grep $1 \ - | sed "${2}q;d" \ - | cut -d '=' -f 2 \ - | cut -d ',' -f 1 \ - | tr -d ' ' + current_workspace=$1 + + if [[ "$current_workspace" == *0 ]]; then + current_workspace=$(($current_workspace - 10)) + fi + + workspace=$(echo $current_workspace | cut -c 1)$2 + + if [[ "$workspace" == *0 ]]; then + workspace=$(($workspace + 10)) + fi + + echo $workspace } case "$1" in + "cpustat") + head -n 1 ~/.config/dotfiles/hypr/.stat.txt;; + + "memstat") + tail -n 1 ~/.config/dotfiles/hypr/.stat.txt;; "workspace") - current_monitor=$(get_current_monitor) - workspace=$(get_nth_workspace $current_monitor $2) + current_workspace=$(get_current_workspace) + workspace=$(get_nth_workspace $current_workspace $2) hyprctl dispatch workspace $workspace;; "movetoworkspace") - current_monitor=$(get_current_monitor) - workspace=$(get_nth_workspace $current_monitor $2) + current_workspace=$(get_current_workspace) + workspace=$(get_nth_workspace $current_workspace $2) hyprctl dispatch movetoworkspace $workspace;; "previous") @@ -87,7 +98,6 @@ case "$1" in hyprctl dispatch focusmonitor $next_monitor;; "reload") - systemctl restart waybar --user - hyprctl reload;; + systemctl restart waybar --user;; esac diff --git a/hypr/mem.sh b/hypr/mem.sh deleted file mode 100755 index 37b6ffe..0000000 --- a/hypr/mem.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -tail -n 1 ~/.config/dotfiles/hypr/.stat.txt