1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-07-02 20:51:36 +02:00

Compare commits

..

21 Commits

Author SHA1 Message Date
04f9ac187a Shell: Added gitinore creation script 2026-05-31 05:38:11 +02:00
803472b1c9 Zsh/Python: uv now enters venv on init and also sync 2026-05-31 05:08:30 +02:00
6e00342044 Audio: improved script for tapping secondary audio device 2026-05-30 05:06:34 +02:00
d06a7bddf4 Shell: Fixed minor typos in shell scripts 2026-05-23 23:22:23 +02:00
e32eb6eebd Alias: Papis no longer needed due to uv tool 2026-05-19 02:03:16 +02:00
29ac82a412 Nvim: Updated dictionaries 2026-05-16 01:57:23 +02:00
641a124fe3 Zsh: widget for automatic usage of uv with the pip command 2026-05-13 03:19:45 +02:00
71d23fa096 Nvim: Updated dictionaries 2026-05-13 03:18:34 +02:00
8dde717180 Nvim: Updated dictionaries 2026-05-13 01:09:10 +02:00
a148a5a7a4 Nvim: Updated dictionaries 2026-05-11 01:48:54 +02:00
3118f9d40f Nvim: Made Molten more robust 2026-05-08 02:57:54 +02:00
f11f68c751 Zsh/Nvim: made python handling more readably 2026-05-08 02:39:44 +02:00
ec77543d6b Nvim: Updated dictionaries 2026-05-08 02:33:23 +02:00
b82bfff551 Zsh/Nvim: python is now mapped to uv run python using Zsh widgets and the compiler script for Nvim 2026-05-08 02:33:06 +02:00
d579220afd Merge branch 'master' of github:tiyn/dotfiles 2026-05-06 03:44:28 +02:00
0aab087f11 Zsh: Added widgets for mkcd and improved uv init 2026-05-06 03:44:20 +02:00
b2fd0f3b25 Nvim: Updated dictionaries 2026-05-05 12:29:01 +02:00
1bc5e80e40 Nvim: Updated dictionaries 2026-05-04 01:50:04 +02:00
ac9f4465f6 Nvim: Updated dictionaries 2026-05-03 23:58:07 +02:00
37e4d7faa6 Nvim: Fixed merge conflict 2026-05-03 18:36:53 +02:00
a8daed6c20 Nvim: Updated dictionaries 2026-05-03 02:27:34 +02:00
11 changed files with 595 additions and 179 deletions

View File

@@ -74,11 +74,11 @@ alias contacts="khard"
# kolourpaint # kolourpaint
alias paint="kolourpaint" alias paint="kolourpaint"
# ls(d) # ls
alias l="exa --group-directories-first --icons" alias l="eza --group-directories-first --icons"
alias la="exa -la --group-directories-first --icons --git" alias la="eza -la --group-directories-first --icons --git"
alias ll="exa -l --group-directories-first --icons --git" alias ll="eza -l --group-directories-first --icons --git"
alias tree="exa --tree --group-directories-first --icons" alias tree="eza --tree --group-directories-first --icons"
# mkdir # mkdir
alias mkdir="mkdir -p" alias mkdir="mkdir -p"
@@ -99,9 +99,6 @@ alias octave="octave --persist"
# pacman # pacman
alias pac="sudo pacman" alias pac="sudo pacman"
# papis
alias papis='PYTHONWARNINGS=ignore::DeprecationWarning python -m papis'
# ping # ping
alias ping="ping -c 5" alias ping="ping -c 5"

161
.config/gitignore/python Normal file
View File

@@ -0,0 +1,161 @@
# Created by https://www.toptal.com/developers/gitignore/api/venv,python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# .python-version
# pipenv
#Pipfile.lock
# poetry
#poetry.lock
# pdm
#pdm.lock
.pdm.toml
# PEP 582
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
#.idea/
### Python Patch ###
poetry.toml
# ruff
.ruff_cache/
# LSP config files
pyrightconfig.json
### venv ###
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json

View File

@@ -17,6 +17,7 @@ Dom
Dreams Dreams
Embedding Embedding
Entlebucher Entlebucher
Eskortflug
Extraction Extraction
For For
Formatter Formatter
@@ -26,7 +27,10 @@ Genervtheit
Gestresstheit Gestresstheit
Gym Gym
Handwerksunternehmen Handwerksunternehmen
Higher-Up
Higher-Ups
Homeserver Homeserver
Hot
Immigrationsgeschichte Immigrationsgeschichte
Impro Impro
Improtheater Improtheater
@@ -38,6 +42,7 @@ Ira
Jahreszeitenunterschied Jahreszeitenunterschied
Jahreszeitenunterschiede Jahreszeitenunterschiede
Kardinälin Kardinälin
Keycap
Kreatindosis Kreatindosis
Königinnensubstanz Königinnensubstanz
Loop Loop
@@ -49,6 +54,7 @@ Meta
Mods Mods
Mono Mono
Ne Ne
Nights
Orgas Orgas
Paper Paper
Platformer Platformer
@@ -92,6 +98,7 @@ be
bürgerlicher bürgerlicher
bürgerlichere bürgerlichere
bürgerlicheren bürgerlicheren
cosplayt
cyber cyber
egozentristisch egozentristisch
en en

View File

@@ -1,5 +1,6 @@
AI AI
APV APV
Abdulkarim
Accuracy Accuracy
Agentic Agentic
Akallabêth Akallabêth
@@ -13,6 +14,8 @@ Arrabbiata
Asiahung Asiahung
Aule Aule
Aules Aules
Autoencoder
Babybel
Baez Baez
Barros Barros
Beater Beater
@@ -29,6 +32,7 @@ Brusch
CAR CAR
CATS CATS
CDSS CDSS
CORE
CUDA CUDA
Carré Carré
Casper Casper
@@ -36,6 +40,7 @@ Caspers
Cato Cato
CdE CdE
CdEs CdEs
Cewe
Chrysalis Chrysalis
Color Color
Combi Combi
@@ -49,13 +54,15 @@ Darth
DeepSeek DeepSeek
Dekarldent Dekarldent
Delivery Delivery
Destiny 2 Destiny
Distrobox Distrobox
Doom Doom
Doyma Doyma
Dressler
EasyEffects EasyEffects
Eckhoff Eckhoff
Edain Edain
Edibles
Elodie Elodie
Ernsting's Ernsting's
Euphoria Euphoria
@@ -108,12 +115,16 @@ JT
Jacobin Jacobin
Jeanine Jeanine
Jojen Jojen
Jungjohann
Karamasov Karamasov
Keep Keep
Keycap
Kingdoms Kingdoms
Kluge Kluge
KohakuHub KohakuHub
Kratom Kratom
KreativAkademie
Kreyenbrück
Kreyenhop Kreyenhop
Kubitschek Kubitschek
Käte Käte
@@ -124,11 +135,13 @@ Lanz
Later Later
Lemmie Lemmie
Lemmies Lemmies
Letterboxd
LightDM LightDM
LightDM-GTK-Greeter LightDM-GTK-Greeter
LightDM-Mini-Greeter LightDM-Mini-Greeter
LilyPond LilyPond
Line Dance Line Dance
Loafer
Lounge Lounge
MEVIS MEVIS
MTG MTG
@@ -146,6 +159,7 @@ Meshtastic
Metzener Metzener
MiiMii MiiMii
Mint Mint
Mukluk
MusikAka MusikAka
MusikAkademie MusikAkademie
NVIM NVIM
@@ -156,6 +170,7 @@ Neovim
NetworkManager NetworkManager
NextCloud NextCloud
Nim Nim
Njinmah
Nobody Nobody
Noel Noel
North North
@@ -182,6 +197,7 @@ Pluribus
PopOS PopOS
Portainer Portainer
Power Power
Pratik
Precision Precision
Precon Precon
Precons Precons
@@ -191,6 +207,7 @@ Rebowl
Reed Reed
Reeves Reeves
Reichenecker Reichenecker
Rida
Rocq Rocq
Ruschenbaum Ruschenbaum
SDS SDS
@@ -228,6 +245,7 @@ Tornow
TrackPoint TrackPoint
Traefik Traefik
UDEV UDEV
UMAP
Umbar Umbar
V1del V1del
VIM VIM
@@ -243,6 +261,7 @@ WinterAkademie
Writhing Writhing
X.Org X.Org
Years Years
Yorma
Ziegeleiweg Ziegeleiweg
Zimin Zimin
and and

View File

@@ -22,13 +22,24 @@ return {
vim.schedule(function() vim.schedule(function()
local kernels = vim.fn.MoltenAvailableKernels() local kernels = vim.fn.MoltenAvailableKernels()
local try_kernel_name = function() local try_kernel_name = function()
local metadata = vim.json.decode(io.open(e.file, "r"):read("a"))["metadata"] local f = io.open(e.file, "r")
return metadata.kernelspec.name if not f then
return nil
end
local content = f:read("*a")
f:close()
local ok, decoded = pcall(vim.json.decode, content)
if not ok then
return nil
end
return decoded.metadata
and decoded.metadata.kernelspec
and decoded.metadata.kernelspec.name
end end
local ok, kernel_name = pcall(try_kernel_name) local ok, kernel_name = pcall(try_kernel_name)
if not ok or not vim.tbl_contains(kernels, kernel_name) then if not ok or not vim.tbl_contains(kernels, kernel_name) then
kernel_name = nil kernel_name = nil
local venv = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") local venv = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or ".venv"
if venv ~= nil then if venv ~= nil then
kernel_name = string.match(venv, "/.+/(.+)") kernel_name = string.match(venv, "/.+/(.+)")
end end

View File

@@ -29,11 +29,7 @@ return {
require("symbol-usage").setup({ require("symbol-usage").setup({
text_format = text_format, text_format = text_format,
<<<<<<< HEAD
vt_position = "end_of_line", vt_position = "end_of_line",
||||||| 6714ddc
=======
>>>>>>> f01c70951e053d56cbfed781149becf3f9299a3f
}) })
end, end,
} }

View File

@@ -2,16 +2,16 @@
# HELPER FUNCTIONS # # HELPER FUNCTIONS #
#################### ####################
precmd_vcs_info() { vcs_info } precmd_vcs_info() { vcs_info; }
precmd_functions+=( precmd_vcs_info ) precmd_functions+=(precmd_vcs_info)
zle-line-init() { zle-line-init() {
zle -K viins zle -K viins
echo -ne "\e[5 q" echo -ne "\e[5 q"
} }
preexec() { echo -ne '\e[5 q' ;} preexec() { echo -ne '\e[5 q'; }
local copy_widgets=( local copy_widgets=(
vi-yank vi-yank-eol vi-delete vi-backward-kill-word vi-change-whole-line vi-yank vi-yank-eol vi-delete vi-backward-kill-word vi-change-whole-line
@@ -59,23 +59,23 @@ function +vi-git-st() {
local ahead behind remote local ahead behind remote
local -a gitstatus local -a gitstatus
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \ remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
--symbolic-full-name 2>/dev/null)/refs\/remotes\/} --symbolic-full-name 2>/dev/null)/refs\/remotes\//}
if [[ -n ${remote} ]] ; then if [[ -n ${remote} ]]; then
# for git prior to 1.7 # for git prior to 1.7
# ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l) # ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l)
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
(( $ahead )) && gitstatus+=( " ${c3}+${ahead}${c2}" ) (($ahead)) && gitstatus+=(" ${c3}+${ahead}${c2}")
# for git prior to 1.7 # for git prior to 1.7
# behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l) # behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l)
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
(( $behind )) && gitstatus+=( "${c4}-${behind}${c2}" ) (($behind)) && gitstatus+=("${c4}-${behind}${c2}")
hook_com[branch]="${hook_com[branch]} [${remote}${(j:/:)gitstatus}]" hook_com[branch]="${hook_com[branch]} [${remote}${(j:/:)gitstatus}]"
fi fi
} }
function +vi-git-stash() { function +vi-git-stash() {
local -a stashes local -a stashes
if [[ -s ${hook_com[base]}/.git/refs/stash ]] ; then if [[ -s ${hook_com[base]}/.git/refs/stash ]]; then
stashes=$(git stash list 2>/dev/null | wc -l) stashes=$(git stash list 2>/dev/null | wc -l)
hook_com[misc]+=" (${stashes} stashed)" hook_com[misc]+=" (${stashes} stashed)"
fi fi
@@ -85,12 +85,99 @@ function +vi-git-stash() {
# CUSTOM WIDGETS # # CUSTOM WIDGETS #
################## ##################
mkcd() {
mkdir -p -- "$1" &&
cd -- "$1"
}
uv() {
if [[ "$1" == "init" ]]; then
shift
if [[ "$1" == "--normal" ]]; then
shift
command uv init "$@"
else
command uv init --bare "$@" || return
if [[ $# -eq 0 ]]; then
command uv venv || return
_auto_venv
fi
fi
elif [[ "$1" == "sync" ]]; then
shift
command uv sync "$@" || return
_auto_venv
else
command uv "$@"
fi
}
find_python_root() {
local target="$1"
local dir
if [[ -n "$target" && -e "$target" ]]; then
dir="$(cd "$(dirname "$target")" && pwd)"
else
dir="$PWD"
fi
while [[ "$dir" != "/" ]]; do
if [[ -f "$dir/.python-version" ]] || [[ -f "$dir/pyproject.toml" ]]; then
echo "$dir"
return 0
fi
dir="$(dirname "$dir")"
done
return 1
}
uvshim() {
local cmd="$1"
shift
local uv_root=""
local first_arg="$1"
uv_root="$(find_python_root "$first_arg")"
if [[ -n "$uv_root" ]]; then
uv run --project "$uv_root" "$cmd" "$@"
else
command -- "$cmd" "$@"
fi
}
python() { uvshim python "$@"; }
python3() { uvshim python3 "$@"; }
pip() {
local uv_root
uv_root="$(find_python_root)"
if [[ -n "$uv_root" ]]; then
if [[ "$1" == "install" ]]; then
shift
uv add "$@"
else
uv pip "$@"
fi
else
command pip "$@"
fi
}
_find_venv_upwards() { _find_venv_upwards() {
local dir="$PWD" local dir="$PWD"
while [[ "$dir" != "/" ]]; do while [[ "$dir" != "/" ]]; do
if [[ -f "$dir/pyvenv.cfg" ]]; then if [[ -f "$dir/.venv/pyvenv.cfg" ]]; then
echo "$dir" echo "$dir/.venv"
return return
fi fi
dir=$(dirname "$dir") dir=$(dirname "$dir")
@@ -308,17 +395,14 @@ autoload -Uz compinit && compinit
# open shell with tmux always # open shell with tmux always
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
tmux attack-session -t $USER || tmux new-session -s $USER tmux attach-session -t $USER || tmux new-session -s $USER
fi fi
# thefuck # thefuck
eval $(thefuck --alias) eval $(thefuck --alias)
# python
eval "$(pyenv init -)"
# opam # opam
[[ ! -r "$HOME/.opam/opam-init/init.zsh" ]] || source "$HOME/.opam/opam-init/init.zsh" > /dev/null 2> /dev/null [[ ! -r "$HOME/.opam/opam-init/init.zsh" ]] || source "$HOME/.opam/opam-init/init.zsh" >/dev/null 2>/dev/null
########################## ##########################
# COMMANDS BEFORE PROMPT # # COMMANDS BEFORE PROMPT #

136
.local/bin/etc/gitignore Executable file
View File

@@ -0,0 +1,136 @@
#!/bin/sh
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/gitignore"
usage() {
cat <<EOF
Usage:
gitignore TEMPLATE...
Create a new .gitignore from templates.
gitignore -f TEMPLATE...
Overwrite existing .gitignore.
gitignore --add TEMPLATE...
Append templates to existing .gitignore.
gitignore --list
List available templates.
gitignore --show TEMPLATE
Show a template.
Templates are searched in:
$CONFIG_DIR
EOF
}
list_templates() {
[ -d "$CONFIG_DIR" ] || exit 0
find "$CONFIG_DIR" -type f -exec basename {} \; | sort
}
show_template() {
file="$CONFIG_DIR/$1"
if [ ! -f "$file" ]; then
echo "Unknown template: $1" >&2
exit 1
fi
cat "$file"
}
append_template() {
template="$1"
file="$CONFIG_DIR/$template"
if [ ! -f "$file" ]; then
echo "Unknown template: $template" >&2
exit 1
fi
{
echo
echo "# --- $template ---"
cat "$file"
} >> .gitignore
}
create_gitignore() {
mode="$1"
shift
if [ -f .gitignore ] && [ "$mode" != "force" ]; then
echo ".gitignore already exists." >&2
echo "Use -f to overwrite or --add to append." >&2
exit 1
fi
: > .gitignore
for template in "$@"; do
append_template "$template"
done
}
add_templates() {
[ -f .gitignore ] || touch .gitignore
for template in "$@"; do
append_template "$template"
done
}
case "$1" in
--help|-h)
usage
;;
--list)
list_templates
;;
--show)
shift
[ $# -eq 1 ] || {
echo "--show requires exactly one template" >&2
exit 1
}
show_template "$1"
;;
--add)
shift
[ $# -gt 0 ] || {
echo "No templates specified" >&2
exit 1
}
add_templates "$@"
;;
-f)
shift
[ $# -gt 0 ] || {
echo "No templates specified" >&2
exit 1
}
create_gitignore force "$@"
;;
"")
usage
exit 1
;;
*)
create_gitignore normal "$@"
;;
esac

View File

@@ -14,43 +14,60 @@ vipercmd="carbon" #"silicon"
cd "$dir" || exit cd "$dir" || exit
textype() { \ has_python_version() {
dir="$PWD"
while [ "$dir" != "/" ]; do
if [ -f "$dir/.python-version" ] || [ -f "$dir/pyproject.toml" ]; then
return 0
fi
dir=$(dirname "$dir")
done
return 1
}
textype() {
command="pdflatex --shell-escape" command="pdflatex --shell-escape"
( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" (sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex"
$command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" &&
grep -i addbibresource "$file" >/dev/null && grep -i addbibresource "$file" >/dev/null &&
biber --input-directory "$dir" "$base" && biber --input-directory "$dir" "$base" &&
$command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" &&
makeglossaries "$basenodir" && makeglossaries "$basenodir" &&
$command --output-directory="$dir" "$base" $command --output-directory="$dir" "$base"
} }
case "$file" in case "$file" in
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;; *\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf >"$base".pdf ;;
*\.bash) bash "$file" ;; *\.bash) bash "$file" ;;
*\.go) go run "$file" ;; *\.go) go run "$file" ;;
*\.lua) lua "$file" ;; *\.lua) lua "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;; *\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf >"$base".pdf ;;
*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;; *\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf >"$base".pdf ;;
*\.py) python3 "$file" ;; *\.py)
*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; if has_python_version; then
*\.sent) setsid sent "$file" 2>/dev/null & ;; uv run python "$file"
*config.h) sudo make install ;; else
*\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;; python3 "$file"
*\.java) java "$file" ;; fi
*\.js) node "$file" ;; ;;
*\.m) octave -qW "$file" ;; *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;;
*\.nim) nim c -r -d:noColors "$file" ;; *\.sent) setsid sent "$file" 2>/dev/null & ;;
*\.r|*\.R) Rscript "$file" ;; *config.h) sudo make install ;;
*\.rs) (cd "$dir" && cargo locate-project >/dev/null 2>&1) \ *\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;;
&& (cd "$(dirname "$(cd "$dir" && cargo locate-project --message-format plain)")" && cargo run) \ *\.java) java "$file" ;;
|| (rustc "$file" && "./$(basename "${file%.rs}")") ;; *\.js) node "$file" ;;
*\.sh) dash "$file" ;; *\.m) octave -qW "$file" ;;
*\.smt2) z3 "$file" ;; *\.nim) nim c -r -d:noColors "$file" ;;
*\.tex) textype "$file" ;; *\.r | *\.R) Rscript "$file" ;;
*\.vpr) $vipercmd "$file" ;; *\.rs) (cd "$dir" && cargo locate-project >/dev/null 2>&1) &&
*\.zsh) zsh "$file" ;; (cd "$(dirname "$(cd "$dir" && cargo locate-project --message-format plain)")" && cargo run) ||
*\.ly) lilypond "$file" ;; (rustc "$file" && "./$(basename "${file%.rs}")") ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; *\.sh) dash "$file" ;;
*\.smt2) z3 "$file" ;;
*\.tex) textype "$file" ;;
*\.vpr) $vipercmd "$file" ;;
*\.zsh) zsh "$file" ;;
*\.ly) lilypond "$file" ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac esac

View File

@@ -7,8 +7,8 @@
device=${LOOPBACK_DEVICE:-Easy Effects Source} device=${LOOPBACK_DEVICE:-Easy Effects Source}
name=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | sed -e "s/*/\ /g") name=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | sed -e "s/*/\ /g")
id=$( echo $name | cut -d '.' -f 1 | cut -c 5-) ident=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | grep -oE '[0-9]+\.' | tr -d '.')
node=$(wpctl inspect $id | grep node.name | cut -d '=' -f 2) node=$(wpctl inspect $ident | grep node.name | cut -d '=' -f 2)
[ -z "$2" ] && num="5" || num="$2" [ -z "$2" ] && num="5" || num="$2"
@@ -61,7 +61,7 @@ case "$1" in
loop) playerctl loop none loop) playerctl loop none
sleep 1 sleep 1
pkill -RTMIN+9 $STATUSBAR ;; pkill -RTMIN+9 $STATUSBAR ;;
tap) wpctl set-volume $id 1.0 tap) wpctl set-volume $ident 1.0
touch ~/.local/state/loopback.lock touch ~/.local/state/loopback.lock
pw-loopback -C $node & pw-loopback -C $node &
notify-send -u low 'sxhkd' "Started loopback of $device" ;; notify-send -u low 'sxhkd' "Started loopback of $device" ;;

View File

@@ -72,18 +72,6 @@ export VIPER_CARBON=""
export VIPER_Z3="/bin/z3" export VIPER_Z3="/bin/z3"
export VIPER_BOOGIE="$HOME/.dotnet/tools/boogie" export VIPER_BOOGIE="$HOME/.dotnet/tools/boogie"
# python
export PYENV_ROOT="$HOME/.pyenv"
if [ -d "$PYENV_ROOT" ] && [ -x "PYENV_ROOT/bin/pyenv" ]; then
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v timeout >/DEV/NULL 2>&1; then
timeout 2s -c sh -c 'eval "$($PYENV_ROOT/bin/pyenv init --path)"' 2>/dev/null
else
eval "$($PYENV_ROOT/bin/pyenv init --path 2>/dev/null)" || true
fi
fi
# less/man colors # less/man colors
export LESS=-R export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"; a="${a%_}" export LESS_TERMCAP_mb="$(printf '%b' '')"; a="${a%_}"