this post was submitted on 16 Aug 2023
3 points (80.0% liked)

swaywm

344 readers
1 users here now

dedicated to the Sway window manager, a drop-in replacement for the i3 window manager, but for Wayland instead of X11.

founded 4 years ago
MODERATORS
 

I wrote a script and bound it to a key combo so I can draw a rectangle on the screen and map my drawing tablet to that area.

Future improvement: force the mapped area to the same aspect ratio as the tablet. I hope I can find a better way to programmatically get the ratio than running xinput list-devices and parsing out "Size: 160x100mm".

Bound via bindsym $mod+Shift+t exec ~/.config/sway/tablet-map. Is there a better way to reference the way config directory?

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago

You could use ${XDG_CONFIG_HOME:-~/.config}, so if the XDG_CONFIG_HOME variable is set, it'll use that, otherwise defaults to ~/.config.

This is for the case if the user has defined a custom directory for their configs it'll point there instead.