From 3d45c4509fc701cc0b3f6f73f7783555415de423 Mon Sep 17 00:00:00 2001 From: lanxu Date: Sun, 25 Jul 2021 17:02:55 +0300 Subject: [PATCH] Automatic authentication and improved support for firefox and tablets --- encode-vp9.py | 14 +++++------ setup_tablet.sh | 62 ++++++++++++++++++++++++++----------------------- startwayland | 12 ++++++++-- 3 files changed, 50 insertions(+), 38 deletions(-) diff --git a/encode-vp9.py b/encode-vp9.py index 9f27cf1..fe0403f 100755 --- a/encode-vp9.py +++ b/encode-vp9.py @@ -2,7 +2,7 @@ import os import re import sys -import getopt +import getopt import lib.helpers as helpers from subprocess import call @@ -14,6 +14,9 @@ def main(argv): inputFile = '' outputFile = '' loglevel = 'error' + #bitrate = '2000k' + bitrate = '0' + crf = '15' try: opts, args = getopt.getopt(argv,"hi:o:v",["ifile=","ofile="]) @@ -40,11 +43,11 @@ def main(argv): """ # Disable colors - os.environ['AV_LOG_FORCE_NOCOLOR'] = '1' + os.environ['AV_LOG_FORCE_NOCOLOR'] = '1' # Define commands - command_pass1 = ['ffmpeg', '-i', inputFile, '-loglevel',loglevel,'-c:v', 'libvpx-vp9', '-pass', '1', '-b:v', '1000K', '-threads', '8', '-speed', '4', '-tile-columns', '6', '-frame-parallel', '1', '-auto-alt-ref', '1', '-lag-in-frames', '25', '-an', '-f', 'webm', '-y', '/dev/null'] - command_pass2 = ['ffmpeg', '-i', inputFile, '-loglevel',loglevel,'-c:v', 'libvpx-vp9', '-pass', '2', '-b:v', '1000K', '-threads', '8', '-speed', '1', '-tile-columns', '6', '-frame-parallel', '1', '-auto-alt-ref', '1', '-lag-in-frames', '25', '-c:a', 'libopus', '-b:a', '64k', '-f', 'webm', outputFile] + command_pass1 = ['ffmpeg', '-i', inputFile, '-loglevel',loglevel,'-c:v', 'libvpx-vp9', '-pass', '1', '-b:v', bitrate, '-crf', crf, '-threads','16', '-slices','16','-cpu-used','-4', '-f', 'null', '-y', '/dev/null'] + command_pass2 = ['ffmpeg', '-i', inputFile, '-loglevel',loglevel,'-c:v', 'libvpx-vp9', '-pass', '2', '-b:v', bitrate, '-crf', crf, '-threads','16', '-slices','16','-cpu-used','-4', outputFile] # Run commands print('Input file is "'+inputFile+'"') @@ -78,6 +81,3 @@ def main(argv): if __name__ == "__main__": main(sys.argv[1:]) - - - diff --git a/setup_tablet.sh b/setup_tablet.sh index f7b189d..e55a1be 100755 --- a/setup_tablet.sh +++ b/setup_tablet.sh @@ -1,25 +1,29 @@ #!/bin/sh -# xsetwacom --set "HID 256c:006e Pen stylus" Area 0 0 50800 28575 -xsetwacom --set "HID 256c:006e Pen stylus" MapToOutput DVI-D-0 +#HID_STYLUS="HID 256c:006e Pen stylus" +#HID_PAD="HID 256c:006e Pad pad" +HID_STYLUS="HID 256c:006e" +HID_PAD="HID 256c:006e Pad" +# xsetwacom --set "$HID_PAD" Area 0 0 50800 28575 +xsetwacom --set "$HID_STYLUS" MapToOutput DVI-D-0 # Tester -#xsetwacom --set 'HID 256c:006e Pad pad' Button 1 "key a" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 2 "key b" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 3 "key c" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 4 "key d" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 5 "key e" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 6 "key f" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 7 "key g" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 8 "key h" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 9 "key i" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 10 "key j" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 11 "key k" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 12 "key l" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 13 "key m" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 14 "key n" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 15 "key o" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 16 "key p" +#xsetwacom --set "$HID_PAD" Button 1 "key a" +#xsetwacom --set "$HID_PAD" Button 2 "key b" +#xsetwacom --set "$HID_PAD" Button 3 "key c" +#xsetwacom --set "$HID_PAD" Button 4 "key d" +#xsetwacom --set "$HID_PAD" Button 5 "key e" +#xsetwacom --set "$HID_PAD" Button 6 "key f" +#xsetwacom --set "$HID_PAD" Button 7 "key g" +#xsetwacom --set "$HID_PAD" Button 8 "key h" +#xsetwacom --set "$HID_PAD" Button 9 "key i" +#xsetwacom --set "$HID_PAD" Button 10 "key j" +#xsetwacom --set "$HID_PAD" Button 11 "key k" +#xsetwacom --set "$HID_PAD" Button 12 "key l" +#xsetwacom --set "$HID_PAD" Button 13 "key m" +#xsetwacom --set "$HID_PAD" Button 14 "key n" +#xsetwacom --set "$HID_PAD" Button 15 "key o" +#xsetwacom --set "$HID_PAD" Button 16 "key p" # Huion 1060 New buttons from top to bottom: # 1 2 @@ -31,26 +35,26 @@ xsetwacom --set "HID 256c:006e Pen stylus" MapToOutput DVI-D-0 # 15 16 ## 1 -xsetwacom --set 'HID 256c:006e Pad pad' Button 1 "key +ctrl +z -z -ctrl" -xsetwacom --set 'HID 256c:006e Pad pad' Button 2 "key +ctrl +shift +z -z -ctrl -shift" +xsetwacom --set "$HID_PAD" Button 1 "key +ctrl +z -z -ctrl" +xsetwacom --set "$HID_PAD" Button 2 "key +ctrl +shift +z -z -ctrl -shift" ## 2 -xsetwacom --set 'HID 256c:006e Pad pad' Button 3 "key L" -xsetwacom --set 'HID 256c:006e Pad pad' Button 8 "key K" +xsetwacom --set "$HID_PAD" Button 3 "key L" +xsetwacom --set "$HID_PAD" Button 8 "key K" ## 3 -xsetwacom --set 'HID 256c:006e Pad pad' Button 9 "key -" -xsetwacom --set 'HID 256c:006e Pad pad' Button 10 "key +" +xsetwacom --set "$HID_PAD" Button 9 "key -" +xsetwacom --set "$HID_PAD" Button 10 "key +" # -#xsetwacom --set 'HID 256c:006e Pad pad' Button 13 "key p" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 12 "key [" +#xsetwacom --set "$HID_PAD" Button 13 "key p" +#xsetwacom --set "$HID_PAD" Button 12 "key [" ## 2 -#xsetwacom --set 'HID 256c:006e Pad pad' Button 11 "key ]" -#xsetwacom --set 'HID 256c:006e Pad pad' Button 10 "key +" +#xsetwacom --set "$HID_PAD" Button 11 "key ]" +#xsetwacom --set "$HID_PAD" Button 10 "key +" ## 5 -#xsetwacom --set 'HID 256c:006e Pad pad' Button 3 "key b" +#xsetwacom --set "$HID_PAD" Button 3 "key b" ## 6 diff --git a/startwayland b/startwayland index 707be14..91fc330 100755 --- a/startwayland +++ b/startwayland @@ -1,7 +1,7 @@ #!/bin/sh export XKB_DEFAULT_LAYOUT=fi -#export XKB_DEFAULT_VARIANT=fi +export XKB_DEFAULT_VARIANT=fi export XKB_DEFAULT_MODEL=pc105 #export XDG_RUNTIME_DIR=/tmp/wayland @@ -9,9 +9,17 @@ export XKB_DEFAULT_MODEL=pc105 # force all generic backend to use wayland backend export GDK_BACKEND=wayland -export QT_QPA_PLATFORM=wayland-egl +export QT_QPA_PLATFORM=wayland # wayland-egl? export CLUTTER_BACKEND=wayland export SDL_VIDEODRIVER=wayland export EWOL_BACKEND=wayland +# firefox +export MOZ_ENABLE_WAYLAND=1 +export MOZ_DBUS_REMOTE=1 +# auth +eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh) +export SSH_AUTH_SOCK + +# start! sway