Posts

MyPaint programming- fractal patterns

posted Sep 1, 2016, 12:07 AM by Brien Dieterle   [ updated Sep 1, 2016, 12:08 AM ]



Wacom Intous Pro XFCE with wheel and monitor mapping

posted Aug 27, 2015, 7:44 PM by Brien Dieterle

Here's some scripts I found and modified to work on my system

~$ uname -a
Linux  4.1.0-1-amd64 #1 SMP Debian 4.1.3-1 (2015-08-03) x86_64 GNU/Linux


~$ tail /etc/rc.local
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
##   # Change permissions on status_led0_select file so being root isn't
##   # required to switch Wacom touch ring mode status LEDs.
/bin/chmod 666 /sys/devices/*/*/*/*/*/*/wacom_led/status_led0_select

exit 0



~$ cat ~/wacom.sh
#!/bin/bash

## Touch ring toggle script
##
## Bind Button 1 (button center of touch ring) to the script.
##
## To allow script to select mode status LEDs edit rc.local to change root
## only permissions on the sysfs status_led0_select file:
##   gksudo gedit /etc/rc.local
## Add the following comment and command (before 'exit 0'):
##   # Change permissions on status_led0_select file so being root isn't
##   # required to switch Wacom touch ring mode status LEDs.
##   /bin/chmod 666 /sys/bus/usb/devices/*/wacom_led/status_led0_select  #this seems wrong on my system
##
## Intuos - status_led0_select file = the left (only) ring status LEDs.
## Cintiq - status_led1_select = the left ring; status_led0_select =
## the right ring status LEDs.  Same for the touchstrips.
##
## For mode state notification use:
##   sudo apt-get install libnotify-bin
## Otherwise comment (#) out the notify-send lines.  If libnotify-bin
## installed see 'man notify-send' for details.

# check if mode_state file exists, if not create it and set to 0
if [ ! -f /tmp/mode_state ]; then
        echo 0 > /tmp/mode_state
fi

# read mode state value from temporary file
MODE=`cat /tmp/mode_state`

# select touch ring mode status LED for current mode state
echo $MODE > /sys/devices/pci0000:00/0000:00:1d.1/usb5/5-2/5-2:1.0/*/wacom_led/status_led0_select

# for DEVICE use the pad "device name" from 'xinput list'
DEVICE="Wacom Intuos5 touch M Pad pad"
#DEVICE="Wacom Intuos5 touch M Pen pad"

# set touch ring function option and notification for the 4 toggled modes
if [ "$MODE" == 0 ]; then
        xsetwacom set  "$DEVICE" AbsWheelUp key q  # scroll up
        xsetwacom set  "$DEVICE" AbsWheelDown key w  # scroll down
        notify-send -t 1500 "Mode 1:  color brightness"
elif [ "$MODE" == 1 ]; then
        xsetwacom set  "$DEVICE" AbsWheelUp key e  # increase brush radius (must be mapped in GIMP)
        xsetwacom set  "$DEVICE" AbsWheelDown key r  # decrease brush radius (must be mapped in GIMP)
        notify-send -t 1500 "Mode 2:  saturation"
elif [ "$MODE" == 2 ]; then
        xsetwacom set  "$DEVICE" AbsWheelUp key t  # zoom in
        xsetwacom set  "$DEVICE" AbsWheelDown key y  # zoom out
        notify-send -t 1500 "Mode 3:  hue"
elif [ "$MODE" == 3 ]; then
        xsetwacom set  "$DEVICE" AbsWheelUp key u  # select previous layer
        xsetwacom set  "$DEVICE" AbsWheelDown key i  # select next layer
        notify-send -t 1500 "Mode 4: opacity "
fi

# toggle button increment counter
MODE=$((MODE += 1))

# set next mode state
if (( "$MODE" > 3 )); then  # roll over to 0, only 4 mode states available
        echo 0 > /tmp/mode_state
else
        echo $MODE > /tmp/mode_state
fi




~$ cat ~/wacomsettings.sh
#!/bin/bash
#turns off touch and maps the tablet to my left monitor
#maps the wheel button to CTRL-ALT-R which is very important

xsetwacom set "Wacom Intuos5 touch M Pad pad" "Touch" "off"
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Gesture" "off"
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 1 "key +Control_L +Alt_L +r -r "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 2 "key +Control_L "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 3 "key +Alt_L "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 8 "key +Shift_L "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 9 "key +Tab -Tab "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 10 "key +apostrophe -apostrophe "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 11 "key +BackSpace -BackSpace "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 12 "key +backslash -backslash "
xsetwacom set "Wacom Intuos5 touch M Pad pad" "Button" 13 "key +Control_L +z -z "

xsetwacom --set "Wacom Intuos5 touch M Pad pad" MapToOutput "1920x1200+0+0"
xsetwacom --set "Wacom Intuos5 touch M Pen cursor" MapToOutput "1920x1200+0+0"
xsetwacom --set "Wacom Intuos5 touch M Pen stylus" MapToOutput "1920x1200+0+0"
xsetwacom --set "Wacom Intuos5 touch M Pen eraser" MapToOutput "1920x1200+0+0"


xsetwacom --set "Wacom Intuos5 touch M Finger touch" Touch off

~$ cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml  |grep wacom
      <property name="&lt;Primary&gt;&lt;Alt&gt;r" type="string" value="/home/xxxx/wacom.sh"/>

#configure the above to start automatically in Settings-->Session and Startup-->Application Autostart



~$ cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml  |grep wacom
      <property name="&lt;Primary&gt;&lt;Alt&gt;r" type="string" value="/home/xxxx/wacom.sh"/>

#you'll want to configure the above with the GUI--  Settings--->Keyboard--->Application Shortcuts.  CTRL-ALT-R should run the wacom.sh script. 


time lapse with perspective corrections

posted Nov 17, 2014, 4:50 PM by Brien Dieterle   [ updated Nov 18, 2014, 8:36 PM ]

for i in `ls -1 vid/*.JPG`; do convert $i \( -clone 0 -matte -virtual-pixel transparent -distort Perspective '456,408 0,0 1440,2308 0,2500 2206,701 3800,0 2948,1668 3800,2500' -crop "3800x2500+0+0" +repage -scale "x540" \) -scale "x540" -append - ; done | ffmpeg -f image2pipe -r 12 -vcodec mjpeg -i - -vcodec huffyuv  -threads 2 out.avi


This takes all the images in vid and first does a perspective correction and crop on a copy in memory and then scales it to 540px tall.  Then it puts a copy of the original underneath it (append) and spits it out to ffmpeg which converts it to a video file at 12fps in an intermediate codec ready for editing in your favorite video editor.  My friend Austin wrote a cool post about doing this kind of transformation in Python, check it out.

1-3 of 3