update eww on monitor update

This commit is contained in:
2024-07-08 22:41:07 +03:00
parent 22c70c087b
commit 94aa4f1492
7 changed files with 76 additions and 19 deletions
+1 -1
View File
@@ -90,7 +90,7 @@
(audio-source-selector)
(eventbox :cursor "pointer"
(button :class "interactive btn" :halign "start" :onclick "pavucontrol &" "󰴸 Open PulseAudio control")
(button :class "interactive btn" :halign "start" :onclick "eww open --toggle media-menu & pavucontrol &" "󰴸 Open PulseAudio control")
)
; TODO: For some reason audio-info is null if I don't invoke it outside the for. Investigate.x
+2 -2
View File
@@ -1,8 +1,8 @@
(include "./bar/bar.yuck")
; a hacky solution for moving the windows on my second monitor a bit up so I can see them :D
(defwindow monitor-bump
:monitor 1
(defwindow monitor-bump [monitor]
:monitor monitor
:geometry (geometry :x "0" :y "0" :width "100%" :height "120" :anchor "bottom center")
:exclusive true
:windowtype "dock"
+3 -3
View File
@@ -2,12 +2,12 @@
### AUTOSTART ###
#################
exec-once = eww open bar --id bar1 --arg monitor=0 --arg monitor-workspaces="[1,2]"
exec-once = eww open bar --id bar2 --arg monitor=1 --arg monitor-workspaces="[3,4]"
exec-once = eww open --toggle monitor-bump
exec-once = eww d
exec-once = ~/.config/hypr/scripts/run-eww.sh
exec-once = swww-daemon --format xrgb &
exec-once = swaync &
exec-once = hypridle &
exec-once = blueman-applet & blueman-tray & nm-applet &
+9 -8
View File
@@ -9,10 +9,11 @@ $fileManager = nautilus
$menu = rofi -show combi -combi-modes "window,run,ssh" -modes combi
$emojiMenu = rofi -modi emoji -show emoji
bind = $mainMod, R, exec, ~/.config/hypr/scripts/run-eww.sh
bind = $mainMod, E, exec, $fileManager # E - file manager
bind = $mainMod, F, fullscreen # F - fullscreen
bind = $mainMod, J, togglesplit, # J - toggle split
bind = $mainMod, L, exec, hyprlock # L - lock screen
bind = $mainMod, D, togglesplit, # D - toggle split
bind = $mainMod, M, exit # M - exit
bind = $mainMod, Q, killactive # Q - kill active window
bind = alt, Q, killactive # alt + Q - kill active window
@@ -20,7 +21,7 @@ bind = $mainMod, S, swapactiveworkspaces, 0 1 # S - swap monitor work
bind = $mainMod, T, exec, $terminal # T - terminal
bind = $mainMod, V, togglefloating # V - toggle floatin
bind = Control_R, O, exec, nautilus
bind = $mainMod shift, L, exec, hyprlock # super + {shift + L - lock screen
bind = $mainMod, F1, exec, ~/.config/hypr/scripts/game-mode.sh # F1 - game mode
bind = $mainMod, F2, exec, eww open --toggle monitor-bump # F2 - monitor bump
@@ -59,11 +60,11 @@ bind = ctrl alt shift, 4, exec, ~/.config/hypr/scripts/screenshots/copy-area.sh
### Window Management
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Move focus with mainMod + hjkl
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d
# move to prev / next monitor
bind = ctrl alt super, left, movewindow, mon:+1
+8 -5
View File
@@ -7,15 +7,18 @@
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = QT_QPA_PLATFORM,wayland;xcb
env = GDK_BACKEND,wayland,x11
env = GDK_SCALE, 1
env = LIBVA_DRIVER_NAME,nvidia
env = QT_AUTO_SCREEN_SCALE_FACTOR, 1
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_QPA_PLATFORMTHEME,qt5ct
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
exec = gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
exec = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' # for GTK4 apps
+16
View File
@@ -0,0 +1,16 @@
# See: https://github.com/jacobrreed/dotfiles/blob/master/.config/hypr/hypridle.conf
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
unlock_cmd = notify-send "unlock!" # same as above, but unlock
# ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
# ignore_systemd_inhibit = false # whether to ignore systemd-inhibit --what=idle inhibitors
}
listener {
timeout = 300 # 5 min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env sh
function reload_eww() {
monitor_count=$(hyprctl monitors -j | jq length)
monitor_names_str=$(hyprctl monitors -j | jq -r '.[].name')
monitor_names=(${monitor_names_str// / })
eww close-all
sleep 1
if [[ $monitor_count == 2 ]]; then
if [[ ${monitor_names[0]} == "DP-1" ]]; then
eww open bar --id bar1 --arg monitor=0 --arg monitor-workspaces="[1,2]"
eww open bar --id bar2 --arg monitor=1 --arg monitor-workspaces="[3,4]"
eww open monitor-bump --arg monitor=1
elif [[ ${monitor_names[0]} == "DP-2" ]]; then
eww open bar --id bar2 --arg monitor=0 --arg monitor-workspaces="[3,4]"
eww open bar --id bar1 --arg monitor=1 --arg monitor-workspaces="[1,2]"
eww open monitor-bump --arg monitor=0
fi
elif [[ ${monitor_names[0]} == "DP-1" ]]; then
eww open bar --id bar1 --arg monitor=0 --arg monitor-workspaces="[1,2,3,4]"
elif [[ ${monitor_names[0]} == "DP-2" ]]; then
eww open bar --id bar1 --arg monitor=0 --arg monitor-workspaces="[1,2,3,4]"
eww open monitor-bump --arg monitor=0
fi
}
reload_eww
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
if [[ $line =~ "monitorremoved" || $line =~ "monitoradded" ]]; then
reload_eww
fi
done