From b8c1f0f4ebc5deb25fdc9849624261b896c3323e Mon Sep 17 00:00:00 2001 From: krolxon Date: Mon, 4 Aug 2025 09:43:03 +0530 Subject: hyprland: use kanshi for auto-management of monitors --- .config/hypr/hypridle.conf | 11 +++++++ .config/hypr/hyprland.conf | 75 ++++++++++++++++------------------------------ 2 files changed, 36 insertions(+), 50 deletions(-) create mode 100644 .config/hypr/hypridle.conf (limited to '.config/hypr') diff --git a/.config/hypr/hypridle.conf b/.config/hypr/hypridle.conf new file mode 100644 index 0000000..a2f5f1e --- /dev/null +++ b/.config/hypr/hypridle.conf @@ -0,0 +1,11 @@ +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. +} + +listener { + timeout = 330 # 5.5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. +} diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index cd2cd82..ef7f7c3 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,35 +1,11 @@ autogenerated = 0 -env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/ - - -plugin { - split-monitor-workspaces { - count = 10 - keep_focused = 1 - enable_notifications = 0 - enable_persistent_workspaces = 1 - } -} - -# This is an example Hyprland config file. -# Refer to the wiki for more information. -# https://wiki.hypr.land/Configuring/ - -# Please note not all available settings / options are set here. -# For a full list, see the wiki - -# You can split this configuration into multiple files -# Create your files separately and then link them to this file like this: -source = ~/.config/hypr/monitors.conf +# source = ~/.config/hypr/monitors.conf ################### ### MY PROGRAMS ### ################### -# See https://wiki.hypr.land/Configuring/Keywords/ - -# Set programs that you use $terminal = alacritty $fileManager = pcmanfm # $menu = rofi -show drun @@ -40,12 +16,10 @@ $browser = brave ################# ### AUTOSTART ### ################# - -# Autostart necessary processes (like notifications daemons, status bars, etc.) -# Or execute your favorite apps at launch like this: - exec-once = hyprpm reload -n +exec-once = kanshi exec-once = waybar & hyprpaper & swaync & hyprsunset +exec-once = hypridle exec-once = systemctl --user start hyprpolkitagent plugin { @@ -58,37 +32,40 @@ plugin { ############################# ### ENVIRONMENT VARIABLES ### ############################# - # See https://wiki.hypr.land/Configuring/Environment-variables/ - +env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 +####################### +### PLUGIN SETTINGS ### +####################### +plugin { + split-monitor-workspaces { + count = 10 + keep_focused = 1 + enable_notifications = 0 + enable_persistent_workspaces = 1 + } +} + + ################### ### PERMISSIONS ### ################### +ecosystem { + enforce_permissions = 1 +} -# See https://wiki.hypr.land/Configuring/Permissions/ -# Please note permission changes here require a Hyprland restart and are not applied on-the-fly -# for security reasons - -# ecosystem { -# enforce_permissions = 1 -# } - -# permission = /usr/(bin|local/bin)/grim, screencopy, allow -# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow -# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow +permission = /usr/(bin|local/bin)/grim, screencopy, allow +permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow +permission = /usr/(bin|local/bin)/hyprpm, plugin, allow ##################### ### LOOK AND FEEL ### ##################### - -# Refer to https://wiki.hypr.land/Configuring/Variables/ - -# https://wiki.hypr.land/Configuring/Variables/#general general { gaps_in = 10 gaps_out = 10 @@ -100,7 +77,6 @@ general { layout = master } -# https://wiki.hypr.land/Configuring/Variables/#decoration decoration { rounding = 0 @@ -115,7 +91,6 @@ decoration { # shadow_render_power = 3 # col.shadow = rgba(1a1a1aee) } -# https://wiki.hypr.land/Configuring/Variables/#animations animations { enabled = yes @@ -147,7 +122,7 @@ dwindle { # See https://wiki.hypr.land/Configuring/Master-Layout/ for more master { new_status = master - # new_on_top = true + new_on_top = true } @@ -211,7 +186,7 @@ bind = $mainMod SHIFT, R, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod SHIFT, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle -bind = $mainMod, tab, cyclenext +bind = $mainMod, tab, cyclenext, prev bind = $mainMod, b, exec, killall waybar || waybar # Applications -- cgit v1.2.3