Remove sketch (or wacom) scripts
							parent
							
								
									d4ba22670a
								
							
						
					
					
						commit
						e9ad41f94f
					
				| 
						 | 
				
			
			@ -1,7 +0,0 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# Find and open Xournal sketch
 | 
			
		||||
 | 
			
		||||
selected=$(ls ~/sketches/*.xopp | fzf)
 | 
			
		||||
 | 
			
		||||
xournalpp "$selected" &
 | 
			
		||||
| 
						 | 
				
			
			@ -1,89 +0,0 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# Note: this script gets called from $HOME/.config/autorandr/docked/postswitch,
 | 
			
		||||
#       default drawing area on 4K monitor
 | 
			
		||||
 | 
			
		||||
# Centered draw area:
 | 
			
		||||
#
 | 
			
		||||
# x_offset  = screen_width/2 - draw_width/2
 | 
			
		||||
# y_offset = screen_height/2 - draw_height/2
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Drawing area
 | 
			
		||||
# TODO: w,h,x,y parameters w/ these defaults
 | 
			
		||||
#       call script from autorandr with corresponding parameters.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# Get screen resolution (TODO: test external monitor)
 | 
			
		||||
resolution=$(xrandr --current | grep "connected primary" | awk '{print $4}' | sed 's/x/ /g' | sed 's/+[0-9]//g')
 | 
			
		||||
screen_w=$(echo "$resolution" | awk '{print $1}')
 | 
			
		||||
screen_h=$(echo "$resolution" | awk '{print $2}')
 | 
			
		||||
 | 
			
		||||
w=1920                   # Width
 | 
			
		||||
h=1080                   # Height
 | 
			
		||||
x="$((screen_w - 1920))" # Horizontal offset
 | 
			
		||||
y="$((screen_h - 1080))" # Vertical offset
 | 
			
		||||
orientation="landscape"  # Portrait/landscape
 | 
			
		||||
 | 
			
		||||
# Get rotation setting
 | 
			
		||||
rotate=`[[ "$orientation" == "landscape" ]] && echo "half" || echo "ccw"`
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Wacom tablet
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# Right bottom
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen stylus"   rotate "$rotate"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Finger touch" rotate "$rotate"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen eraser"   rotate "$rotate"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen cursor"   rotate "$rotate"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen stylus"   rotate "$rotate"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen stylus"   MapToOutput "$w"x"$h"+"$x"+"$y"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput "$w"x"$h"+"$x"+"$y"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen eraser"   MapToOutput "$w"x"$h"+"$x"+"$y"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen cursor"   MapToOutput "$w"x"$h"+"$x"+"$y"
 | 
			
		||||
xsetwacom set "Wacom Intuos Pro M Pen stylus"   MapToOutput "$w"x"$h"+"$x"+"$y"
 | 
			
		||||
 | 
			
		||||
# Centered
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus"   MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen stylus"       MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Finger touch"     MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser"   MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor"   MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen eraser"       MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus"   MapToOutput 1920x1080+"$(w/2)"+"$(h/2)"
 | 
			
		||||
 | 
			
		||||
# # Rotate drawing are for vertical drawing
 | 
			
		||||
# # (physical controls above drawing area)
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen stylus" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Finger touch" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen eraser" rotate ccw
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" rotate ccw
 | 
			
		||||
 | 
			
		||||
# # Set drawing area to left side on 3840x2160 monitor
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Finger touch" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen stylus" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Finger touch" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen eraser" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen cursor" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom HID 5214 Pen eraser" MapToOutput 1080x1920+130+130
 | 
			
		||||
# xsetwacom set "Wacom Intuos Pro M Pen stylus" MapToOutput 1080x1920+130+130
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Laptop touch display
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Pen stylus"       rotate none
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Finger touch"     rotate none
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Pen eraser"       rotate none
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Pen eraser"       MapToOutput 1920x1080+0+0
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Pen stylus"       MapToOutput 1920x1080+0+0
 | 
			
		||||
xsetwacom set "Wacom HID 5214 Finger touch"     MapToOutput 1920x1080+0+0
 | 
			
		||||
 | 
			
		||||
xsetwacom --set "Wacom Intuos Pro M Finger touch" TOUCH off
 | 
			
		||||
							
								
								
									
										41
									
								
								.bin/sketch
								
								
								
								
							
							
						
						
									
										41
									
								
								.bin/sketch
								
								
								
								
							| 
						 | 
				
			
			@ -1,41 +0,0 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# Open xournal in wacom drawing area
 | 
			
		||||
 | 
			
		||||
# xdotool key "Super_L+f"
 | 
			
		||||
 | 
			
		||||
function start_xournal() {
 | 
			
		||||
  # Prevent multiple xournalpp instances
 | 
			
		||||
  if pgrep -x "xournalpp" > /dev/null
 | 
			
		||||
  then
 | 
			
		||||
    echo "Xournal is already running" 
 | 
			
		||||
  else 
 | 
			
		||||
    xournalpp &
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function resize_xournal() {
 | 
			
		||||
  # Resize xournalpp window to draw area
 | 
			
		||||
  sleep 1
 | 
			
		||||
  xournal_id=$(xdotool search --onlyvisible --name xournal)
 | 
			
		||||
  resize-for-wacom-horizontal
 | 
			
		||||
 | 
			
		||||
  # FIXME: Automate for different resolutions
 | 
			
		||||
 | 
			
		||||
  # Bottom centered
 | 
			
		||||
  # xdotool windowsize "$xournal_id" 1920 1080
 | 
			
		||||
  # xdotool windowmove "$xournal_id" 1920 1080
 | 
			
		||||
 | 
			
		||||
  # Centered
 | 
			
		||||
  xdotool windowsize "$xournal_id" 1920 1080
 | 
			
		||||
  xdotool windowmove "$xournal_id" 960 540
 | 
			
		||||
 | 
			
		||||
  # Vertical
 | 
			
		||||
  # xournal_id=$(xdotool search --onlyvisible --name xournal)
 | 
			
		||||
  # xdotool windowsize "$xournal_id" 1080 1920
 | 
			
		||||
  # xdotool windowmove "$xournal_id" 130 540
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
set-wacom-draw-area
 | 
			
		||||
start_xournal
 | 
			
		||||
resize_xournal
 | 
			
		||||
		Loading…
	
		Reference in New Issue