From b80abd7b58c735c7cac4287ec1d8d10a9236e9f5 Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Fri, 3 Jul 2020 13:20:54 -0500 Subject: [PATCH] Adding kdpi configs --- .config/sway/kdpi/20-bar.conf | 11 +++++ .config/sway/kdpi/30-input.conf | 9 ++++ .config/sway/kdpi/40-output.conf | 11 +++++ .config/sway/kdpi/99-tmux_session.conf | 6 +++ .config/sway/kdpi/genbg.bash | 27 +++++++++++ .config/sway/kdpi/genbg.gp | 63 ++++++++++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 .config/sway/kdpi/20-bar.conf create mode 100644 .config/sway/kdpi/30-input.conf create mode 100644 .config/sway/kdpi/40-output.conf create mode 100644 .config/sway/kdpi/99-tmux_session.conf create mode 100755 .config/sway/kdpi/genbg.bash create mode 100755 .config/sway/kdpi/genbg.gp diff --git a/.config/sway/kdpi/20-bar.conf b/.config/sway/kdpi/20-bar.conf new file mode 100644 index 0000000..ee55442 --- /dev/null +++ b/.config/sway/kdpi/20-bar.conf @@ -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" +#} diff --git a/.config/sway/kdpi/30-input.conf b/.config/sway/kdpi/30-input.conf new file mode 100644 index 0000000..06d94a7 --- /dev/null +++ b/.config/sway/kdpi/30-input.conf @@ -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 diff --git a/.config/sway/kdpi/40-output.conf b/.config/sway/kdpi/40-output.conf new file mode 100644 index 0000000..506b546 --- /dev/null +++ b/.config/sway/kdpi/40-output.conf @@ -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 diff --git a/.config/sway/kdpi/99-tmux_session.conf b/.config/sway/kdpi/99-tmux_session.conf new file mode 100644 index 0000000..5572a8f --- /dev/null +++ b/.config/sway/kdpi/99-tmux_session.conf @@ -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 diff --git a/.config/sway/kdpi/genbg.bash b/.config/sway/kdpi/genbg.bash new file mode 100755 index 0000000..0c9072a --- /dev/null +++ b/.config/sway/kdpi/genbg.bash @@ -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" diff --git a/.config/sway/kdpi/genbg.gp b/.config/sway/kdpi/genbg.gp new file mode 100755 index 0000000..ceb0949 --- /dev/null +++ b/.config/sway/kdpi/genbg.gp @@ -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