Update hypr

This commit is contained in:
Thomas Forgione 2025-04-09 21:11:14 +02:00
parent 125d671421
commit 85b5e29021
5 changed files with 69 additions and 17 deletions

View File

@ -53,7 +53,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/workspace.sh $hyprscript = ~/.config/dotfiles/hypr/hyprscript.sh
################# #################
@ -65,7 +65,6 @@ $hyprscript = ~/.config/dotfiles/hypr/workspace.sh
# exec-once = $terminal # exec-once = $terminal
exec-once = ~/.config/dotfiles/hypr/stat.py & exec-once = ~/.config/dotfiles/hypr/stat.py &
exec-once = waybar &
exec-once = hyprpaper & exec-once = hyprpaper &
exec-once = nm-applet & exec-once = nm-applet &
exec-once = flameshot & exec-once = flameshot &
@ -73,7 +72,7 @@ exec-once = blueberry-tray &
exec-once = nextcloud --background & exec-once = nextcloud --background &
exec-once = systemctl start stream-deck --user & exec-once = systemctl start stream-deck --user &
exec-once = systemctl start mars --user & exec-once = systemctl start mars --user &
exec-once = systemctl start waybar --user &
############################# #############################
### ENVIRONMENT VARIABLES ### ### ENVIRONMENT VARIABLES ###
@ -247,14 +246,14 @@ bind = $mainMod, A, exec, firefox
bind = $mainMod SHIFT, C, killactive, bind = $mainMod SHIFT, C, killactive,
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu bind = $mainMod, R, exec, $menu
bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, H, exec, $hyprscript focusnextmonitor
bind = $mainMod, J, exec, $hyprscript focusnextmonitor
bind = $mainMod SHIFT, Right, movewindow,mon:r bind = $mainMod, O, exec, $hyprscript movewindow
bind = $mainMod SHIFT, Left, movewindow,mon:l
bind = $mainMod, Tab, cyclenext 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, hyprctl 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
@ -264,6 +263,9 @@ bind = $mainMod, C, exec, alacritty -e numbat
bind = $mainMod, P, exec, pavucontrol bind = $mainMod, P, exec, pavucontrol
bind = $mainMod, B, exec, blueberry bind = $mainMod, B, exec, blueberry
bind = $mainMod SHIFT, M, exec, sleep 0.5s && wtype "thomas@forgione.fr"
bind = $mainMod SHIFT, code:48, exec, sleep 0.5s && wtype "thomas@polymny.studio"
# Move focus with mainMod + arrow keys # Move focus with mainMod + arrow keys
# bind = $mainMod, left, movefocus, l # bind = $mainMod, left, movefocus, l
# bind = $mainMod, right, movefocus, r # bind = $mainMod, right, movefocus, r

View File

@ -8,6 +8,28 @@ get_current_monitor() {
hyprctl activeworkspace | head -n 1 | rev | cut -d ' ' -f 1 | rev | tr -d ':' hyprctl activeworkspace | head -n 1 | rev | cut -d ' ' -f 1 | rev | tr -d ':'
} }
get_next_monitor() {
current_monitor=$(get_current_monitor)
next_monitor=$(hyprctl monitors | grep Monitor | grep " $current_monitor " -A 2 | sed '2q;d' | cut -d ' ' -f 2)
if [ -z $next_monitor ]; then
next_monitor=$(hyprctl monitors | grep Monitor | head -n 1 | cut -d ' ' -f 2)
fi
echo $next_monitor
}
get_previous_monitor() {
current_monitor=$(get_current_monitor)
previous_monitor=$(hyprctl monitors | grep Monitor | grep " $current_monitor " -B 2 | sed '2q;d' | cut -d ' ' -f 2)
if [ -z $previous_monitor ]; then
previous_monitor=$(hyprctl monitors | grep Monitor | tail -n 1 | cut -d ' ' -f 2)
fi
echo $previous_monitor
}
get_nth_workspace() { get_nth_workspace() {
cat /home/thomas/.config/hypr/hyprland.conf \ cat /home/thomas/.config/hypr/hyprland.conf \
| grep "^workspace =" \ | grep "^workspace =" \
@ -19,6 +41,7 @@ get_nth_workspace() {
} }
case "$1" in case "$1" in
"workspace") "workspace")
current_monitor=$(get_current_monitor) current_monitor=$(get_current_monitor)
workspace=$(get_nth_workspace $current_monitor $2) workspace=$(get_nth_workspace $current_monitor $2)
@ -50,4 +73,21 @@ case "$1" in
fi fi
hyprctl dispatch workspace $next_workspace;; hyprctl dispatch workspace $next_workspace;;
"movewindow")
next_monitor=$(get_next_monitor)
hyprctl dispatch movewindow mon:$next_monitor;;
"focuspreviousmonitor")
previous_monitor=$(get_previous_monitor)
hyprctl dispatch focusmonitor $previous_monitor;;
"focusnextmonitor")
next_monitor=$(get_next_monitor)
hyprctl dispatch focusmonitor $next_monitor;;
"reload")
systemctl restart waybar --user
hyprctl reload;;
esac esac

View File

@ -6,7 +6,7 @@ import psutil
os.chdir(os.path.expanduser('~/.config/dotfiles/hypr')) os.chdir(os.path.expanduser('~/.config/dotfiles/hypr'))
bars = "_▂▃▄▅▆▇███" bars = "_▂▃▄▅▆▇█"
cpu_values = [0] * 10 cpu_values = [0] * 10
mem_values = [0] * 10 mem_values = [0] * 10
@ -26,6 +26,6 @@ while True:
with open('.stat.txt', 'w') as f: with open('.stat.txt', 'w') as f:
f.write( f.write(
'' + ''.join([to_bar(x) for x in cpu_values]) + '\n' + '' + ''.join([to_bar(x) for x in cpu_values]) + ' ' + "% 5.1f"%cpu_percent + '%\n' +
'' + ''.join([to_bar(x) for x in mem_values]) '' + ''.join([to_bar(x) for x in mem_values]) + ' ' + "% 5.1f"%mem_percent + '%'
) )

View File

@ -17,10 +17,10 @@
], ],
"modules-right": [ "modules-right": [
"hyprland/workspaces", "hyprland/workspaces",
"tray",
"custom/cpu", "custom/cpu",
"custom/mem", "custom/mem",
"battery", "battery",
"tray",
"clock", "clock",
], ],
"hyprland/window": { "hyprland/window": {

View File

@ -33,7 +33,6 @@ button {
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover { button:hover {
background: inherit; background: inherit;
box-shadow: inset 0 -3px #ffffff;
} }
#workspaces { #workspaces {
@ -44,19 +43,30 @@ button:hover {
#workspaces button { #workspaces button {
padding: 0px 0px; padding: 0px 0px;
background-color: transparent; background-color: white;
color: #ffffff; color: #000000;
border-radius: 50px;
border-color: transparent;
border: 1px solid;
border-color: transparent;
} }
#workspaces button.empty { #workspaces button.empty {
color: #777777; color: white;
background-color: transparent;
} }
#workspaces button.active { #workspaces button.active {
color: #ffffff; color: black;
font-weight: bold; font-weight: bold;
background-color: @green; background-color: @green;
border-radius: 50px; }
#workspaces button.active.empty {
font-weight: bold;
background-color: transparent;
border-color: @green;
color: @green;
} }
#workspaces button:hover { #workspaces button:hover {