Krolyxon
Commit b8c1f0f

Branches

Refs →

dotfiles-x11b8c1f0f

hyprland: use kanshi for auto-management of monitors

Author
krolxon
Date
2025-08-04 09:43 +0530
Parent
3718ac5
Commit
b8c1f0f4ebc5deb25fdc9849624261b896c3323e

+59 −151

8 files changed

  1. A .config/hypr/hypridle.conf +11 −0
  2. M .config/hypr/hyprland.conf +25 −50
  3. A .config/kanshi/config +22 −0
  4. M .config/shell/profile +1 −1
  5. D .config/wal/templates/dunstrc +0 −60
  6. D .local/bin/setwall +0 −5
  7. D .local/bin/sysact +0 −26
  8. D .local/bin/wrdm +0 −9
A .config/hypr/hypridle.conf View
@@ -0,0 +1,11 @@
1+general {
2+ lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
3+ before_sleep_cmd = loginctl lock-session # lock before suspend.
4+ after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
5+}
6+
7+listener {
8+ timeout = 330 # 5.5min
9+ on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
10+ on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
11+}
M .config/hypr/hyprland.conf View
@@ -1,35 +1,11 @@
11 autogenerated = 0
22
3−env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/
4−
5−
6−plugin {
7− split-monitor-workspaces {
8− count = 10
9− keep_focused = 1
10− enable_notifications = 0
11− enable_persistent_workspaces = 1
12− }
13−}
14−
15−# This is an example Hyprland config file.
16−# Refer to the wiki for more information.
17−# https://wiki.hypr.land/Configuring/
18−
19−# Please note not all available settings / options are set here.
20−# For a full list, see the wiki
21−
22−# You can split this configuration into multiple files
23−# Create your files separately and then link them to this file like this:
24−source = ~/.config/hypr/monitors.conf
3+# source = ~/.config/hypr/monitors.conf
254
265
276 ###################
287 ### MY PROGRAMS ###
298 ###################
30−# See https://wiki.hypr.land/Configuring/Keywords/
31−
32−# Set programs that you use
339 $terminal = alacritty
3410 $fileManager = pcmanfm
3511 # $menu = rofi -show drun
@@ -40,12 +16,10 @@ $browser = brave
4016 #################
4117 ### AUTOSTART ###
4218 #################
43−
44−# Autostart necessary processes (like notifications daemons, status bars, etc.)
45−# Or execute your favorite apps at launch like this:
46−
4719 exec-once = hyprpm reload -n
20+exec-once = kanshi
4821 exec-once = waybar & hyprpaper & swaync & hyprsunset
22+exec-once = hypridle
4923 exec-once = systemctl --user start hyprpolkitagent
5024
5125 plugin {
@@ -58,37 +32,40 @@ plugin {
5832 #############################
5933 ### ENVIRONMENT VARIABLES ###
6034 #############################
61−
6235 # See https://wiki.hypr.land/Configuring/Environment-variables/
63−
36+env = HYPRSHOT_DIR,/home/krolyxon/pix/ss/
6437 env = XCURSOR_SIZE,24
6538 env = HYPRCURSOR_SIZE,24
6639
40+#######################
41+### PLUGIN SETTINGS ###
42+#######################
43+plugin {
44+ split-monitor-workspaces {
45+ count = 10
46+ keep_focused = 1
47+ enable_notifications = 0
48+ enable_persistent_workspaces = 1
49+ }
50+}
51+
52+
6753
6854 ###################
6955 ### PERMISSIONS ###
7056 ###################
57+ecosystem {
58+ enforce_permissions = 1
59+}
7160
72−# See https://wiki.hypr.land/Configuring/Permissions/
73−# Please note permission changes here require a Hyprland restart and are not applied on-the-fly
74−# for security reasons
75−
76−# ecosystem {
77−# enforce_permissions = 1
78−# }
79−
80−# permission = /usr/(bin|local/bin)/grim, screencopy, allow
81−# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
82−# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
61+permission = /usr/(bin|local/bin)/grim, screencopy, allow
62+permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
63+permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
8364
8465
8566 #####################
8667 ### LOOK AND FEEL ###
8768 #####################
88−
89−# Refer to https://wiki.hypr.land/Configuring/Variables/
90−
91−# https://wiki.hypr.land/Configuring/Variables/#general
9269 general {
9370 gaps_in = 10
9471 gaps_out = 10
@@ -100,7 +77,6 @@ general {
10077 layout = master
10178 }
10279
103−# https://wiki.hypr.land/Configuring/Variables/#decoration
10480 decoration {
10581 rounding = 0
10682
@@ -115,7 +91,6 @@ decoration {
11591 # shadow_render_power = 3
11692 # col.shadow = rgba(1a1a1aee)
11793 }
118−# https://wiki.hypr.land/Configuring/Variables/#animations
11994
12095 animations {
12196 enabled = yes
@@ -147,7 +122,7 @@ dwindle {
147122 # See https://wiki.hypr.land/Configuring/Master-Layout/ for more
148123 master {
149124 new_status = master
150− # new_on_top = true
125+ new_on_top = true
151126
152127 }
153128
@@ -211,7 +186,7 @@ bind = $mainMod SHIFT, R, togglefloating,
211186 bind = $mainMod, R, exec, $menu
212187 bind = $mainMod SHIFT, P, pseudo, # dwindle
213188 bind = $mainMod, J, togglesplit, # dwindle
214−bind = $mainMod, tab, cyclenext
189+bind = $mainMod, tab, cyclenext, prev
215190 bind = $mainMod, b, exec, killall waybar || waybar
216191
217192 # Applications
A .config/kanshi/config View
@@ -0,0 +1,22 @@
1+profile laptop-only {
2+ output eDP-1 {
3+ enable
4+ mode 1920x1080
5+ scale 1
6+ position 0,0
7+ }
8+}
9+
10+profile docked {
11+ output eDP-1 {
12+ mode 1920x1080
13+ scale 1
14+ position 0,0
15+ }
16+
17+ output HDMI-A-1 {
18+ mode 1920x1080
19+ scale 1
20+ position 1920,0
21+ }
22+}
M .config/shell/profile View
@@ -56,4 +56,4 @@ export MPD_PORT="6600"
5656 [ ! -s ~/.config/mpd/pid ] && mpd
5757
5858 # Start graphical server on user's current tty if not already running.
59−[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
59+[ "$(tty)" = "/dev/tty1" ] && ! pidof -s hyprland >/dev/null 2>&1 && exec hyprland
D .config/wal/templates/dunstrc View
@@ -1,60 +0,0 @@
1−# New Start: A modern Arch workflow built with an emphasis on functionality.
2−# Copyright (C) 2018 Donovan Glover
3−
4−# NOTE: This file is automatically generated by pywal. Do not edit it by hand.
5−
6−[global]
7− # Make the width 3740 (3840 - 100), have 50 left margin and 95 above
8− # geometry = "3740x5-50+95"
9− offset = 3x20
10−
11− # Show multiple notifications in the same box
12− separator_height = 0
13−
14− # Add vertical padding to the inside of the notification
15− padding = 8
16−
17− # Add horizontal padding for when the text gets long enough
18− horizontal_padding = 8
19−
20− # The frame color and width of the notification
21− frame_color = "{color6}"
22− frame_width = 2
23−
24− # How long a user needs to be idle for sticky notifications
25− idle_threshold = 120
26−
27− # Font and typography settings
28− font = JetBrainsMono Nerd Font 10
29− alignment = left
30− word_wrap = yes
31−
32− # Format for how notifications will be displayed
33− # Usage: `notify-send 'Title' 'Summary'`
34− format = "<b>%s</b>\n%b"
35−
36− # Allow some HTML tags like <i> and <u> in notifications
37− markup = full
38− max_icon_size = 120
39− transparency = 5
40−
41−# These are the keybindings used to control dunst notifications
42−[shortcuts]
43− close = ctrl+space
44− close_all = ctrl+shift+space
45− history = ctrl+grave
46−
47−# Set the background and foreground (text) color for all notifications
48−[urgency_low]
49− background = "{background}"
50− foreground = "{foreground}"
51−
52−[urgency_normal]
53− background = "{background}"
54− foreground = "{foreground}"
55−
56−[urgency_critical]
57− background = "{background}"
58− foreground = "{foreground}"
59−
60−# vim:ft=cfg
D .local/bin/setwall View
@@ -1,5 +0,0 @@
1−#!/bin/sh
2−xwallpaper --zoom ~/.local/share/bg.jpg
3−wal -c
4−wal -i ~/.local/share/bg.jpg
5−xdotool key super+F5
D .local/bin/sysact View
@@ -1,26 +0,0 @@
1−#!/bin/sh
2−
3−export WM="dwm"
4−case "$(readlink -f /sbin/init)" in
5− *systemd*) ctl='systemctl' ;;
6− *) ctl='loginctl' ;;
7−esac
8−
9−wmpid(){ # This function is needed if there are multiple instances of the window manager.
10− tree="$(pstree -ps $$)"
11− tree="${tree#*$WM(}"
12− echo "${tree%%)*}"
13−}
14−
15−
16−case "$(printf " lock\n󰠚 leave $WM\n renew $WM\n󱣻 hibernate\n reboot\n shutdown\n sleep\n display off" | dmenu -i -l 15 -p 'Action: ')" in
17− ' lock') slock ;;
18− "󰠚 leave $WM") kill -TERM "$(wmpid)" ;;
19− " renew $WM") kill -HUP "$(wmpid)" ;;
20− '󱣻 hibernate') slock $ctl hibernate -i ;;
21− ' sleep') slock $ctl suspend -i ;;
22− ' reboot') $ctl reboot -i ;;
23− ' shutdown') $ctl poweroff -i ;;
24− ' display off') xset dpms force off ;;
25− *) exit 1 ;;
26−esac
D .local/bin/wrdm View
@@ -1,9 +0,0 @@
1−#!/bin/env bash
2−
3−# word=$(dmenu -p "Enter Word: " <&-)
4−word=$(cat ~/.local/bin/words.txt | dmenu -l 25 -p "Choose Word: ")
5−#$BROWSER https://www.merriam-webster.com/dictionary/$word
6−if [[ -n $word ]]; then
7− $BROWSER "https://www.google.com/search?hl=en&q=define+$word"
8−fi
9−