Adding kdpi configs

This commit is contained in:
David Thurstenson 2020-07-03 13:20:54 -05:00
parent c444fd5c46
commit b80abd7b58
6 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# Sway config: Bar
#
# Reference: `man 5 sway-bar`
#bar {
#id dispinfo
#mode overlay
#height 200
#gaps 100
#swaybar_command waybar
#status_command "/home/thurstylark/.config/waybar/dispinfo.bash -r"
#}

View File

@ -0,0 +1,9 @@
# Sway Config: Input Config
#
# Thurstylark
# Cursor hide delay (in ms)
set $cursor-delay "100"
# Hide cursor after delay
seat * hide_cursor $cursor-delay

View File

@ -0,0 +1,11 @@
# Sway config: Output
#
# Thurstylark
# Sane default of 1080p60
#output * mode 1920x1080@60Hz
exec_always ~/.config/sway/$hostname/genbg.bash
# Switch to the Media workspace
workspace $ws-media

View File

@ -0,0 +1,6 @@
# Sway Config: tmux session
#
# Thurstylark
# Start tmux session from sway to allow easy access to its term env
exec tmux new-session -d -s swayenv

27
.config/sway/kdpi/genbg.bash Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/bash -x
# Check that SWAYSOCK is in the env before doing anything
[ -z "$SWAYSOCK" ] && echo '$SWAYSOCK Not set in env. Exiting.'; exit 1
# Path to genbg.gp
genbg="/home/thurstylark/.config/sway/$(uname -n)/genbg.gp"
# Scale mode and fallback color (See: man sway-output)
scalemode="center"
color='#0000FF'
# Retrieve dimensions of currently connected display
outw=$(swaymsg -r -t get_outputs | jq -r '.[0].current_mode.width')
outh=$(swaymsg -r -t get_outputs | jq -r '.[0].current_mode.height')
# Set up a tempfile for the background location
bgstash="$(mktemp tl-sway-bg.XXXX)"
# Clean up any old files
rm ${tempfile%.*}.*
# Generate the file in question
gnuplot -c "$genbg" "$outw" "$outh" > "$bgstash"
# Set the background
swaymsg "output * bg $bgstash $scalemode $color"

63
.config/sway/kdpi/genbg.gp Executable file
View File

@ -0,0 +1,63 @@
#!/usr/bin/gnuplot -c
w = ARG1
h = ARG2
set term png size w,h nocrop
#set term qt persist
set bmargin 0
set lmargin 0
set rmargin 0
set tmargin 0
unset border
unset tics
unset key
set parametric
set xrange [0:w]
set yrange [0:h]
a = 50
set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'black' fillstyle solid noborder
set style arrow 1 nohead lt rgb "white"
# X Axis
set arrow from w/2,0 to w/2,h arrowstyle 1
# Y Axis
set arrow from 0,h/2 to w,h/2 arrowstyle 1
# Left box side
set arrow from 0,0 to 0,h arrowstyle 1
# Right box side
set arrow from w-1,0 to w-1,h arrowstyle 1
# Top box side
set arrow from 0,h to w,h arrowstyle 1
# Bottom box side
set arrow from 0,0 to w,0 arrowstyle 1
# Diagonal bottom left to top right
set arrow from 0,0 to w,h arrowstyle 1
# Diagonal top left to bottom right
set arrow from 0,h to w,0 arrowstyle 1
# Horizontal 25% line top
set arrow from 0,0.75*h to w,0.75*h arrowstyle 1
# Horizontal 25% line bottom
set arrow from 0,0.25*h to w,0.25*h arrowstyle 1
# Vertical 25% line left
set arrow from 0.25*w,0 to 0.25*w,h arrowstyle 1
# Vertical 25% line right
set arrow from 0.75*w,0 to 0.75*w,h arrowstyle 1
# Circle around midpoint
set obj 10 circle at 0.5*w,0.5*h size 0.20*h fc rgb "white"
# Square around midpoint
set obj 20 rectangle at 0.5*w,0.5*h size 0.40*h,0.40*h fs empty border lc rgb "white" front
plot 0,0