├── .gitignore ├── Note taking ├── Pen disables touchscreen │ └── usr │ │ ├── lib │ │ └── systemd │ │ │ └── system │ │ │ └── pen-disable-touch.service │ │ └── local │ │ └── bin │ │ └── pen-disable-touch.sh ├── Surface Pen purple button │ ├── etc │ │ └── udev │ │ │ └── rules.d │ │ │ └── 99-input.rules │ └── usr │ │ ├── lib │ │ ├── systemd │ │ │ └── system │ │ │ │ └── autoconnect.service │ │ └── udev │ │ │ └── bluetooth │ │ └── local │ │ └── bin │ │ └── autoconnect-script.sh ├── config-wacom-libinput │ ├── .config │ │ └── libinput-gestures.conf │ └── usr │ │ └── share │ │ └── X11 │ │ └── xorg.conf.d │ │ ├── 10-quirks.conf │ │ ├── 30-wacom.conf │ │ ├── 40-libinput.conf │ │ └── 41-touchpad.conf └── xournalpp-config │ ├── colornames.ini │ ├── settings.xml │ └── ui │ └── toolbar.ini ├── README.md └── Utilities ├── Automatic screen rotation └── usr │ ├── lib │ └── systemd │ │ └── system │ │ └── autorotation.service │ └── local │ └── bin │ ├── autorotate.sh │ └── rotate-all.sh ├── Enable intel vsync └── usr │ └── share │ └── X11 │ └── xorg.conf.d │ └── 20-intel.conf ├── Wifi restart switch └── usr │ └── local │ └── bin │ └── restart-wifi.sh └── Wifi workaround ├── etc ├── NetworkManager │ └── conf.d │ │ └── mwifiex_pcie-randomization.conf └── systemd │ └── system │ └── wifi-disable-powersave.service └── usr └── local └── bin └── wifi-disable-powersave.sh /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.DS_Store 3 | *_DS_Store 4 | *.idea 5 | -------------------------------------------------------------------------------- /Note taking/Pen disables touchscreen/usr/lib/systemd/system/pen-disable-touch.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Determine weather the pen is hovering the screen and disable the touch if so 3 | After=graphical.target 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/usr/local/bin/pen-disable-touch.sh 8 | 9 | [Install] 10 | WantedBy=default.target 11 | -------------------------------------------------------------------------------- /Note taking/Pen disables touchscreen/usr/local/bin/pen-disable-touch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #enable/disable touch via 3 | #xinput set-prop "NTRG0001:01 1B96:1B05" "Device Enabled" 1 4 | # 5 | #Properties that change when the pen is hovering: 6 | #xinput list-props "NTRG0001:01 1B96:1B05 Pen stylus"|grep "Wacom Serial IDs" 7 | 8 | deviceName="NTRG0001:01 1B96:1B05 Pen stylus" 9 | deviceProp="Wacom Serial IDs" 10 | 11 | export DISPLAY=':0.0' 12 | export XAUTHORITY="/run/user/1000/gdm/Xauthority" 13 | 14 | currente="0" 15 | laste="0" 16 | 17 | while true; do 18 | 19 | sleep 0.5 20 | 21 | isPenHovering=$(xinput list-props "$deviceName"|grep "$deviceProp"|cut -d, -f 4|cut -c 2) 22 | 23 | if [[ $isPenHovering != "0" ]] 24 | then 25 | currente="0" 26 | else 27 | currente="1" 28 | fi 29 | 30 | if [[ $laste != $currente ]] 31 | then 32 | xinput set-prop "NTRG0001:01 1B96:1B05" "Device Enabled" $currente 33 | laste=$currente 34 | fi 35 | done 36 | -------------------------------------------------------------------------------- /Note taking/Surface Pen purple button/etc/udev/rules.d/99-input.rules: -------------------------------------------------------------------------------- 1 | #OBVIOUSLY PAIR your device first, and replace its mac address down here: 2 | ACTION=="add", SUBSYSTEM=="bluetooth", ATTR{address}="E2:E5:16:DC:69:6C", RUN+="/usr/lib/udev/bluetooth" 3 | -------------------------------------------------------------------------------- /Note taking/Surface Pen purple button/usr/lib/systemd/system/autoconnect.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Bluetooth auto reconnection service for Surface Pen 3 | After=graphical.target bluetooth.service 4 | 5 | [Service] 6 | Type=simple 7 | ExecStartPre=/bin/sleep 5 8 | ExecStart=/usr/local/bin/autoconnect-script.sh 9 | 10 | [Install] 11 | WantedBy=default.target 12 | -------------------------------------------------------------------------------- /Note taking/Surface Pen purple button/usr/lib/udev/bluetooth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # at each BT connection/disconnection do something 3 | 4 | su -l morro #change to your user 5 | 6 | BLUETOOTH_LOG=/var/log/bluetooth_dev 7 | KEYSTROKE="ctrl+z" 8 | export DISPLAY=':0.0' 9 | export XAUTHORITY="/run/user/1000/gdm/Xauthority" #obtained by simply running "xauth" 10 | XDOTOOL="/usr/bin/xdotool" 11 | 12 | function log { 13 | echo "[$(date)]: $*" >> $BLUETOOTH_LOG 14 | } 15 | 16 | if [ $ACTION = "remove" ] 17 | then 18 | log "Device disconnected" 19 | elif [ $ACTION = "add" ] 20 | then 21 | log "Device connected" 22 | winid=$($XDOTOOL getwindowfocus) &>> $BLUETOOTH_LOG 23 | $XDOTOOL windowactivate $winid ; $XDOTOOL key $KEYSTROKE &>> $BLUETOOTH_LOG 24 | else 25 | log "Other action " 26 | fi 27 | -------------------------------------------------------------------------------- /Note taking/Surface Pen purple button/usr/local/bin/autoconnect-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | BLUEZPATH="/usr/local/bin/bluez/test/test-device" 3 | BTMAC="" 4 | 5 | while [[ $BTMAC == "" ]] 6 | do 7 | BTMAC=$(python2.7 /usr/local/bin/bluez/test/test-device list|grep "Surface Pen"|cut -d' ' -f 1) 8 | sleep 1 9 | done 10 | 11 | while true 12 | do 13 | sleep 0.3 14 | python2.7 $BLUEZPATH connect $BTMAC 15 | done 16 | -------------------------------------------------------------------------------- /Note taking/config-wacom-libinput/.config/libinput-gestures.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for libinput-gestures. 2 | # 3 | # The default configuration file exists at /etc/libinput-gestures.conf 4 | # but a user can create a personal custom configuration file at 5 | # ~/.config/libinput-gestures.conf. 6 | # 7 | # Lines starting with '#' and blank lines are ignored. Currently 8 | # "gesture" and "device" configuration keywords are supported as 9 | # described below. The keyword can optionally be appended with a ":" (to 10 | # maintain compatibility with original format configuration files). 11 | # 12 | # Each gesture line has 3 [or 4] arguments separated by whitespace: 13 | # 14 | # action motion [finger_count] command 15 | # 16 | # where action and motion is either: 17 | # swipe up 18 | # swipe down 19 | # swipe left 20 | # swipe right 21 | # pinch in 22 | # pinch out 23 | # 24 | # command is the remainder of the line and is any valid shell command + 25 | # arguments. 26 | # 27 | # finger_count is a single numeric digit and is optional (and is 28 | # typically 3 or 4). If specified then the command is executed when 29 | # exactly that number of fingers is used in the gesture. If not 30 | # specified then the command is executed when that gesture is executed 31 | # with any number of fingers. Gesture lines specified with finger_count 32 | # have priority over the same gesture specified without any 33 | # finger_count. 34 | # 35 | # Typically command will be xdotool, or wmctrl. See "man xdotool" for 36 | # the many things you can action with that tool. Note that unfortunately 37 | # xdotool does not work with native Wayland clients. 38 | 39 | ############################################################################### 40 | # SWIPE GESTURES: 41 | ############################################################################### 42 | 43 | # Note the default is an "internal" command that uses wmctrl to switch 44 | # workspaces and, unlike xdotool, works on both Xorg and Wayland (via 45 | # XWayland). It also can be configured for vertical and horizontal 46 | # switching over tabular workspaces, as per the example below. You can 47 | # also add "-w" to the internal command to allow wrapping workspaces. 48 | 49 | # Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg) 50 | #gesture swipe up _internal ws_up 51 | gesture swipe up 3 xfdashboard 52 | 53 | # NOTE ABOUT FINGER COUNT: 54 | # The above command will configure this command for all fingers (i.e. 3 55 | # for 4) but to configure it for 3 fingers only, change it to: 56 | # gesture swipe up 4 _internal ws_up 57 | # gesture swipe down 4 _internal ws_down 58 | # Then you can configure something else for 4 fingers or leave 4 fingers 59 | # unconfigured. You can configure an explicit finger count like this for 60 | # all example commands in this configuration file. 61 | # 62 | # gesture swipe up xdotool key super+Page_Down 63 | 64 | # Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg) 65 | gesture swipe down xdotool key ctrl+alt+d 66 | # gesture swipe down xdotool key super+Page_Up 67 | 68 | # Browser go forward (works only for Xorg, and Xwayland clients) 69 | #gesture swipe left xdotool key alt+Right 70 | gesture swipe left _internal ws_up 71 | # 72 | # Browser go back (works only for Xorg, and Xwayland clients) 73 | #gesture swipe right xdotool key alt+Left 74 | gesture swipe right _internal ws_down 75 | 76 | # NOTE: If you don't use "natural" scrolling direction for your touchpad 77 | # then you may want to swap the above default left/right and up/down 78 | # configurations. 79 | 80 | # Optional extended swipe gestures, e.g. for browser tab navigation: 81 | # 82 | # Jump to next open browser tab 83 | # gesture swipe right_up xdotool key control+Tab 84 | # 85 | # Jump to previous open browser tab 86 | # gesture swipe left_up xdotool key control+shift+Tab 87 | # 88 | # Close current browser tab 89 | # gesture swipe left_down xdotool key control+w 90 | # 91 | # Reopen and jump to last closed browser tab 92 | # gesture swipe right_down xdotool key control+shift+t 93 | 94 | # Example of 8 static workspaces, e.g. using KDE virtual-desktops, 95 | # arranged in 2 rows of 4 across using swipe up/down/left/right to 96 | # navigate in fixed planes. Must match how you have configured your 97 | # virtual desktops. 98 | # gesture swipe up _internal --col=2 ws_up 99 | # gesture swipe down _internal --col=2 ws_down 100 | # gesture swipe left _internal --row=4 ws_up 101 | # gesture swipe right _internal --row=4 ws_down 102 | 103 | # Example virtual desktop switching for Ubuntu Unity/Compiz. The 104 | # _internal command does not work for Compiz but you can explicitly 105 | # configure the swipe commands to work for a Compiz virtual 2 106 | # dimensional desktop as follows: 107 | # gesture swipe up xdotool key ctrl+alt+Up 108 | # gesture swipe down xdotool key ctrl+alt+Down 109 | # gesture swipe left xdotool key ctrl+alt+Left 110 | # gesture swipe right xdotool key ctrl+alt+Right 111 | 112 | # Example to change audio volume: 113 | # Note this only works on an Xorg desktop (not Wayland). 114 | # gesture swipe up xdotool key XF86AudioRaiseVolume 115 | # gesture swipe down xdotool key XF86AudioLowerVolume 116 | 117 | ############################################################################### 118 | # PINCH GESTURES: 119 | ############################################################################### 120 | 121 | # GNOME SHELL open/close overview (works for GNOME on Xorg only) 122 | gesture pinch in xdotool key ctrl+minus #super+s 123 | gesture pinch out xdotool key ctrl+plus #super+s 124 | 125 | # GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg) 126 | # Note since GNOME 3.24 on Wayland this is implemented natively so no 127 | # real point configuring for Wayland. 128 | # gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 129 | # gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 130 | 131 | # Optional extended pinch gestures: 132 | # gesture pinch clockwise 133 | # gesture pinch anticlockwise 134 | 135 | ############################################################################### 136 | # This application normally determines your touchpad device 137 | # automatically. Some users may have multiple touchpads but by default 138 | # we use only the first one found. However, you can choose to specify 139 | # the explicit device name to use. Run "libinput list-devices" to work 140 | # out the name of your device (from the "Device:" field). Then add a 141 | # device line specifying that name, e.g: 142 | # 143 | # device DLL0665:01 06CB:76AD Touchpad 144 | # 145 | # If the device name starts with a '/' then it is instead considered as 146 | # the explicit device path although since device paths can change 147 | # through reboots this is best to be a symlink. E.g. instead of specifying 148 | # /dev/input/event12, use the corresponding full path link under 149 | # /dev/input/by-path/*. 150 | # 151 | # You can choose to use ALL touchpad devices by setting the device name 152 | # to "all". E.g. Do this if you have multiple touchpads which you want 153 | # to use in parallel. This reduces performance slightly so only set this 154 | # if you have to. 155 | # 156 | # device all 157 | 158 | ############################################################################### 159 | # You can set a minimum travel distance threshold before swipe gestures 160 | # are actioned using the swipe_threshold configuration command. 161 | # Specify this value in dots. The default is 0. 162 | # E.g. set it to 100 dots with "swipe_threshold 100". 163 | # swipe_threshold 0 164 | -------------------------------------------------------------------------------- /Note taking/config-wacom-libinput/usr/share/X11/xorg.conf.d/10-quirks.conf: -------------------------------------------------------------------------------- 1 | # Collection of quirks and blacklist/whitelists for specific devices. 2 | 3 | 4 | # Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable 5 | # http://bugs.freedesktop.org/show_bug.cgi?id=22442 6 | Section "InputClass" 7 | Identifier "ThinkPad HDAPS accelerometer blacklist" 8 | MatchProduct "ThinkPad HDAPS accelerometer data" 9 | Option "Ignore" "on" 10 | EndSection 11 | 12 | # https://bugzilla.redhat.com/show_bug.cgi?id=523914 13 | # Mouse does not move in PV Xen guest 14 | # Explicitly tell evdev to not ignore the absolute axes. 15 | Section "InputClass" 16 | Identifier "Xen Virtual Pointer axis blacklist" 17 | MatchProduct "Xen Virtual Pointer" 18 | Option "IgnoreAbsoluteAxes" "off" 19 | Option "IgnoreRelativeAxes" "off" 20 | EndSection 21 | 22 | # https://bugs.freedesktop.org/show_bug.cgi?id=55867 23 | # Bug 55867 - Doesn't know how to tag XI_TRACKBALL 24 | Section "InputClass" 25 | Identifier "Tag trackballs as XI_TRACKBALL" 26 | MatchProduct "trackball" 27 | MatchDriver "evdev" 28 | Option "TypeName" "TRACKBALL" 29 | EndSection 30 | 31 | # https://bugs.freedesktop.org/show_bug.cgi?id=62831 32 | # Bug 62831 - Mionix Naos 5000 mouse detected incorrectly 33 | Section "InputClass" 34 | Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE" 35 | MatchProduct "La-VIEW Technology Naos 5000 Mouse" 36 | MatchDriver "evdev" 37 | Option "TypeName" "MOUSE" 38 | EndSection 39 | -------------------------------------------------------------------------------- /Note taking/config-wacom-libinput/usr/share/X11/xorg.conf.d/30-wacom.conf: -------------------------------------------------------------------------------- 1 | # N-Trig Duosense Electromagnetic Digitizer 2 | Section "InputClass" 3 | Identifier "Wacom N-Trig class" 4 | MatchProduct "HID 1b96:0001|N-Trig Pen|N-Trig DuoSense|1B96:1B05 Pen" 5 | MatchDevicePath "/dev/input/event*" 6 | MatchIsTablet "on" 7 | Driver "wacom" 8 | Option "Button2" "3" 9 | Option "TabletPCButton" "on" 10 | Option "TPCButton" "on" 11 | EndSection 12 | 13 | Section "InputClass" 14 | Identifier "Wacom tablets class" 15 | MatchProduct "Wacom" 16 | MatchDevicePath "/dev/input/event*" 17 | MatchIsTablet "on" 18 | Driver "wacom" 19 | Option "TabletPCButton" "on" 20 | Option "TPCButton" "on" 21 | EndSection 22 | -------------------------------------------------------------------------------- /Note taking/config-wacom-libinput/usr/share/X11/xorg.conf.d/40-libinput.conf: -------------------------------------------------------------------------------- 1 | # Match on all types of devices but joysticks 2 | Section "InputClass" 3 | Identifier "libinput pointer catchall" 4 | MatchIsPointer "on" 5 | MatchDevicePath "/dev/input/event*" 6 | Driver "libinput" 7 | EndSection 8 | 9 | Section "InputClass" 10 | Identifier "libinput keyboard catchall" 11 | MatchIsKeyboard "on" 12 | MatchDevicePath "/dev/input/event*" 13 | Driver "libinput" 14 | EndSection 15 | 16 | Section "InputClass" 17 | Identifier "libinput touchscreen catchall" 18 | MatchIsTouchscreen "on" 19 | MatchDevicePath "/dev/input/event*" 20 | Driver "libinput" 21 | EndSection 22 | 23 | 24 | -------------------------------------------------------------------------------- /Note taking/config-wacom-libinput/usr/share/X11/xorg.conf.d/41-touchpad.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "libinput touchpad catchall" 3 | MatchIsTouchpad "on" 4 | MatchDevicePath "/dev/input/event*" 5 | Driver "libinput" 6 | Option "NaturalScrolling" "true" 7 | Option "ClickMethod" "clickfinger" 8 | Option "Tapping" "on" 9 | Option "TappingDrag" "false" 10 | EndSection 11 | -------------------------------------------------------------------------------- /Note taking/xournalpp-config/colornames.ini: -------------------------------------------------------------------------------- 1 | [info] 2 | about=Xournalpp custom color names 3 | -------------------------------------------------------------------------------- /Note taking/xournalpp-config/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Note taking/xournalpp-config/ui/toolbar.ini: -------------------------------------------------------------------------------- 1 | # 2 | # NB: QUESTO FILE SI TROVA IN /home/morro/xournalpp/ui/toolbar.ini 3 | # 4 | # Xournal++ Toolbar configuration 5 | # Here you can customize the Toolbars 6 | # Delete this file to generate a new config file with default values 7 | 8 | # Available buttons: 9 | # File: NEW,SAVE,OPEN 10 | # 11 | # Edit: CUT,COPY,PASTE,SEARCH,UNDO,REDO,INSERT_NEW_PAGE 12 | # 13 | # Navigation: GOTO_FIRST,GOTO_BACK,GOTO_NEXT,GOTO_LAST,GOTO_NEXT_ANNOTATED_PAGE 14 | # 15 | # Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,TWO_PAGES 16 | # 17 | # Color: COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT 18 | # Notice: This are the default Xournal colors, each other color in HEX can also be used, eg COLOR(0x12ABCF); 19 | # 20 | # Tools: ERASER,PEN,HILIGHTER,IMAGE,TEXT,IMAGE,SELECT,SELECT_REGION,SELECT_RECTANGLE,VERTICAL_SPACE,HAND,DEFAULT_TOOL 21 | # Notice: ERASER also has a drop down menu to select the eraser type, SELECT are all selection tools, with drop down menu 22 | # 23 | # Tool settings: SHAPE_RECOGNIZER,RULER,FINE,MEDIUM,THICK,SELECT_FONT 24 | # 25 | # Components: PAGE_SPIN,ZOOM_SLIDER,LAYER 26 | # PAGE_SPIN: The page spiner, incl. current page label 27 | # ZOOM_SLIDER: The zoom slider 28 | # LAYER: The layer dropdown menu 29 | # 30 | 31 | # Portrait: The name in brackets have to be unique, but is not displayed, it should not start with an underline (_) 32 | [Portrait] 33 | # The name of the toolbar, which is display in the menu, can be localized 34 | name = Portrait 35 | # Translated names 36 | name[de] = Hochformat 37 | toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, GOTO_FIRST,GOTO_BACK,GOTO_NEXT_ANNOTATED_PAGE,GOTO_NEXT,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR ,FULLSCREEN, SEPARATOR, SELECT_FONT 38 | toolbarTop2 = PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, FINE,MEDIUM,THICK,SEPARATOR,COLOR(0x000000),COLOR(0x008000),COLOR(0x00c0ff),COLOR(0x00ff00),COLOR(0x3333cc),COLOR(0x808080),COLOR(0xff0000),COLOR(0xff00ff),COLOR(0xff8000),COLOR(0xffff00),COLOR(0xffffff),COLOR_SELECT 39 | toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER, SPACER, TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN 40 | 41 | [Xournal++] 42 | name = Xournal++ 43 | name[de] = Xournal++ 44 | toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, FINE,MEDIUM,THICK,SEPARATOR,COLOR(0x000000),COLOR(0x008000),COLOR(0x00c0ff),COLOR(0x00ff00),COLOR(0x3333cc),COLOR(0x808080),COLOR(0xff0000),COLOR(0xff00ff),COLOR(0xff8000),COLOR(0xffff00),COLOR(0xffffff),COLOR_SELECT, SEPARATOR, SELECT_FONT 45 | toolbarBottom1 = PAGE_SPIN,SEPARATOR,LAYER,GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SPACER, TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN,SEPARATOR, FULLSCREEN 46 | 47 | [Toolbar Left] 48 | name = Toolbar Left 49 | name[de] = Toolbar Links 50 | toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,SEPARATOR, SELECT,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, PAGE_SPIN,SEPARATOR,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR,FULLSCREEN 51 | toolbarLeft1 = COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR,ZOOM_100,ZOOM_FIT,ZOOM_IN,ZOOM_SLIDER,ZOOM_OUT 52 | toolbarLeft2 = FINE,MEDIUM,THICK, SEPARATOR,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN,DRAW_CIRCLE,DRAW_RECTANGLE,DRAW_ARROW,RULER,DRAW_RECTANGLE,VERTICAL_SPACE 53 | 54 | 55 | [Toolbar Right] 56 | name = Toolbar Right 57 | name[de] = Toolbar Rechts 58 | toolbarTop1 = SAVE,NEW,OPEN,SEPARATOR, CUT,COPY,PASTE,SEPARATOR, UNDO,REDO,SEPARATOR, PEN,ERASER,HILIGHTER,IMAGE,TEXT,DRAW,SEPARATOR, SELECT,VERTICAL_SPACE,HAND,SEPARATOR, DEFAULT_TOOL,SEPARATOR, PAGE_SPIN,SEPARATOR, GOTO_FIRST,GOTO_NEXT_ANNOTATED_PAGE,GOTO_LAST,INSERT_NEW_PAGE,DELETE_CURRENT_PAGE,SEPARATOR, LAYER,FULLSCREEN 59 | toolbarRight1 = COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT,SEPARATOR, FINE,MEDIUM,THICK, SEPARATOR,TWO_PAGES,ZOOM_100,ZOOM_FIT,ZOOM_OUT,ZOOM_SLIDER,ZOOM_IN 60 | 61 | [Empty Toolbar] 62 | name = Empty Toolbar 63 | name[de] = Leere Toolbar 64 | 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SurfaceLinuxGoodies 2 | Configs and utilities for Linux users on a Microsoft Surface tablet. 3 | 4 | # Note taking 5 | This section contains everything that might be useful when using the tablet as a note taking device. 6 | 7 | ## Surface Pen purple button 8 | Enables the purple button to be programmed to take an action upon pressing. 9 | Be aware for some reason the pen must be paired each time upon reboot. 10 | 11 | The default action I choose is to send CTRL+z to the active window, which is helping alot with note taking. 12 | 13 | ## pen disable touchscreen 14 | Contains a script and a service (which must be enabled of course) for disabling the touchscreen when the Surface Pen is hovering on the screen. Useful for improved palm rejection. 15 | 16 | ## xournalpp-config 17 | Is just a set of settings I'm comfortable with in xournal++ (autosave settings, custom toolbars, etc...) 18 | 19 | ## config-wacom-libinput 20 | Contains my X11 configuration for using libinput driver for both Touchpad and Touchscreen, while keep using wacom driver for the pen. 21 | 22 | # General usage 23 | 24 | ## Automatic screen rotation 25 | Contains a script and a service (which must be enabled of course) for making it possible to... well it's pretty much self-explicative. 26 | 27 | ## Enable vsync 28 | On integrated Intel gfx, vsync might not be enabled by default. Hence, we see this 'tearing' effect when scrolling contents. 29 | 30 | ## Wi-Fi restart switch 31 | On the Surface Pro 3 (among few others) the wifi kernel drivers are a bit buggy. When launched, this script reloads the kernel module, effectively restarting connectivity (most of the times) 32 | -------------------------------------------------------------------------------- /Utilities/Automatic screen rotation/usr/lib/systemd/system/autorotation.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Autorotation service 3 | After=graphical.target 4 | 5 | [Service] 6 | #EnvironmentFile=/etc/conf.d/sensord 7 | Type=simple 8 | ExecStartPre=/bin/sleep 10 9 | ExecStart=/usr/local/bin/autorotate.sh 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /Utilities/Automatic screen rotation/usr/local/bin/autorotate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rotate="/usr/local/bin/rotate-all.sh" 4 | current="none" 5 | lastr="none" 6 | 7 | accelx=$(find /sys/devices/ -iname "*in_accel_x_raw*") 8 | accely=$(find /sys/devices/ -iname "*in_accel_y_raw*") 9 | 10 | while true; do 11 | 12 | sleep 1 13 | 14 | commandx=$(cat $accelx) 15 | commandy=$(cat $accely) 16 | 17 | if [[ $commandx -gt 500 ]] && [[ $commandx -lt 1020 ]] 18 | then 19 | current="ccw" 20 | elif [[ $commandx -gt 64000 ]] && [[ $commandx -lt 65200 ]] 21 | then 22 | current="cw" 23 | elif [[ $commandy -gt 300 ]] && [[ $commandy -lt 1000 ]] 24 | then 25 | current="half" 26 | elif [[ $commandy -gt 64490 ]] && [[ $commandy -lt 65100 ]] 27 | then 28 | current="none" 29 | fi 30 | 31 | if [[ $lastr != $current ]] 32 | then 33 | echo "auto-rotating $current" 34 | $rotate $current 35 | lastr=$current 36 | fi 37 | 38 | done 39 | -------------------------------------------------------------------------------- /Utilities/Automatic screen rotation/usr/local/bin/rotate-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DISPLAY=':0.0' 4 | export XAUTHORITY="/run/user/1000/gdm/Xauthority" 5 | 6 | if [[ $# -ne 1 ]] 7 | then 8 | echo "You need to specify which way to rotate." 9 | echo "EX: none, half (180 degrees), wc, ccw" 10 | exit 1 11 | fi 12 | 13 | DEFAULTCTM="1 0 0 0 1 0 0 0 1" #default Coordinate Transformation Matrix 14 | leftr="0 -1 1 1 0 0 0 0 1" 15 | rightr="0 1 0 -1 0 1 0 0 1" 16 | upsider="-1 0 1 0 -1 1 0 0 1" 17 | 18 | CTM=$DEFAULTCTM 19 | rotation=$1 20 | 21 | if [[ $rotation == "ccw" ]] 22 | then 23 | CTM=$leftr 24 | xrandr_action="left" 25 | elif [[ $rotation == "cw" ]] 26 | then 27 | CTM=$rightr 28 | xrandr_action="right" 29 | elif [[ $rotation == "none" ]] 30 | then 31 | CTM=$DEFAULTCTM 32 | xrandr_action="normal" 33 | elif [[ $rotation == "half" ]] 34 | then 35 | CTM=$upsider 36 | xrandr_action="inverted" 37 | fi 38 | 39 | xsetwacom set "NTRG0001:01 1B96:1B05 Pen stylus" rotate $rotation 40 | xsetwacom set "NTRG0001:01 1B96:1B05 Pen eraser" rotate $rotation 41 | 42 | xinput set-prop "NTRG0001:01 1B96:1B05" "Coordinate Transformation Matrix" $CTM 43 | xrandr --output eDP1 --rotate $xrandr_action 44 | -------------------------------------------------------------------------------- /Utilities/Enable intel vsync/usr/share/X11/xorg.conf.d/20-intel.conf: -------------------------------------------------------------------------------- 1 | Section "Device" 2 | Identifier "Intel Graphics" 3 | Driver "intel" 4 | Option "AccelMethod" "SNA" 5 | Option "TearFree" "true" 6 | EndSection 7 | -------------------------------------------------------------------------------- /Utilities/Wifi restart switch/usr/local/bin/restart-wifi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | gksu rmmod mwifiex_pcie && sleep 2 && gksu modprobe mwifiex_pcie 3 | -------------------------------------------------------------------------------- /Utilities/Wifi workaround/etc/NetworkManager/conf.d/mwifiex_pcie-randomization.conf: -------------------------------------------------------------------------------- 1 | [device-mac-randomization] 2 | # "yes" is the default for scanning 3 | wifi.scan-rand-mac-address=no 4 | 5 | [connection-mac-randomization] 6 | ## "random" is the default for both 7 | ethernet.cloned-mac-address=permanent 8 | wifi.cloned-mac-address=permanent 9 | 10 | -------------------------------------------------------------------------------- /Utilities/Wifi workaround/etc/systemd/system/wifi-disable-powersave.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Disabling wifi power save 3 | 4 | [Service] 5 | ExecStart=/usr/local/bin/wifi-disable-powersave.sh 6 | Type=oneshot 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | -------------------------------------------------------------------------------- /Utilities/Wifi workaround/usr/local/bin/wifi-disable-powersave.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo iw dev wlp1s0 set power_save off 3 | --------------------------------------------------------------------------------