This commit is contained in:
Thomas Forgione 2025-04-13 21:05:41 +02:00
parent 85b5e29021
commit 7041c2abd8
5 changed files with 30 additions and 50 deletions

1
hypr/.gitignore vendored
View File

@ -1 +1,2 @@
.stat.txt .stat.txt
monitors.conf

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
head -n 1 ~/.config/dotfiles/hypr/.stat.txt

View File

@ -14,33 +14,7 @@
### MONITORS ### ### MONITORS ###
################ ################
# See https://wiki.hyprland.org/Configuring/Monitors/ source = ~/.config/dotfiles/hypr/monitors.conf
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
################### ###################
@ -53,7 +27,7 @@ workspace = 30, monitor:DP-2
$terminal = new-terminal $terminal = new-terminal
$fileManager = dolphin $fileManager = dolphin
$menu = rofi -show drun -theme ~/.config/rofi/theme.rasi $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 SHIFT, Q, exec, hyprctl dispatch exit
bind = $mainMod CTRL, R, exec, $hyprscript reload 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, 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, 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, C, exec, alacritty -e numbat bind = $mainMod, C, exec, alacritty -e numbat
bind = $mainMod, P, exec, pavucontrol 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:16, exec, $hyprscript workspace 7
bind = $mainMod, code:17, exec, $hyprscript workspace 8 bind = $mainMod, code:17, exec, $hyprscript workspace 8
bind = $mainMod, code:18, exec, $hyprscript workspace 9 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] # Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, code:10, exec, $hyprscript movetoworkspace 1 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:16, exec, $hyprscript movetoworkspace 7
bind = $mainMod SHIFT, code:17, exec, $hyprscript movetoworkspace 8 bind = $mainMod SHIFT, code:17, exec, $hyprscript movetoworkspace 8
bind = $mainMod SHIFT, code:18, exec, $hyprscript movetoworkspace 9 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 # Screenshot
bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy

View File

@ -31,25 +31,36 @@ get_previous_monitor() {
} }
get_nth_workspace() { get_nth_workspace() {
cat /home/thomas/.config/hypr/hyprland.conf \ current_workspace=$1
| grep "^workspace =" \
| grep $1 \ if [[ "$current_workspace" == *0 ]]; then
| sed "${2}q;d" \ current_workspace=$(($current_workspace - 10))
| cut -d '=' -f 2 \ fi
| cut -d ',' -f 1 \
| tr -d ' ' workspace=$(echo $current_workspace | cut -c 1)$2
if [[ "$workspace" == *0 ]]; then
workspace=$(($workspace + 10))
fi
echo $workspace
} }
case "$1" in case "$1" in
"cpustat")
head -n 1 ~/.config/dotfiles/hypr/.stat.txt;;
"memstat")
tail -n 1 ~/.config/dotfiles/hypr/.stat.txt;;
"workspace") "workspace")
current_monitor=$(get_current_monitor) current_workspace=$(get_current_workspace)
workspace=$(get_nth_workspace $current_monitor $2) workspace=$(get_nth_workspace $current_workspace $2)
hyprctl dispatch workspace $workspace;; hyprctl dispatch workspace $workspace;;
"movetoworkspace") "movetoworkspace")
current_monitor=$(get_current_monitor) current_workspace=$(get_current_workspace)
workspace=$(get_nth_workspace $current_monitor $2) workspace=$(get_nth_workspace $current_workspace $2)
hyprctl dispatch movetoworkspace $workspace;; hyprctl dispatch movetoworkspace $workspace;;
"previous") "previous")
@ -87,7 +98,6 @@ case "$1" in
hyprctl dispatch focusmonitor $next_monitor;; hyprctl dispatch focusmonitor $next_monitor;;
"reload") "reload")
systemctl restart waybar --user systemctl restart waybar --user;;
hyprctl reload;;
esac esac

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
tail -n 1 ~/.config/dotfiles/hypr/.stat.txt