Compare commits

...

17 Commits

Author SHA1 Message Date
a4a1f44e4e scanner: add wrapper script 2025-06-20 15:20:55 +02:00
93f5122723 a5ona4: fix and simplify script to work with newer pdflatex versions 2025-06-15 11:36:03 +02:00
951eebe79b dunst: update to new syntax 2024-12-09 18:17:40 +01:00
5bf85682ed nvim: fix vimtex not being able to start autocompiler due to airlatex 2024-10-25 14:52:24 +02:00
75e7744f01 startmpv: support rumble by first starting yt-dlp separately 2024-10-10 11:33:27 +02:00
56e4a5ebfb picom: fix unfocussed images being darker 2024-10-07 15:03:06 +02:00
76e72f4d46 mpv: printout marked files using the "M" key similar to sxiv 2024-09-20 10:31:32 +02:00
a73c95b3a6 papis: fix ref for jinja2 after PR has been merged 2024-09-19 11:42:06 +02:00
562a454d63 papis: fix author key read-in for now 2024-09-18 13:36:53 +02:00
1dcd003a8d papis: refs are <AuthorLastName><Year><Title15chars> 2024-09-18 12:34:47 +02:00
52af3677cf statusbar: fix vpnstatus not showing inside of ETH network (non-vpn) 2024-09-17 10:45:24 +02:00
c12e14fb65 nvim: no inlay hints for variables in python 2024-09-16 10:56:42 +02:00
7d07cb92de nvim: add coc-settings.json 2024-09-16 10:53:19 +02:00
4188c07932 statusbar: fix vpnstatus never showing 2024-09-09 15:17:43 +02:00
585f192551 papis: file-formatted to <year>-<first_author>-<title> 2024-08-25 14:50:41 +02:00
809a7210e0 mpd: persist queue between restarts using state file 2024-08-25 13:05:46 +02:00
162bce097d zathura: yank filename using "y" 2024-08-18 21:13:58 +02:00
13 changed files with 99 additions and 34 deletions

View File

@ -27,13 +27,13 @@
width = 300
# The maximum height of a single notification, excluding the frame.
height = 300
height = (0, 300)
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 0x26
offset = (0, 26)
# Scale factor. It is auto-detected if value is 0.
scale = 0

View File

@ -1,5 +1,6 @@
music_directory "~/msc"
playlist_directory "~/.config/mpd/playlists"
state_file "~/.local/share/mpd/state"
auto_update "yes"
bind_to_address "127.0.0.1"

View File

@ -0,0 +1,30 @@
-- mpv script to mark videos
local utils = require 'mp.utils'
local marked_videos = {}
local marked_file = "marked"
function toggle_mark()
local path = mp.get_property("path")
if marked_videos[path] then
marked_videos[path] = nil
mp.osd_message("Unmarked: " .. path)
else
marked_videos[path] = true
mp.osd_message("Marked: " .. path)
end
end
function save_marks()
-- Do not write anything if "marked_videos" is empty
if next(marked_videos) == nil then
return
end
local file = io.open(marked_file, "a")
for path, _ in pairs(marked_videos) do
file:write(path .. "\n")
end
file:close()
end
mp.add_key_binding("M", "toggle_mark", toggle_mark)
mp.register_event("shutdown", save_marks)

View File

@ -1,5 +1,6 @@
{
"suggest.enablePreselect": false,
"suggest.noselect": true,
"svelte.enable-ts-plugin": true
"svelte.enable-ts-plugin": true,
"pyright.inlayHints.variableTypes": false
}

View File

@ -1,4 +1,5 @@
let mapleader =","
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..."
@ -7,6 +8,8 @@ if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autolo
autocmd VimEnter * PlugInstall
endif
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
@ -28,10 +31,11 @@ Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'github/copilot.vim',
Plug 'dmadisetti/AirLatex.vim', {'branch': 'main'}
Plug 'nathangrigg/vim-beancount'
call plug#end()
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
set title
set bg=light
set go=a
@ -124,7 +128,7 @@ let g:jukit_convert_open_default = -1
let g:jukit_hist_use_ueberzug = 0
" - Set to 1 to use Überzug to display saved outputs instead of an ipython split window
let g:jukit_ueberzug_use_cached = 0
let g:jukit_ueberzug_use_cached = 1
" - Whether to cache created images of saved outputs. If set to 0, will convert saved outputs to png from scratch each time. Note that this will make displaying saved outputs significantly slower.
let g:jukit_ueberzug_pos = [0.25, 0.25, 0.4, 0.6]
" - position and dimension of Überzug window WITH output split present - [x, y, width, height]. Use `:call jukit#ueberzug#set_default_pos()` to modify/visualize.
@ -145,7 +149,7 @@ let g:jukit_ueberzug_jupyter_cmd = 'jupyter'
" - path to jupyter executable. By default it just uses the jupyter command found in your environment. If you started an output split in a virtual environment, make sure that you either have jupyter installed in that environment or set the absolute path to the python3 command.
let g:jukit_ueberzug_cutycapt_cmd = 'CutyCapt'
" - path to cutycapt executable
let g:jukit_ueberzug_imagemagick_cmd = 'convert'
let g:jukit_ueberzug_imagemagick_cmd = 'magick'
" - path to imagemagick (`convert` command) executable
" Nerd tree
@ -166,12 +170,6 @@ let R_start_libs = 'base,stats,graphics,grDevices,utils,methods'
let R_hl_term = 0
" let Rout_more_colors = 1
" AirLatex
" your login-name
" let g:AirLatexCookieDB="~/.mozilla/firefox/do0jepvp.default-release/cookies.sqlite"
let g:AirLatexCookie="cookies:overleaf2_session=s%3AtveT0u3Xn8VXTJmkUuSpO2p1o5SLGNYI.ARSAQd4K%2FO7L5ilui54Ht7voJWjD%2BxctQ1ngTRrlo6A"
" let g:AirLatexUsername="cookies:overleaf_session2=s%3AMANcnaAAj4VeIgXsNIiCINZ0QgwtYNzn.9x0PVRqOp8egbGYpnIHuffJUxmH%2F%2F2W%2FFnTBPmDny1M"
"This allows for change paste motion cp{motion}
nmap <silent> cp :set opfunc=ChangePaste<CR>g@
function! ChangePaste(type, ...)
@ -179,11 +177,6 @@ function! ChangePaste(type, ...)
silent exe "normal! p"
endfunction
" optional: set server name
let g:AirLatexDomain="www.overleaf.com"
let g:AirLatexAllowInsecure=0
" vimtex:
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_latexmk = { 'build_dir' : '',

34
.config/papis/config Normal file
View File

@ -0,0 +1,34 @@
[papers]
dir = ~/dox/papers
extra-bibtex-keys = ["doc_url"]
use-git = True
formatter = jinja2
# Format folder & file in format <year>-<last_name_first_author>-<paper_title>
add-file-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
add-folder-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
ref-format = {{doc.author_list[0].family if doc.author_list else "AUTHOR MISSING"}}{{doc.year}}{{doc.title.title().translate(None, ' -')[:15]}}
# Defaults simply converted to jinja2
header-format = <ansired>{{doc.html_escape.title}}</ansired>\n <ansigreen>{{doc.html_escape.author}}</ansigreen>\n <ansiblue>({{doc.html_escape.year}})</ansiblue> [<ansiyellow>{{doc.html_escape.tags}}</ansiyellow>]
match-format = {{doc.tags}}{{doc.subfolder}}{{doc.title}}{{doc.author}}{{doc.year}}
document-description-format = {{doc.title}} - {{doc.author}}
multiple-authors-format = {{au.family}}, {{au.given}}
browse-query-format = {{doc.title}} {{doc.author}}
notes-name = notes.md
[books]
dir = ~/dox/books
add-file-name = {doc[author]}{doc[title]}
use-git = True
[settings]
opentool = rifle
default-library = papers
file-browser = ranger
[tui]
editmode = vi
options_list.selected_margin_style = bg:ansigreen fg:ansired
options_list.unselected_margin_style =

View File

@ -101,7 +101,7 @@ fade-out-step = 0.03;
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.8;
inactive-opacity = 1.0;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0

View File

@ -16,3 +16,4 @@ map g goto top
map <C-s> exec zathura_backward_search.sh
map <A-Return> exec "openfilebrowser $FILE"
map <C-h> exec "movepdf $FILE"
map y exec "copyfilepath $FILE"

2
.local/bin/scanner Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
QT_SCALE_FACTOR=1.6666666666666666 skanlite

View File

@ -1,5 +1,5 @@
#!/bin/bash
pgrep openconnect > /dev/null || if ping -c 1 -W 1 -q webprint.ethz.ch > /dev/null
if ping -c 1 -W 1 -q webprint.ethz.ch > /dev/null;
then
printf '🔬'
fi

View File

@ -5,19 +5,8 @@ for file in $@; do
cp -f "$file" $INPUTPDF
printf '\\documentclass[a4paper,final]{article}
\\usepackage{pdfpages}
\\usepackage{ifpdf,ifxetex,everyshi}
\\makeatletter
\\ifpdf
\\EveryShipout{\\ifodd\\c@page\\else\\pdfpageattr{/Rotate 180}\\fi}%%
\\fi
\\ifxetex
\\EveryShipout{\\ifodd\\c@page\\special{pdf: put @thispage << /Rotate 180 >>}%%
\\fi
}
\\fi
\\makeatother
\\begin{document}
\\includepdf[pages=-, nup=1x2, booklet=true, landscape]{%s}
\\includepdf[pages=-, nup=2x1, booklet=true, landscape]{%s}
\\end{document}' "$INPUTPDF" > /tmp/tmp$$.tex
cd /tmp || exit
pdflatex /tmp/tmp$$.tex

3
.local/bin/tools/copyfilepath Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
printf %s "$*" | xclip -selection clipboard &&
notify-send "Copied to clipboard: $*"

View File

@ -14,6 +14,17 @@ if echo "$1" | grep -qE 'youtube.*list'; then
sed 's/^/https:\/\/www.youtube.com\/watch?v=/' |
xargs mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' ||
notify-send "startmpv" "An error has occured with playlist $playlist_id"
elif echo "$1" | grep -qE 'rumble.com'; then
notify-send "startmpv" "Rumble videos are not supported by mpv, first ripping, then playing..."
(
cd /tmp
yt-dlp "$1" &
# get the filename of the downloaded video
filename="$(yt-dlp -e "$1")"
sleep 5
mpv /tmp/$filename*part
rm /tmp/$filename*part
)
else
mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1"
fi