Compare commits
	
		
			3 Commits 
		
	
	
		
			7e10a1c39d
			...
			454b80aa4e
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 454b80aa4e | |
|  | e9ad41f94f | |
|  | d4ba22670a | 
|  | @ -3,8 +3,12 @@ | ||||||
| # Generate menu of book filenames and save paths | # Generate menu of book filenames and save paths | ||||||
| # Preview window contains metadata | # Preview window contains metadata | ||||||
| 
 | 
 | ||||||
|  | function get_book_paths { | ||||||
|  |   find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function select_file { | function select_file { | ||||||
|   echo "$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)" |   get_book_paths | fzf --delimiter=/ --with-nth=-1 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function open { | function open { | ||||||
|  |  | ||||||
|  | @ -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 |  | ||||||
|  | @ -1,15 +0,0 @@ | ||||||
| output eDP |  | ||||||
| off |  | ||||||
| output HDMI-A-0 |  | ||||||
| crtc 0 |  | ||||||
| mode 3840x2160 |  | ||||||
| pos 0x0 |  | ||||||
| primary |  | ||||||
| rate 60.00 |  | ||||||
| x-prop-max_bpc 8 |  | ||||||
| x-prop-non_desktop 0 |  | ||||||
| x-prop-scaling_mode None |  | ||||||
| x-prop-tearfree auto |  | ||||||
| x-prop-underscan off |  | ||||||
| x-prop-underscan_hborder 0 |  | ||||||
| x-prop-underscan_vborder 0 |  | ||||||
|  | @ -1 +0,0 @@ | ||||||
| HDMI-A-0 00ffffffffffff00410c8fc16d040000271c0103803c22782a67a1a5554da2270e5054bfef00d1c0b30095008180814081c0010101014dd000a0f0703e803020350055502100001aa36600a0f0701f803020350055502100001a000000fc0050484c203237364538560a2020000000fd0017501ea03c000a20202020202001a7020333f14c9004031f1301125d5e5f606123090707830100006d030c001000387820006001020367d85dc401788003e30f000c565e00a0a0a029503020350055502100001e023a801871382d40582c450055502100001e011d007251d01e206e28550055502100001e4d6c80a070703e8030203a0055502100001a000000004e |  | ||||||
|  | @ -1,25 +0,0 @@ | ||||||
| output HDMI-A-0 |  | ||||||
| crtc 0 |  | ||||||
| mode 3840x2160 |  | ||||||
| pos 0x0 |  | ||||||
| primary |  | ||||||
| rate 60.00 |  | ||||||
| x-prop-max_bpc 8 |  | ||||||
| x-prop-non_desktop 0 |  | ||||||
| x-prop-scaling_mode None |  | ||||||
| x-prop-tearfree auto |  | ||||||
| x-prop-underscan off |  | ||||||
| x-prop-underscan_hborder 0 |  | ||||||
| x-prop-underscan_vborder 0 |  | ||||||
| output eDP |  | ||||||
| crtc 1 |  | ||||||
| mode 1920x1080 |  | ||||||
| pos 960x2160 |  | ||||||
| rate 60.00 |  | ||||||
| x-prop-max_bpc 16 |  | ||||||
| x-prop-non_desktop 0 |  | ||||||
| x-prop-scaling_mode None |  | ||||||
| x-prop-tearfree auto |  | ||||||
| x-prop-underscan off |  | ||||||
| x-prop-underscan_hborder 0 |  | ||||||
| x-prop-underscan_vborder 0 |  | ||||||
|  | @ -1,2 +0,0 @@ | ||||||
| HDMI-A-0 00ffffffffffff00410c8fc16d040000271c0103803c22782a67a1a5554da2270e5054bfef00d1c0b30095008180814081c0010101014dd000a0f0703e803020350055502100001aa36600a0f0701f803020350055502100001a000000fc0050484c203237364538560a2020000000fd0017501ea03c000a20202020202001a7020333f14c9004031f1301125d5e5f606123090707830100006d030c001000387820006001020367d85dc401788003e30f000c565e00a0a0a029503020350055502100001e023a801871382d40582c450055502100001e011d007251d01e206e28550055502100001e4d6c80a070703e8030203a0055502100001a000000004e |  | ||||||
| eDP 00ffffffffffff0009e5d60800000000251d0104a51f1178031ef5965d5b91291c505400000001010101010101010101010101010101c0398018713828403020360035ae1000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5631343046484d2d4e34550a0011 |  | ||||||
|  | @ -1,8 +0,0 @@ | ||||||
| output HDMI-A-0 |  | ||||||
| off |  | ||||||
| output eDP |  | ||||||
| crtc 0 |  | ||||||
| mode 1920x1080 |  | ||||||
| pos 0x0 |  | ||||||
| primary |  | ||||||
| rate 60.00 |  | ||||||
|  | @ -1 +0,0 @@ | ||||||
| eDP 00ffffffffffff0009e5d60800000000251d0104a51f1178031ef5965d5b91291c505400000001010101010101010101010101010101c0398018713828403020360035ae1000001a000000000000000000000000000000000000000000fe00424f452043510a202020202020000000fe004e5631343046484d2d4e34550a0011 |  | ||||||
		Loading…
	
		Reference in New Issue