.
This commit is contained in:
parent
916ff52966
commit
136aa8bbc7
17 changed files with 227 additions and 191 deletions
|
|
@ -1,54 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# example dkrc to provide a close-to-default setup and
|
||||
# show some basic command usage with error reporting
|
||||
set -e
|
||||
|
||||
# determine where to place the log file
|
||||
logfile="$HOME/.dkrc.log"
|
||||
[ -d "$HOME/.local/share/xorg" ] && logfile="$HOME/.local/share/xorg/dkrc.log"
|
||||
: > "$logfile"
|
||||
|
||||
date > "$logfile"
|
||||
border_width=5
|
||||
border_outer_width=3
|
||||
|
||||
# wallpaper
|
||||
#xsetroot -solid '#101020'
|
||||
xsetroot -solid gray70
|
||||
|
||||
# load sxhkd for keybinds
|
||||
pgrep sxhkd || sxhkd -c "$HOME/.config/dk/sxhkdrc" &
|
||||
pkill bar.sh; bar.sh &
|
||||
|
||||
# adjust border widths based on the DPI of the monitor
|
||||
px=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+x[0-9]\+' | cut -d'x' -f2)
|
||||
mm=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+mm' | tail -n1 | sed 's/mm//')
|
||||
dpi=$(( (px / mm) * 25 ))
|
||||
|
||||
if [ $dpi -ge 140 ]; then
|
||||
border_width=5
|
||||
border_outer_width=3
|
||||
elif [ $dpi -ge 120 ]; then
|
||||
border_width=4
|
||||
border_outer_width=2
|
||||
else
|
||||
border_width=2
|
||||
border_outer_width=1
|
||||
fi
|
||||
|
||||
{ # compound command to redirect all output
|
||||
|
||||
# workspace settings
|
||||
# ------------------------
|
||||
|
||||
# initialize 9 workspaces (1-9) (default: 1/monitor)
|
||||
{
|
||||
# 9 workspaces per monitor
|
||||
dkcmd set numws=9
|
||||
|
||||
# default workspace '_' values used when allocating new workspaces
|
||||
# can be applied to all existing workspaces when passed 'apply' after ws=_
|
||||
dkcmd set ws=_ apply layout=tile master=1 stack=4 gap=0 msplit=0.55 ssplit=0.5
|
||||
for w in $(seq 1 9); do dkcmd set ws=$w layout=tile master=1 stack=4 gap=0 msplit=0.55 ssplit=0.5; done
|
||||
|
||||
# global settings
|
||||
# ---------------------
|
||||
dkcmd set ws=_ apply layout=tile master=1 stack=4 gap=6 msplit=0.55 ssplit=0.5
|
||||
|
||||
# focus windows when receiving activation and enable focus-follows-mouse
|
||||
dkcmd set focus_open=true focus_urgent=true focus_mouse=true
|
||||
|
|
@ -68,25 +34,6 @@ fi
|
|||
# obey motif border hints on windows that draw their own (steam, easyeffects, etc.)
|
||||
dkcmd set obey_motif=true
|
||||
|
||||
|
||||
# borders
|
||||
# ---------
|
||||
|
||||
# traditional
|
||||
# set border width and colour for each window state
|
||||
# dkcmd set border width=$border_width colour focus='#6699cc' unfocus='#000000' urgent='#ee5555'
|
||||
|
||||
# alternative
|
||||
# enable split borders and colours, width is overall width, outer_width consumes some of width.
|
||||
# outer_width must be less than width, outer_width of 0 will be single borders
|
||||
#dkcmd set border width=$border_width outer_width=$border_outer_width \
|
||||
# colour \
|
||||
# focus='#6699cc' \
|
||||
# unfocus='#444444' \
|
||||
# urgent='#ee5555' \
|
||||
# outer_focus='#222222' \
|
||||
# outer_unfocus='#222222' \
|
||||
# outer_urgent='#222222'
|
||||
dkcmd set border width=$border_width outer_width=$border_outer_width \
|
||||
colour \
|
||||
focus='#fd0c0c' \
|
||||
|
|
@ -96,31 +43,10 @@ fi
|
|||
outer_unfocus='#3030ef' \
|
||||
outer_urgent='#222222'
|
||||
|
||||
# window rules
|
||||
# --------------
|
||||
|
||||
# rule class, instance, and title regex are *always* case INSENSITIVE
|
||||
|
||||
dkcmd rule class="^dooble$" ws=2
|
||||
dkcmd rule class="^(dooble|firefox|librewolf)$" ws=2
|
||||
dkcmd rule class="^discord$" ws=6
|
||||
dkcmd rule class="^spotify$" ws=8
|
||||
|
||||
# open window(s) on a monitor by number or name (active workspace on monitor)
|
||||
# dkcmd rule class="^chromium$" mon="HDMI-A-0"
|
||||
|
||||
# open window(s) and use a callback function (user defined in config.h)
|
||||
# we also ignore_cfg=true to stop the window from being resized on it's own from events
|
||||
# eg. mpv --x11-name=albumart /path/to/media
|
||||
# dkcmd rule class="^mpv$" instance="^albumart$" float=true ignore_cfg=true callback=albumart bw=0
|
||||
|
||||
# open window(s) in a floating state
|
||||
dkcmd rule class="^(pavucontrol|transmission-gtk|steam|lxappearance)$" float=true
|
||||
|
||||
# open window(s) with a specific geometry and coordinates (floating only!)
|
||||
# dkcmd rule class="^google-chrome$" title="^open files$" float=true w=1280 h=720
|
||||
|
||||
# open window(s) with ignore_msg=true to avoid focus being grabbed and changing workspace
|
||||
# dkcmd rule class="^TelegramDesktop$" ignore_msg=true
|
||||
dkcmd rule class="^(mpv|nsxiv)$" float=true
|
||||
|
||||
# define some terminals and allow them to be absorbed by spawned windows
|
||||
dkcmd rule class="^(st|lxterminal|st-256color|urxvt|kitty|alacritty|xterm|xterm-256color)$" terminal=true
|
||||
|
|
@ -131,17 +57,9 @@ fi
|
|||
# focus window and workspace on opening
|
||||
# dkcmd rule class="^firefox$" ws=1 focus=true
|
||||
|
||||
# update or remove an existing rule with the same match patterns
|
||||
# dkcmd rule class="^firefox$" mon="HDMI-A-0"
|
||||
# dkcmd rule remove class="^firefox$"
|
||||
|
||||
# apply current rule set to all existing windows (used mainly for WM restart)
|
||||
dkcmd rule apply '*'
|
||||
|
||||
# delete all rules
|
||||
# dkcmd rule remove '*'
|
||||
|
||||
} >> "$logfile" 2>&1 # append responses
|
||||
} >> "$logfile" 2>&1
|
||||
|
||||
# inform of any errors in a notification
|
||||
if grep -q 'error:' "$logfile"; then
|
||||
|
|
@ -150,4 +68,7 @@ if grep -q 'error:' "$logfile"; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
env | while read -r pair; do
|
||||
turnstile-update-runit-env "$(cut -d= -f1 <<< "$pair")"
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue