Compare commits

...

2 Commits

Author SHA1 Message Date
31e7c23c8d
Adding and configuring minimap.vim 2023-02-08 11:51:12 -05:00
ebb5b6db13
Attempt to udev better 2023-02-08 11:51:12 -05:00
4 changed files with 36 additions and 7 deletions

View File

@ -1,3 +1,5 @@
SUDO ?= sudo
TOP_SOURCES := $(shell git ls-files | grep -vE 'README|Makefile|^config|^\.git|^\.travis' | grep -v /)
CONFIG_SOURCES := $(shell git ls-files config)
LOCAL_BIN_SOURCES := $(shell git ls-files local/bin)
@ -5,7 +7,9 @@ TARGETS := \
$(patsubst %,$(HOME)/.%,$(TOP_SOURCES)) \
$(patsubst %,$(HOME)/.%,$(CONFIG_SOURCES)) \
$(patsubst %,$(HOME)/.%,$(LOCAL_BIN_SOURCES)) \
$(HOME)/.config/i3/config
$(HOME)/.config/i3/config \
/etc/udev/rules.d/90-trackman-marble.rules \
/usr/local/bin/handle-trackman-marble
$(HOME)/.%: %
$(RM) '$@' && mkdir -p $(dir $@) && ln -svf '$(PWD)/$^' '$@'
@ -19,6 +23,12 @@ $(HOME)/.config:
$(HOME)/.local/bin:
mkdir -p $@
/etc/udev/rules.d/90-trackman-marble.rules: udev/rules.d/90-trackman-marble.rules
$(SUDO) install -m 0644 -v udev/rules.d/90-trackman-marble.rules $@
/usr/local/bin/handle-trackman-marble: udev/handle-trackman-marble
$(SUDO) install -m 0644 -v udev/handle-trackman-marble $@
.PHONY: echo
echo:
@echo TOP_SOURCES=$(TOP_SOURCES)

View File

@ -1,14 +1,17 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
main() {
export RUNNING_AS="${RUNNING_AS:-me}"
export RUNNING_AS_ID="$(id -u "${RUNNING_AS}")"
export XINPUT_EXE="${XINPUT_EXE:=xinput}"
export RUNNING_AS="${RUNNING_AS:-dan}"
RUNNING_AS_ID="$(id -u "${RUNNING_AS}")"
export RUNNING_AS_ID
export XAUTHORITY="/home/${RUNNING_AS}/.Xauthority"
export XINPUT_EXE="${XINPUT_EXE:=xinput}"
export XAUTHORITY="/run/user/${RUNNING_AS_ID}/gdm/Xauthority"
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUNNING_AS_ID}/bus"
export DISPLAY=:0
: "${DISPLAY:=0}"
export DISPLAY
export HOME="/home/${RUNNING_AS}"
@ -25,8 +28,14 @@ main() {
__get_prop_id "${device_id}" 'Scroll Method Enabled'
)"
local scrollbutton
scrollbutton="$(
__get_prop_id "${device_id}" 'Button Scrolling Button'
)"
__run_xinput_as set-prop "${device_id}" "${natscroll_enabled}" 1
__run_xinput_as set-prop "${device_id}" "${scrollmeth_enabled}" 0 0 1
__run_xinput_as set-prop "${device_id}" "${scrollbutton}" 8
}
__get_device_id() {

View File

@ -1 +1 @@
ACTION=="bind", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="Logitech", ENV{ID_SERIAL}=="Logitech_USB_Trackball", RUN:="/usr/local/bin/handle-trackman-marble"
ACTION=="bind", SUBSYSTEM=="usb", ENV{NAME}=="Logitech USB Trackball", MODE="0660", TAG+="uaccess", RUN:="/usr/local/bin/handle-trackman-marble"

10
vimrc
View File

@ -68,6 +68,8 @@ au FileType go nmap <leader>R :GoReferrers<CR>
map <leader>t :w<CR>
map <leader>- :nohl<CR>
map <leader>w :%s/ *$//<CR>
map <leader>l :Minimap<CR>
map <leader>L :MinimapClose<CR>
au FileType python nmap <leader>t :Black<CR>:w<CR>
@ -88,6 +90,12 @@ let g:go_highlight_operators = 1
let g:go_info_mode='gopls'
let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc"
let g:minimap_auto_start = 1
let g:minimap_auto_start_win_enter = 1
let g:minimap_highlight_range = 1
let g:minimap_highlight_search = 1
let g:minimap_enable_highlight_colorgroup = 1
let g:minimap_width = 10
let g:python_highlight_all = 1
let g:rustfmt_autosave = 1
let g:shfmt_extra_args = '-i 2'
@ -102,6 +110,8 @@ packadd! dracula
colorscheme dracula
hi Comment cterm=NONE ctermfg=DarkRed gui=NONE guifg=red2
hi minimapCursor ctermbg=59 ctermfg=228 guibg=#5F5F5F guifg=#FFFF87
hi minimapRange ctermbg=242 ctermfg=228 guibg=#4F4F4F guifg=#FFFF87
nmap <leader>sp :call <SID>SynStack()<CR>
function! <SID>SynStack()