Compare commits

...

71 Commits

Author SHA1 Message Date
dd079c4ef2 pg 2026-01-03 21:55:47 +00:00
732cdffd25 packages 2025-11-04 14:00:17 +00:00
22c64e10a0 aliases 2025-11-04 00:24:15 +00:00
88302b9bca cliphist 2025-10-26 10:43:48 +00:00
7023046b63 fix 2025-10-26 03:37:58 +00:00
6fd661f286 fix 2025-10-26 03:16:52 +00:00
882a27b1cb colors 2025-10-26 02:41:07 +00:00
dd11cd9253 exec, colors 2025-10-26 02:28:38 +00:00
bfb053a4ef run.sh 2025-10-26 01:11:17 +00:00
6d5bb72149 calc migration 2025-10-26 00:39:16 +00:00
ee9d27147e run.sh add space for tab completion 2025-10-26 00:31:51 +00:00
f4dd706b6a bemenu -> wmenu 2025-10-26 00:11:49 +00:00
dc4de3e6b8 bemenu -> wmenu 2025-10-25 23:30:01 +00:00
67a6e5fa53 interval 2025-10-25 15:48:16 +00:00
20abc74f48 i3blocks 2025-10-25 14:18:56 +00:00
178608bb04 i3blocks scripts 2025-10-24 22:00:38 +00:00
d5dc5f651e merge 2025-10-24 20:54:54 +00:00
0a4c5c39f9 configs 2025-10-24 20:53:57 +00:00
533cafa56d configs 2025-10-21 18:36:09 +00:00
b1d63d0e67 Merge branch 'main' of git.yrz.am:yrzam/workspace 2025-10-16 17:54:44 +00:00
3778dc20fe fzf 2025-10-16 17:54:20 +00:00
38d44f03d3 minor structural improvements 2025-10-12 18:54:08 +00:00
ee1c79f088 formatting 2025-10-12 13:36:32 +00:00
4fc1f7cc6c fix 2025-10-06 00:13:04 +00:00
17079f021c use different separator for constitency 2025-10-05 20:15:36 +00:00
825ed5263c wssh 2025-10-05 19:42:36 +00:00
06660b992f configs 2025-10-04 14:54:06 +00:00
0ed437b0ea config 2025-10-02 23:02:02 +00:00
316a3ff9e4 uncommited 2025-10-02 07:46:48 +00:00
4b4d7a684c compat 2025-09-29 20:57:11 +00:00
b5a41d9ae0 wscompat 2025-09-29 20:39:27 +00:00
a833ef01eb uncommited 2025-09-29 12:23:34 +00:00
c9dbae4c0c movements 2025-09-28 23:49:17 +00:00
bc031c5bb8 fixes 2025-09-28 23:07:59 +00:00
3398c6b4ef revamp compat 2025-09-28 22:08:05 +00:00
6bf779a68e fixes 2025-09-26 05:08:39 +00:00
d8eae8a1a5 config 2025-09-22 22:19:32 +00:00
5c078feab5 configs 2025-09-21 23:19:49 +00:00
119632adfd fix 2025-09-18 06:06:04 +00:00
bf5a01b1e7 configs 2025-09-16 04:26:57 +00:00
5f827671f1 config 2025-09-15 18:52:54 +00:00
acfaf08000 configs 2025-09-09 04:59:17 +00:00
26770fbc77 bindings 2025-08-17 14:31:57 +00:00
24ec5904fe bemenu 2025-07-06 00:22:16 +00:00
14263c00b2 revamp run sh 2025-07-05 23:11:30 +00:00
56b3f093db fix 2025-06-27 23:01:02 +00:00
78ff179a25 fixes 2025-06-27 22:59:02 +00:00
ec4433827a style 2025-06-27 18:10:35 +00:00
3fc6f3e225 fix 2025-06-26 23:19:53 +00:00
e30caf308a idle 2025-06-26 23:15:33 +00:00
5f4011b63a fix 2025-06-26 22:26:14 +00:00
539681260b theme 2025-06-26 22:14:36 +00:00
54836c9435 aichat 2025-06-22 22:35:30 +00:00
e5d95820a7 themes 2025-06-22 18:38:52 +00:00
2feac52b39 keybinds 2025-06-13 13:37:52 +00:00
df63c246ff Merge branch 'main' of git.yrz.am:yrzam/workspace 2025-06-13 12:44:19 +00:00
85628b5acc i3blocks login info 2025-06-13 01:00:22 +00:00
5305539a3f term pipe keybinds 2025-06-13 00:36:40 +00:00
2eea5707bd unify command-mode keybinds, add terminal keybinds 2025-06-13 00:02:48 +00:00
6811313bf1 colors, fixes 2025-06-12 20:21:33 +00:00
5d10729945 fonts 2025-06-09 12:11:05 +00:00
9da09b8d81 autocommit 2025-06-09 11:35:35 +00:00
72f91d0395 autocommit 2025-06-09 11:25:00 +00:00
09ed42abc7 autocommit 2025-06-08 23:08:22 +00:00
0b3a513191 autocommit 2025-06-08 23:02:16 +00:00
4f869f4ac3 autocommit 2025-06-08 22:06:54 +00:00
719baaf847 scripts 2025-06-05 13:01:49 +00:00
dd52f1afe6 add qemu package, reorg package list 2025-05-31 15:13:33 +00:00
d2798fd99b xkb: do not nullify unused keys 2025-05-27 08:38:53 +00:00
2dd96e8315 browser: set default search engine to google 2025-05-25 11:41:45 +00:00
2b6d45f099 gen compat 2025-05-25 11:41:06 +00:00
74 changed files with 1203 additions and 937 deletions

View File

@@ -112,7 +112,4 @@ passwd <username>
23. login, `sudo su`
24. Uncomment locale in `/etc/locale.gen`, run `locale-gen`
25. `echo "<name>" > /etc/hostname`
26. `systemctl enable NetworkManager --now`
27. Enable and sync time: `systemctl enable systemd-timesyncd --now`
28. Get tz from `tzselect`, set via `timedatectl set-timezone [tz]`
29. Update hwclock: `hwclock -w --utc`
26. Get tz from `tzselect`, set via `timedatectl set-timezone [tz]`

View File

@@ -4,38 +4,35 @@ cd "$(dirname "$(readlink -f -- "$0")")/_install"
PACKAGES=(
# system
linux base linux-firmware lvm2 sudo polkit # base
pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # device management
openssh man-db htop # admin utils
openssh rsync strace sysstat htop screen man-db which dnsutils # system
# generic runtime
nodejs dash
nodejs dash jq # runtime
qemu-system-x86 # virt
postgresql #db
rlwrap fzf # shell helpers
vifm vim less # nav & edit
vim-ale vim-fugitive # vim plugins
# cli programs
vifm vim less # navigation & editors
just shellcheck # shell scripting
hugo miniserve neomutt translate-shell # www
gnupg pass pass-otp # crypt
jq libqalculate imagemagick # data processing
git zip # others
git zip # storage
bc xxd # data processing
gnupg pass pass-otp pwgen # crypt
imv mpv imagemagick gimp # media
aichat libqalculate translate-shell # utils
libreoffice-still # docs
qutebrowser qt6-wayland # web browsing
hugo miniserve # web utils
neomutt telegram-desktop # communication
# desktop env
greetd sway swaybg swayidle # basic
foot bemenu-wayland i3blocks mako libnotify # terminals, ui
wev wl-clipboard wtype slurp grim # interaction
ttf-roboto ttf-roboto-mono ttf-font-awesome # fonts
# gui apps
imv mpv gimp # media
qutebrowser qt6-wayland # www
sqlitebrowser qt5-wayland # db
# extensions
vim-ale vim-fugitive
# not so good
telegram-desktop libreoffice-still
greetd sway swaybg swayidle # desktop basic
alacritty wmenu i3blocks mako libnotify # terminals, ui
wev wl-clipboard cliphist wtype slurp grim # interaction
ttf-roboto ttf-roboto-mono otf-font-awesome # fonts
kvantum kvantum-qt5 kvantum-theme-materia materia-gtk-theme # themes
)
@@ -70,7 +67,7 @@ while read -r entity; do
etype="${entity_parts[0]}"
ename="${entity_parts[1]}"
eid="${entity_parts[2]}"
[ "$etype" != "user" ] && [ "$etype" != "group" ] && echo "ERROR: bad entity type" >&2 && exit 1
[ "$etype" != "user" ] && [ "$etype" != "group" ] && echo "ERROR: bad entity type $etype" >&2 && exit 1
# every user has their own primary group with id matching uid,
# so for each entry we need a usergroup

14
arch-user/bin/ai Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
role="$1"
shift
session_ts="$(date +%s)"
if [ -n "$1" ]; then
aichat --save-session --session "$session_ts" --role "$role" "$@"
fi
while true; do
read -e -r -p "> " input
aichat --save-session --session "$session_ts" --role "$role" "$input"
done

View File

@@ -1,33 +0,0 @@
#!/bin/bash
set -e
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ]; then
echo "bad args" >&2
exit 1
fi
DEST=$(realpath "$2")
cd "$1"
#shellcheck disable=SC2016
find . \
-type f \
-not -path '*/.*' \
-path "$3" | \
xargs -0 -d \\n -n 1 sh -c "mkdir -p $DEST/\$(dirname \"\$1\")" sh
#shellcheck disable=SC2016
find . \
-type f \
-not -path '*/.*' \
-path "$3" \
-printf "$(pwd)/%P\n$DEST/%P\n" | \
xargs -0 -d \\n -n 2 sh -c "$4" sh
#for rel in $(find . -type f -name *.gpg); do
# DESTFILE=$(echo $DEST/$rel | sed 's/\.[^.]*$//')
# [ -f "$DESTFILE" ] && continue
# mkdir -p "$(dirname "$DESTFILE")"
# gpg --output "$DESTFILE" --decrypt "$rel"
#done

109
arch-user/bin/backup Executable file
View File

@@ -0,0 +1,109 @@
#!/bin/bash
set -e
source ~/.config/workspace.conf
key_vol_path="/dev/disk/by-uuid/$BACKUP_KEY_VOL_UUID"
data_vol_path="/dev/disk/by-uuid/$BACKUP_DATA_VOL_UUID"
data_mnt=
remote_open() {
data_mapper_name="$(lsblk "$data_vol_path" -no name --raw | awk 'NR==2')"
key_mnt="$(lsblk "$key_vol_path" -no mountpoint)"
if [ -z "$data_mapper_name" ]; then
echo unlocking data luks vol..
if [ -z "$key_mnt" ]; then
echo mounting key vol..
udisksctl mount -b "$key_vol_path"
key_mnt="$(lsblk "$key_vol_path" -no mountpoint)"
fi
echo decrypting key..
gpg --batch --yes --output /tmp/backup-keyfile --decrypt "$key_mnt/keyfile.gpg"
udisksctl unlock -b "$data_vol_path" --key-file /tmp/backup-keyfile
data_mapper_name="$(lsblk "$data_vol_path" -no name --raw | awk 'NR==2')"
echo unlock ok, doing key cleanup
fi
rm -f /tmp/backup-keyfile
[ -n "$key_mnt" ] && udisksctl unmount -b "$key_vol_path"
data_mnt="$(lsblk "/dev/mapper/$data_mapper_name" -no mountpoint)"
if [ -z "$data_mnt" ]; then
echo mounting data vol..
udisksctl mount -b "/dev/mapper/$data_mapper_name"
data_mnt="$(lsblk "/dev/mapper/$data_mapper_name" -no mountpoint)"
fi
echo open done
}
remote_close() {
data_mapper_name="$(lsblk "$data_vol_path" -no name --raw | awk 'NR==2')"
if [ -n "$data_mapper_name" ]; then
echo unmounting data vol..
udisksctl unmount -b "/dev/mapper/$data_mapper_name"
fi
udisksctl lock -b "$data_vol_path" # must be open here (fail if not)
echo close done
}
declare -A repos
add_repos_local() {
while IFS= read -r -d $'\0'; do
repo_path="$REPLY"
[ ! -f "$repo_path/HEAD" ] && continue
repo_path="$(realpath "$(dirname "$repo_path")")"
repos["$repo_path"]=1
done < <(find "$@" -type d -name .git -print0)
}
add_repos_remote() {
cd "$1"
while IFS= read -r -d $'\0'; do
repo_path="$REPLY"
[ ! -f "$repo_path/HEAD" ] && continue
repo_path="/$(dirname "$repo_path")"
[[ ! " $(groups) " == *" $(echo "$repo_path" | cut -d'/' -f3) "* ]] && continue
repos["$repo_path"]=1
done < <(find "home" -type d -name '*.git' -print0 2>/dev/null)
}
sync_one() {
local_path="$1"
remote_path="$2$1/$(basename "$1").git"
echo "$local_path <-> $remote_path"
remote_url="file:///$remote_path"
if [ ! -d "$local_path" ]; then
mkdir -p "$(dirname "$local_path")"
git clone "$remote_url" "$local_path"
else
cd "$local_path"
git add .
git diff-index --quiet HEAD || git commit -m autocommit || true
if [ ! -d "$remote_path" ]; then
mkdir -p "$(dirname "$remote_path")"
git clone --bare "file:///$1" "$remote_path"
else
git pull "$remote_url"
git push "$remote_url"
fi
fi
}
sync_repos() {
for i in "${!repos[@]}"; do
sync_one "$i" "$1"
sync -f "$1"
done
}
if [[ "$1" = "open" ]]; then
remote_open
exit 0
fi
remote_open
add_repos_remote "$data_mnt"
for g in $(groups); do
[ -d "/home/$g/dev" ] && add_repos_local "/home/$g/dev" -maxdepth 2
[ -d "/home/$g/know" ] && add_repos_local "/home/$g/know" -maxdepth 2
done
sync_repos "$data_mnt"
remote_close
echo ALL OK

View File

@@ -1,13 +0,0 @@
#!/bin/bash
set -e
if [ -z "$PASSPHRASE" ]; then
read -srp "Password: " PASSPHRASE
echo
fi
export PASSPHRASE
bash ~/.local/bin/alg/file-tree-apply.sh "$1" "$2" '*.gpg' \
'if [ ! -f "$2" ]; then gpg --decrypt "$1" | gpg --symmetric --output "$2" --passphrase "$PASSPHRASE" --batch --yes; fi'
echo ok

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env bash
# https://github.com/vivien/i3blocks-contrib/blob/master/bandwidth/bandwidth
# Copyright (C) 2012 Stefan Breunig <stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de>
# Copyright (C) 2014 kaueraal
# Copyright (C) 2015 Thiago Perrotta <perrotta dot thiago at poli dot ufrj dot br>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Get custom IN and OUT labels if provided by command line arguments
INLABEL="🠟 "
OUTLABEL="🠝 "
# Use the provided interface, otherwise the device used for the default route.
if [[ -z $INTERFACE ]] && [[ -n $BLOCK_INSTANCE ]]; then
INTERFACE=$BLOCK_INSTANCE
elif [[ -z $INTERFACE ]]; then
INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }')
fi
# Exit if there is no default route
[[ -z "$INTERFACE" ]] && exit
# Issue #36 compliant.
if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || \
(! [ "$TREAT_UNKNOWN_AS_UP" = "1" ] &&
! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ])
then
echo "$INTERFACE down"
echo "$INTERFACE down"
echo "#FF0000"
exit 0
fi
# path to store the old results in
path="/tmp/$(basename $0)-${INTERFACE}"
# grabbing data for each adapter.
read rx < "/sys/class/net/${INTERFACE}/statistics/rx_bytes"
read tx < "/sys/class/net/${INTERFACE}/statistics/tx_bytes"
# get time
time="$(date +%s)"
# write current data if file does not exist. Do not exit, this will cause
# problems if this file is sourced instead of executed as another process.
if ! [[ -f "${path}" ]]; then
echo "${time} ${rx} ${tx}" > "${path}"
chmod 0666 "${path}"
fi
# read previous state and update data storage
read old < "${path}"
echo "${time} ${rx} ${tx}" > "${path}"
# parse old data and calc time passed
old=(${old//;/ })
time_diff=$(( $time - ${old[0]} ))
# sanity check: has a positive amount of time passed
[[ "${time_diff}" -gt 0 ]] || exit
# calc bytes transferred, and their rate in byte/s
rx_diff=$(( $rx - ${old[1]} ))
tx_diff=$(( $tx - ${old[2]} ))
rx_rate=$(( $rx_diff / $time_diff ))
tx_rate=$(( $tx_diff / $time_diff ))
# shift by 10 bytes to get KiB/s. If the value is larger than
# 1024^2 = 1048576, then display MiB/s instead
# incoming
echo -n "$INLABEL"
rx_kib=$(( $rx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$rx_rate" -gt 1048576 ]]; then
printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`"
else
echo -n "${rx_kib}K"
fi
echo -n " "
# outgoing
echo -n "$OUTLABEL"
tx_kib=$(( $tx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$tx_rate" -gt 1048576 ]]; then
printf '%sM\n' "`echo "scale=1; $tx_kib / 1024" | bc`"
else
echo "${tx_kib}K"
fi

View File

@@ -10,5 +10,7 @@ if [ "$stat" = "1" ]; then
echo "🔌 $cap% ${w}W"
else
echo "🔋 $cap% ${w}W"
[ "$cap" -lt "15" ] && exit 33
if [ "$cap" -lt "15" ]; then
exit 33
fi
fi

View File

@@ -1,3 +0,0 @@
#!/bin/bash
curl "https://wttr.in/?format=%l;%t%20%p" --silent | sed 's/^\(.\{3\}\)\(.*\);/\1 /'
echo

View File

@@ -0,0 +1,2 @@
#!/bin/sh
eval "wmenu $WMENU_HOPTS \"$@\""

View File

@@ -1,4 +1,6 @@
#!/bin/bash -efu
# based on https://github.com/legionus/pinentry-bash/blob/master/pinentry-bash
### This file is covered by the GNU General Public License,
### which should be included with libshell as the file LICENSE.
### All copyright information are listed in the COPYING.
@@ -6,13 +8,13 @@
#exec 2>/tmp/pinentry.log
#set -x
############################### PATCH #################################
. ~/.config/menu/env.sh
#######################################################################
VERSION='1.0'
FLAVOR='bash'
############################### PATCH #################################
. ~/.config/bemenu/env.sh
#######################################################################
keyinfo=''
error=''
timeout=0
@@ -123,9 +125,8 @@ cmd_getpin()
output="$(
echo -n "|"
############################### PATCH #################################
bemenu \
--password indicator \
--prompt "${prompt:-$def_prompt}" \
~/.local/bin/menu/horizontal.sh \
-Pp "${prompt:-$def_prompt}" \
</dev/null | tr -d '\n'
ret=${PIPESTATUS[0]}
# yad \

19
arch-user/bin/menu/run-calc.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
shift
query="$1"
if [ -z "$query" ]; then
query="$(echo "tui" | ~/.local/bin/menu/horizontal.sh -p "qalc")"
fi
if [ "$query" = "tui" ]; then
exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "qalc"
elif [ -n "$query" ]; then
qalc_res="$(qalc --terse "$query")"
menu_res="$(echo -e "$qalc_res\ntui" | ~/.local/bin/menu/horizontal.sh -p "qalc")"
if [ "$qalc_res" = "$menu_res" ]; then
wl-copy "$qalc_res"
notify-send "$qalc_res" -a calc "Result copied to clipboard"
elif [ -n "$menu_res" ]; then
"$0" _ "$menu_res"
fi
fi

View File

@@ -0,0 +1,21 @@
#!/bin/bash
if [ "$*" = "screenshot output" ]; then
mon="$(swaymsg -t get_outputs | jq -r '. | map(select(.focused == true)) | .[0].name')"
outfile="screenshot-$(date +%s).png"
grim -o "$mon" - | tee ~/tmp/"$outfile" | wl-copy -t image/png
notify-send Done -a screenshot "Saved to tmp/$outfile\nCopied to clipboard"
elif [ "$*" = "screenshot selection" ]; then
outfile="screenshot-$(date +%s).png"
grim -g "$(slurp)" - | tee ~/tmp/"$outfile" | wl-copy -t image/png
notify-send Done -a screenshot "Saved to tmp/$outfile\nCopied to clipboard"
elif [ "$*" = "pick-color" ]; then
hex="$(
grim -g "$(slurp -p)" -t ppm - | \
magick - -format '%[pixel:p{0,0}]' txt:- | \
tail -n 1 | \
cut -d ' ' -f 4
)"
echo -n "$hex" | wl-copy
notify-send "$hex" -a screenshot "Color code copied to clipboard"
fi

View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "$SHELL" -c '"$@"; { echo "[exited with code $?]"; read -n1; }' -- "$@"

View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "$SHELL" -c '"$@"' -- "$@"

15
arch-user/bin/menu/run-man.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
shift
page="$1"
if [ -z "$page" ]; then
page="$(
apropos -s 1,5,8 . | \
~/.local/bin/menu/vertical.sh -p "man" | \
sed 's/ (\([^)]*\)).*/.\1/'
)"
if [ -z "$page" ]; then
exec ~/.local/bin/menu/run.sh
fi
fi
exec ~/.local/bin/menu/run-float-sh.sh "man" "$page"

13
arch-user/bin/menu/run-pass.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -e
cd "$PASSWORD_STORE_DIR"
pws="$(find -path "*/.*" -prune -o -path "*/cred/*" -name "*.gpg" -printf '%P\n' | sed 's/\.gpg$//')"
pw="$(echo "$pws" | ~/.local/bin/menu/vertical.sh -p "pass")"
case "$2" in
info) ~/.local/bin/menu/run-float-sh.sh sh -c "pass $pw | vim -";;
otp) pass otp -c "$pw" && notify-send "$pw" -a pass "OTP copied to clipboard, clears in 45s";;
*) pass -c "$pw" && notify-send "$pw" -a pass "Password copied to clipboard, clears in 45s";;
esac

10
arch-user/bin/menu/run-power.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
sure() {
echo yes | ~/.local/bin/menu/horizontal.sh -p "sure?" || exec ~/.local/bin/menu/run.sh
}
case "$1" in
poweroff|reboot|suspend) sure && systemctl "$@";;
logout) sure && swaymsg exit;;
esac

20
arch-user/bin/menu/run.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
rl_full="$(cat ~/.config/menu/*.runlist)"
rl="$(echo "$rl_full" | cut -d' ' -f2-)"
inp="$(echo "$rl" | sed 's/$/ /' | ~/.local/bin/menu/vertical.sh -p ">")"
[ -z "$inp" ] && exit 0
eval "inp_arr=($inp)"
exectr=float-sh-keep
while IFS= read -r line; do
if [[ "$inp" == "$line"* ]]; then
exectr="$(echo "$rl_full" | grep -F "$line" -m 1 | cut -d' ' -f1)"
fi
done <<< "$rl"
case "$exectr" in
exec) exec $inp;;
*) bash "$HOME/.local/bin/menu/run-$exectr.sh" "${inp_arr[@]}" || notify-send "Executor error" -a run.sh "exec: $exectr\nargs: ${inp_arr[@]}\ncode: $?"
esac

4
arch-user/bin/menu/vertical.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
input=$(cat)
lines=$(echo "$input" | wc -l)
echo "$input" | eval "wmenu $WMENU_VOPTS -l $((lines < 50 ? lines : 50)) \"$@\""

16
arch-user/bin/postgres/start.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -eo pipefail
if [ "$1" != "foreground" ]; then
exec ~/.local/bin/screen/detach.sh postgres "$0" foreground
fi
version="$(pg_config --version | sed -n 's/^PostgreSQL \([0-9]*\).*/\1/p')"
export PGDATA=~/know/db/"$version"
mkdir -p "$PGDATA"
if [ ! -f "$PGDATA/postgresql.conf" ]; then
initdb
fi
postgres -c "unix_socket_directories=/run/user/$(id -u)" -c "listen_addresses=" -c "io_method=sync"

4
arch-user/bin/psql.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
psql -h "/run/user/$(id -u)" "$1"

26
arch-user/bin/qemu/arch.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ -z "$1" ]; then
echo Error: no name >&2
exit 1
fi
if ! screen -ls | grep -q qemu-arch; then
screen-detach "qemu-arch-$1" \
qemu-system-x86_64 "$HOME/lfs/vm/$1" \
-display none \
-m 2G \
-accel kvm -cpu host \
-net nic -net user,hostfwd=tcp:127.0.0.1:2222-:22
fi
screen -ls | grep qemu-arch
if ! screen -ls | grep -q "qemu-arch-$1"; then
echo Error: another kind is running >&2
exit 1
fi
while true; do
ssh arch@127.0.0.1 -p 2222 && break
sleep 5
done

View File

@@ -1,211 +0,0 @@
#!/bin/bash
LIST=();
# gui
if [ "$USER" = "yrzam" ]; then
LIST+=(
"web" "web projects"
"web" "web life"
)
WEB_HAS_PROFILES=1
else
LIST+=(
"web" "web"
)
fi
LIST+=(
"gui" "telegram-desktop"
"gui" "gimp"
"gui" "sqlitebrowser"
# tui
"shell_tui" "vifm"
"shell_tui" "vim"
"tui" "htop"
"float_tui" "nmtui"
"float_tui" "bluetoothctl"
"man" "man"
"float_tui" "node"
"term" "term"
# native
"screen_pick" "screenshot output"
"screen_pick" "screenshot selection"
"screen_pick" "color-picker"
"todo" "pass"
"calc" "calc"
"todo" "translate ru-en"
"todo" "translate en-ru"
"grep_dict" "dict"
)
if [ "$FEAT_BRIGHTNESS" ]; then
LIST+=(
"brightness" "brightness"
)
fi
LIST+=(
"direct" "sway reload"
"power" "logout"
"todo" "inhibit"
"power" "suspend"
"power" "poweroff"
"power" "poweroff --check-inhibitors=no"
"power" "reboot"
)
sure() {
echo yes | bemenu --prompt "sure?"
}
# generic
exec_gui() {
exec "$@"
}
exec_tui() {
exec footclient -D ~/ "$@"
}
exec_float_tui() { # todo
exec footclient --app-id="footclient_float" -D ~/ "$@"
}
exec_shell_tui() {
exec footclient -D ~/ "$SHELL" -c "$@"
}
exec_shell_full() {
exec footclient -D ~/ "$SHELL" -c "($1); read -n1"
}
exec_direct() {
exec "$@"
}
exec_term() {
exec footclient -D ~/
}
# custom
exec_web() {
shift
if [ "$WEB_HAS_PROFILES" ]; then
shift
fi
qutebrowser "$*"
}
exec_man() {
shift
page="$1"
if [ -z "$page" ]; then
page="$(
man -k . | \
bemenu --prompt "man" | \
sed ' s/\s\+\-.*//;s/ //g'
)"
fi
[ -n "$page" ] && exec footclient "$SHELL" -c "man '$page' || read -n1"
}
exec_screen_pick() {
if [ "$*" = "screenshot output" ]; then
mon="$(swaymsg -t get_outputs | jq -r '. | map(select(.focused == true)) | .[0].name')"
grim -o "$mon" - | wl-copy -t image/png
notify-send Done -a screenshot "PNG image copied to clipboard" -t 3000
elif [ "$*" = "screenshot selection" ]; then
grim -g "$(slurp)" - | wl-copy -t image/png
notify-send Done -a screenshot "PNG image copied to clipboard" -t 3000
elif [ "$*" = "color-picker" ]; then
hex="$(
grim -g "$(slurp -p)" -t ppm - | \
magick - -format '%[pixel:p{0,0}]' txt:- | \
tail -n 1 | \
cut -d ' ' -f 4
)"
notify-send "$hex" -a screenshot "stnrit" -t 3000
fi
}
exec_pass() {
echo 1
}
exec_calc() {
shift
query="$1"
if [ -z "$query" ]; then
query="$(echo "tui" | bemenu --prompt "qalc")"
fi
if [ "$query" = "tui" ]; then
exec_float_tui "qalc"
elif [ -n "$query" ]; then
qalc_res="$(qalc --terse "$query")"
menu_res="$(echo -e "$qalc_res\ntui" | bemenu --prompt "qalc")"
if [ "$qalc_res" = "$menu_res" ]; then
wl-copy "$qalc_res"
notify-send "$qalc_res" -a calc "Result copied to clipboard" -t 3000
elif [ -n "$menu_res" ]; then
exec_calc _ "$menu_res"
fi
fi
}
exec_transl() {
echo 1
}
exec_grep_dict() {
shift
dict="$1"
pattern="$2"
dicts_path="$HOME/know/dict/"
if [ -z "$dict" ]; then
dict="$(find "$dicts_path" -type f -printf "%f\n" | bemenu --prompt "dict")"
[ -z "$dict" ] && return
fi
if [ -z "$pattern" ]; then
pattern="$(echo -n | bemenu --prompt "grep $dict")"
[ -z "$pattern" ] && return
fi
res="$({ echo ..; grep "$pattern" "$dicts_path/$dict"; } | bemenu --prompt " ")"
if [ "$res" = ".." ]; then
exec_grep_dict _ "$dict"
else
wl-copy "$res"
notify-send "$res" -a dict "Word copied to clipboard" -t 3000
fi
}
exec_brightness() {
shift
target="$1"
if [ -z "$target" ]; then
current="$(($(brightnessctl g)*100/$(brightnessctl m)))"
current_i="$((current/5))"
list="$(echo 1%; seq 5 5 100 | sed 's/$/%/')";
target="$(echo "$list" | bemenu --index $current_i --prompt "$current% ->")";
fi
if [ -n "$target" ] && [ "$target" != "$current%" ]; then
brightnessctl set "$target"
[ -z "$1" ] && exec_brightness _
fi
}
exec_power() {
case "$1" in
poweroff|reboot|suspend) sure && systemctl "$@";;
logout) sure && swaymsg exit;;
esac
}
if [ -n "$1" ]; then
out="$*";
else
out=$(
for (( i=1; i<${#LIST[@]}; i+=2 )); do
echo "${LIST[$i]}";
done | bemenu --prompt ">"
)
fi
if [ "$out" ]; then
for (( i=1; i<${#LIST[@]}; i+=2 )); do
if [[ "$out" == "${LIST[$i]}"* ]]; then
executor=${LIST[$((i-1))]}
fi
done
[ -z "$executor" ] && executor=shell_full
if [ "$executor" = "shell_full" ]; then
"exec_$executor" "$out"
else
eval "executor_args=($out)"
#shellcheck disable=SC2154
"exec_$executor" "${executor_args[@]}"
fi
fi

9
arch-user/bin/screen/detach.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
session_name="$1"
shift
tmpfile=$(mktemp)
cmd="$(printf "%q " "$@")"
qcmd="$(printf "%q " "$cmd")"
echo -e ". ~/.bashrc\nhistory -s "$qcmd"\necho "$qcmd"\n$cmd && exit" > "$tmpfile"
screen -S "$session_name" -dm bash --init-file "$tmpfile"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
out="$(printf '' | bemenu --prompt ':sway')"
out="$(printf '' | ~/.local/bin/menu/horizontal.sh -p ':sway')"
eval "executor_args=($out)"
#shellcheck disable=SC2154
sway "${executor_args[@]}"

View File

@@ -0,0 +1,21 @@
#!/bin/bash
parent_has_sibl=$(swaymsg -t get_tree | jq '
def check_focused(parent; grandparent):
if .focused then
if grandparent and (grandparent.type == "con" or grandparent.type == "workspace") and (grandparent.nodes | length) > 1 then 1 else 0 end
else
. as $current |
((.nodes[]? | check_focused($current; parent)),
(.floating_nodes[]? | check_focused($current; parent)))
end;
first(check_focused(null; null) // 0)
')
#echo "$parent_has_sibl"
if [ "$parent_has_sibl" = 1 ]; then
swaymsg "focus parent; focus $1 sibling; focus child"
else
swaymsg "focus $1 sibling; focus child"
fi

View File

@@ -0,0 +1,7 @@
#!/bin/sh
item="$(cliphist list | ~/.local/bin/menu/vertical.sh -p paste)"
if [ -n "$item" ]; then
echo "$item" | cliphist decode | wl-copy
wtype -M ctrl v -m ctrl
fi

View File

@@ -0,0 +1,54 @@
get_windows_with_workspace() {
swaymsg -t get_tree | jq -r '
def calc_ws_name(ws_name):
if ws_name == "__i3_scratch" then "_"
elif (ws_name | test("^[0-9]+:")) then (ws_name | sub("^[0-9]+:"; ""))
else ws_name
end;
def get_windows(workspace_name):
if (.type == "con" or .type == "floating_con") and .pid != null and (.name // "") != "" then
{
id: .id,
name: .name | ascii_downcase,
app_id: (.app_id // .window_properties.class // "unknown") | ascii_downcase,
workspace: workspace_name,
focused: .focused
}
else empty end,
(.nodes[]? | get_windows(workspace_name)),
(.floating_nodes[]? | get_windows(workspace_name));
def traverse_all:
if .type == "workspace" then
. as $ws | (.name | calc_ws_name(.)) as $ws_name | get_windows($ws_name)
else empty end,
(.nodes[]? | traverse_all);
traverse_all |
"\(.id)|\(.app_id)|\(.name)|\(.workspace)|\(.focused)"
'
}
window_list=$(get_windows_with_workspace)
formatted_list=$(echo "$window_list" | while IFS='|' read -r id app_id name workspace focused; do
if [ "$focused" = "true" ]; then
indicator="> "
else
indicator=" "
fi
printf "%s%s%s %s %s\n" "$workspace" "$indicator" "$id" "$app_id" "$name"
done)
selection=$(echo "$formatted_list" | ~/.local/bin/menu/vertical.sh -p "/")
[ -z "$selection" ] && exit 0
window_id=$(echo "$selection" | sed -E 's/^...([0-9]+).*/\1/')
if [ -n "$window_id" ]; then
swaymsg "[con_id=\"$window_id\"] focus"
else
echo "Failed to extract window ID."
exit 1
fi

View File

@@ -0,0 +1,2 @@
vim -c 'redir > ~/tmp/vim-highlight.dump' -c 'silent! highlight' -c 'redir END' -c 'q'
echo >> ~/tmp/vim-highlight.dump

34
arch-user/bin/wssh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
set -e
if [ $# -lt 1 ]; then
echo "Usage: $0 <hostname> [ssh-options]"
exit 1
fi
if [[ "$*" == *" -- "* ]]; then
exec /bin/ssh "$@"
fi
[ -z "$WSCOMPAT_MASTER" ] && WSCOMPAT_MASTER="$(whoami)"
read -r -d '' init_cmd << WSCOMPAT_EOF_9oqn7IVF || true
export WS_IS_COMPAT=1
export WSCOMPAT_MASTER="$WSCOMPAT_MASTER"
export WSCOMPAT_DIR="/tmp/wscompat_${WSCOMPAT_MASTER}_\$(whoami)"
rm -rf "\$WSCOMPAT_DIR" && mkdir -p "\$WSCOMPAT_DIR" && chmod 700 "\$WSCOMPAT_DIR"
cat << 'WSCOMPAT_EOF_84EbM3la' > "\$WSCOMPAT_DIR/profile"
$(
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$WSCOMPAT_DIR/profile"
for file in "$WSCOMPAT_DIR/profile"*.sh; do
if [ -f "$file" ]; then
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$file"
fi
done
)
WSCOMPAT_EOF_84EbM3la
. \$WSCOMPAT_DIR/profile
# pam, systemd - wrap in login shell
exec /bin/bash --login --norc --noprofile -c "exec /bin/bash --rcfile \"\$WSCOMPAT_DIR/bashrc\""
WSCOMPAT_EOF_9oqn7IVF
exec /bin/ssh -t "$@" "$init_cmd"

141
arch-user/bin/wsudo Executable file
View File

@@ -0,0 +1,141 @@
#!/bin/bash
parse() {
sudo_user="root"
sudo_command=""
sudo_login_shell=""
local args=("$@")
local i=0
local arg_count=${#args[@]}
expand_flags() {
local expanded=()
for arg in "$@"; do
if [[ $arg =~ ^-[a-zA-Z]{2,}$ ]]; then
local chars="${arg:1}"
for ((j=0; j<${#chars}; j++)); do
expanded+=("-${chars:$j:1}")
done
else
expanded+=("$arg")
fi
done
args=("${expanded[@]}")
arg_count=${#args[@]}
}
expand_flags "$@"
while [[ $i -lt $arg_count ]]; do
case "${args[$i]}" in
-u|--user)
((i++))
if [[ $i -lt $arg_count ]]; then
sudo_user="${args[$i]}"
fi
((i++));;
-i|--login)
sudo_login_shell=true
((i++));;
-s|--shell)
((i++));;
--)
((i++))
sudo_command="${args[*]:$i}"
break;;
-*)
((i++));;
su)
((i++))
local su_user=""
local su_args=()
while [[ $i -lt $arg_count ]]; do
su_args+=("${args[$i]}")
((i++))
done
local su_expanded=()
for arg in "${su_args[@]}"; do
if [[ $arg =~ ^-[a-zA-Z]{2,}$ ]]; then
local chars="${arg:1}"
for ((j=0; j<${#chars}; j++)); do
su_expanded+=("-${chars:$j:1}")
done
else
su_expanded+=("$arg")
fi
done
local k=0
local su_count=${#su_expanded[@]}
while [[ $k -lt $su_count ]]; do
case "${su_expanded[$k]}" in
-|-l|--login)
sudo_login_shell=true
((k++));;
-c|--command)
((k++))
if [[ $k -lt $su_count ]]; then
sudo_command="${su_expanded[$k]}"
((k++))
fi;;
--session-command=*)
sudo_command="${su_expanded[$k]#*=}"
((k++));;
-m|-p|--preserve-environment)
((k++));;
-s|--shell)
((k++))
if [[ $k -lt $su_count && "${su_expanded[$k]}" != -* ]]; then
((k++))
fi;;
-*)
((k++));;
*)
if [[ -z "$su_user" ]]; then
su_user="${su_expanded[$k]}"
((k++))
else
((k++))
fi;;
esac
done
if [[ -n "$su_user" ]]; then
sudo_user="$su_user"
fi
break;;
*)
sudo_command="${args[*]:$i}"
break;;
esac
done
}
parse "$@"
[ -z "$WSCOMPAT_MASTER" ] && WSCOMPAT_MASTER="$(whoami)"
read -r -d '' init_cmd << WSCOMPAT_EOF_ahkiem3K || true
export WS_IS_COMPAT=1
export WSCOMPAT_MASTER="$WSCOMPAT_MASTER"
export WSCOMPAT_DIR="/tmp/wscompat_${WSCOMPAT_MASTER}_\$(whoami)"
rm -rf "\$WSCOMPAT_DIR" && mkdir -p "\$WSCOMPAT_DIR" && chmod 700 "\$WSCOMPAT_DIR"
cat << 'WSCOMPAT_EOF_daePe0Ph' > "\$WSCOMPAT_DIR/profile"
$(
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$WSCOMPAT_DIR/profile"
for file in "$WSCOMPAT_DIR/profile"*.sh; do
if [ -f "$file" ]; then
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$file"
fi
done
)
WSCOMPAT_EOF_daePe0Ph
. \$WSCOMPAT_DIR/profile
WSCOMPAT_EOF_ahkiem3K
if [ -z "$sudo_command" ]; then
sudo_command="exec /bin/bash --rcfile \"\$WSCOMPAT_DIR/bashrc\""
fi
if [ "$sudo_login_shell" ]; then
exec /bin/sudo -u "$sudo_user" \
/bin/bash --login --noprofile --norc -c "$init_cmd; cd; $sudo_command"
else
exec /bin/sudo -u "$sudo_user" \
/bin/bash --noprofile --norc -c "$init_cmd; $sudo_command"
fi

View File

@@ -0,0 +1,2 @@
[General]
theme=MateriaDark

View File

@@ -0,0 +1,40 @@
# see https://github.com/sigoden/aichat/blob/main/config.example.yaml
# see https://github.com/sigoden/aichat/blob/main/models.yaml
clients:
- type: openai-compatible
name: openrouter
api_base: https://openrouter.ai/api/v1
api_key: {{ .user.AI_OPENROUTER_KEY }}
models:
- name: anthropic/claude-sonnet-4.5
max_input_tokens: 350000
max_output_tokens: 65000
require_max_tokens: true
input_price: 3
output_price: 15
supports_vision: true
supports_function_calling: true
patch:
body:
reasoning:
effort: high
- name: deepseek/deepseek-v3.2-exp
max_input_tokens: 163840
input_price: 0.20
output_price: 0.40
patch:
body:
reasoning:
effort: high
- name: openai/gpt-4.1
max_input_tokens: 1047576
max_output_tokens: 32768
input_price: 2
output_price: 8
supports_vision: true
supports_function_calling: true

View File

@@ -0,0 +1,3 @@
---
model: openrouter:deepseek/deepseek-v3.2-exp
---

View File

@@ -0,0 +1,3 @@
---
model: openrouter:openai/gpt-4.1
---

View File

@@ -0,0 +1,3 @@
---
model: openrouter:anthropic/claude-sonnet-4.5
---

View File

@@ -0,0 +1,114 @@
[bell]
animation = "EaseOutExpo"
duration = 0
[colors.bright]
black = "#{{ .theme.color.bg }}"
magenta = "#{{ .theme.color.fg_accent }}"
white = "#{{ .theme.color.fg }}"
[colors.normal]
black = "#{{ .theme.color.bg }}"
blue = "#5dc5f8"
cyan = "#24dfc4"
green = "#35d450"
magenta = "#{{ .theme.color.fg_accent }}"
red = "#ff4d51"
white = "#{{ .theme.color.fg }}"
yellow = "#e9e836"
[colors.primary]
background = "#{{ .theme.color.bg }}"
foreground = "#{{ .theme.color.fg }}"
[colors.search.focused_match]
background = "#{{ .theme.color.bg_accent_dark }}"
foreground = "#{{ .theme.color.fg }}"
[colors.search.matches]
background = "#{{ .theme.color.bg_accent_dark }}"
foreground = "#{{ .theme.color.fg }}"
[cursor]
blink_interval = 250
vi_mode_style = "Block"
[font]
size={{ .theme.font.size_base_pt }}
[font.normal]
family = "{{ .theme.font.name_mono }}"
[scrolling]
history = 10000
[window]
title = "term"
[window.padding]
x = 8
y = 4
[[keyboard.bindings]]
key = "C"
mods = "Control"
action = "Copy"
[[keyboard.bindings]]
key = "V"
mods = "Control"
action = "Paste"
[[keyboard.bindings]]
key = "Escape"
mods = "Alt"
action = "ToggleViMode"
[[keyboard.bindings]]
key = "n"
mode = "Vi"
action = "Left"
[[keyboard.bindings]]
key = "e"
mode = "Vi"
action = "Down"
[[keyboard.bindings]]
key = "i"
mode = "Vi"
action = "Up"
[[keyboard.bindings]]
key = "o"
mode = "Vi"
action = "Right"
[[keyboard.bindings]]
key = "h"
mode = "Vi"
action = "ToggleViMode"
[[keyboard.bindings]]
key = "k"
mode = "Vi"
action = "SearchNext"
[[keyboard.bindings]]
key = "K"
mode = "Vi"
action = "SearchPrevious"
[[keyboard.bindings]]
key = "j"
mode = "Vi"
action = "SemanticRightEnd"
[[keyboard.bindings]]
key = "l"
mode = "Vi"
action = "ToggleViMode"

View File

@@ -2,10 +2,30 @@
[[ $- != *i* ]] && return
shopt -s autocd
stty intr ^K
alias ssh='wssh'
alias sudo='wsudo'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias node='NODE_NO_READLINE=1 rlwrap node'
alias d='cd ~/dev'
alias k='cd ~/know'
alias t='cd ~/tmp'
alias l='cd ~/lfs'
export EDITOR=vim
PS1='\[\033[38;2;153;136;255m\]\u@\h:\W\$\[\033[0m\]\[\e[0;91m\]${?#0}\[\e[0m\] '
export FZF_COMPLETION_TRIGGER='*'
eval "$(fzf --bash)"
PS0+='\e]133;C\e\\'
command_done() {
printf '\e]133;D\e\\'
}
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }command_done
PS1='\[\033[1;95m\]\u@\h:\W\$\[\033[0m\]\[\033[1;91m\]${?#0}\[\033[0m\] '

View File

@@ -1,24 +0,0 @@
#!/bin/sh
export BEMENU_OPTS="\
--ignorecase \
--width-factor 0.5 \
--fn \"{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}\" \
--list 500 \
--border 2 \
--scrollbar autohide \
--border-radius 4 \
--bdr #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scf #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--nb #{{ .theme.color.bg }} \
--ab #{{ .theme.color.bg }} \
--hb #{{ .theme.color.bg }} \
--fb #{{ .theme.color.bg }} \
--tb #{{ .theme.color.bg }} \
--nf #{{ .theme.color.fg }} \
--af #{{ .theme.color.fg }} \
--cf #{{ .theme.color.fg }} \
--hf #{{ .theme.color.fg_accent }} \
--tf #{{ .theme.color.fg_accent }} \
--ff #{{ .theme.color.fg_accent }} \
"

View File

@@ -0,0 +1 @@
max-items 50

View File

@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
<prefer><family>{{ .theme.font.name_regular }}</family></prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer><family>{{ .theme.font.name_regular }}</family></prefer>
</alias>
<alias>
<family>monospace</family>
<prefer><family>{{ .theme.font.name_mono }}</family></prefer>
</alias>
<alias>
<family>system-ui</family>
<prefer><family>{{ .theme.font.name_regular }}</family></prefer>
</alias>
<match target="pattern">
<edit name="size" mode="append">
<double>{{ .theme.font.size_base_pt }}</double>
</edit>
</match>
</fontconfig>

View File

@@ -1,255 +0,0 @@
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
title=term
# locked-title=no
font={{ .theme.font.name_mono }}:size={{ .theme.font.size_base_pt }}
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# strikeout-thickness=<font strikeout thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
pad=8x4 # optionally append 'center'
# resize-by-cells=yes
# resize-keep-grid=yes
# resize-delay-ms=100
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is libutempter (Linux)
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ulog (FreeBSD)
[environment]
# name=value
[bell]
urgent=yes
# notify=no
# visual=no
# command=
# command-focused=no
[desktop-notifications]
# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body}
# command-action-argument=--action ${action-name}=${action-label}
# close=""
# inhibit-when-focused=yes
[scrollback]
# lines=1000
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
[cursor]
# style=block
# color=<inverse foreground/background>
# blink=no
blink-rate=250
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
# hide-when-typing=no
# alternate-scroll-mode=yes
[touch]
# long-press-delay=400
[colors]
#alpha=1
background={{ .theme.color.bg }}
foreground={{ .theme.color.fg }}
# flash=7f7f00
# flash-alpha=0.5
## Normal/regular colors (color palette 0-7)
# regular0=242424 # black
# regular1=f62b5a # red
# regular2=47b413 # green
# regular3=e3c401 # yellow
# regular4=24acd4 # blue
# regular5=f2affd # magenta
# regular6=13c299 # cyan
# regular7=e6e6e6 # white
## Bright colors (color palette 8-15)
# bright0=616161 # bright black
# bright1=ff4d51 # bright red
# bright2=35d450 # bright green
# bright3=e9e836 # bright yellow
# bright4=5dc5f8 # bright blue
# bright5=feabf2 # bright magenta
# bright6=24dfc4 # bright cyan
# bright7=ffffff # bright white
## dimmed colors (see foot.ini(5) man page)
# dim0=<not set>
# ...
# dim7=<not-set>
## The remaining 256-color palette
# 16 = <256-color palette #16>
# ...
# 255 = <256-color palette #255>
## Sixel colors
# sixel0 = 000000
# sixel1 = 3333cc
# sixel2 = cc2121
# sixel3 = 33cc33
# sixel4 = cc33cc
# sixel5 = 33cccc
# sixel6 = cccc33
# sixel7 = 878787
# sixel8 = 424242
# sixel9 = 545499
# sixel10 = 994242
# sixel11 = 549954
# sixel12 = 995499
# sixel13 = 549999
# sixel14 = 999954
# sixel15 = cccccc
## Misc colors
# selection-foreground=<inverse foreground/background>
# selection-background=<inverse foreground/background>
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
# urls=<regular3>
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-maximized=no
# double-click-to-maximize=yes
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
clipboard-copy=Control+c XF86Copy
clipboard-paste=Control+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard
# show-urls-launch=Control+Shift+o
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=Control+Shift+u
# noop=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-char=Shift+Right
# extend-to-word-boundary=Control+w Control+Shift+Right
# extend-to-next-whitespace=Control+Shift+w
# extend-line-down=Shift+Down
# extend-backward-char=Shift+Left
# extend-backward-to-word-boundary=Control+Shift+Left
# extend-backward-to-next-whitespace=none
# extend-line-up=Shift+Up
clipboard-paste=Control+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# quit=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[text-bindings]
# \x03=Mod4+c # Map Super+c -> Ctrl+c
[mouse-bindings]
# scrollback-up-mouse=BTN_WHEEL_BACK
# scrollback-down-mouse=BTN_WHEEL_FORWARD
# font-increase=Control+BTN_WHEEL_BACK
# font-decrease=Control+BTN_WHEEL_FORWARD
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-quote = BTN_LEFT-3
# select-row=BTN_LEFT-4
# vim: ft=dosini

View File

@@ -0,0 +1 @@
--color=base16

View File

@@ -0,0 +1 @@
export FZF_DEFAULT_OPTS_FILE="$HOME/.config/fzf/config"

View File

@@ -5,3 +5,7 @@
defaultBranch = main
[pull]
rebase = false
[safe]
directory = *
[commit]
gpgsign = true

View File

@@ -1 +1 @@
pinentry-program ~/.local/bin/bemenu/pinentry.sh
pinentry-program ~/.local/bin/menu/pinentry.sh

View File

@@ -0,0 +1,5 @@
pcsc-driver /usr/lib/libpcsclite.so
card-timeout 5
disable-ccid
allow-admin
enable-pinpad-varlen

View File

@@ -1,24 +1,28 @@
separator_block_width=20
command=~/.local/bin/i3blocks/$BLOCK_NAME.sh
[weather]
label=⛅
interval=3600
[bandwidth]
interval=10
[volume]
interval=once
signal=2
{{ if file.Exists "/sys/class/power_supply/ACAD/" }}
[battery]
interval=10
{{ end }}
[volume]
interval=once
signal=2
[xkb_layout]
label=⌨
interval=once
signal=1
[login]
label=👤
command=echo "$USER@tty$XDG_VTNR"
interval=once
[time]
label=🕓
command=date +"%Y-%m-%dT%H:%M:%SZ"

View File

@@ -1,9 +1,15 @@
format=<b>%s - %a</b>\n%b
font=Roboto 10
format=<span size="{{ .theme.font.size_base_pt }}pt" weight="bold">%s - %a</span>\n%b
font={{ .theme.font.name_regular }} {{ .theme.font.size_base_pt }}
background-color=#{{ .theme.color.bg_accent_dark }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }}
border-size=2
border-radius=4
icon-border-radius=4
border-color=#{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }}
padding=5,10
width=400
width=600
progress-color=#{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }}
layer=overlay
[app-name=screenshot]
default-timeout=10000

View File

@@ -0,0 +1,16 @@
exec qutebrowser -R
exec gimp
exec telegram-desktop
man man
calc calc
power suspend
power poweroff
power poweroff --check-inhibitors=no
power logout
power reboot
pass pass
pass pass otp
pass pass info
capture screenshot selection
capture screenshot output
capture pick-color

View File

@@ -0,0 +1,15 @@
#!/bin/sh
export WMENU_VOPTS="\
-i \
-f '{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}' \
-n {{ .theme.color.fg }} -N {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
-m {{ .theme.color.bg_accent_dark }} -M {{ .theme.color.fg_accent }} \
-s {{ .theme.color.fg_accent }} -S {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
"
export WMENU_HOPTS="\
-i \
-f '{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}' \
-n {{ .theme.color.fg }} -N {{ .theme.color.bg }} \
-m {{ .theme.color.bg_accent_dark }} -M {{ .theme.color.fg_accent }} \
-s {{ .theme.color.fg_accent }} -S {{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
"

View File

@@ -1,4 +1,3 @@
#!/bin/sh
export PASSWORD_STORE_DIR="$HOME/know/id"
export PASSWORD_STORE_GENERATED_LENGTH=16

View File

@@ -1,16 +1,11 @@
#!/bin/bash
export PATH=$PATH:~/.local/bin
export PATH=~/.local/bin:$PATH
export WLR_RENDERER=vulkan
#export WLR_RENDERER=vulkan
export QT_STYLE_OVERRIDE=kvantum
export GTK_THEME=Materia-dark
for fpath in ~/.config/*/env.sh; do
. "$fpath"
done
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null

View File

@@ -39,19 +39,21 @@ c.bindings.key_mappings.update(dict(zip("ьЬыЫфФпПбБжЖлЛуУяЯа
############################################
# styles
c.colors.webpage.preferred_color_scheme = 'dark'
#c.colors.webpage.preferred_color_scheme = 'dark'
c.colors.webpage.darkmode.enabled = True
c.colors.webpage.darkmode.threshold.background = 128
c.colors.webpage.darkmode.threshold.foreground = 127
c.colors.webpage.bg = '#'+env['QB_THEME_COLOR_BG']
c.fonts.default_family = 'Roboto'
c.fonts.default_size = '12pt'
##########################################
# search engines
c.url.searchengines = {
'DEFAULT': 'https://lite.duckduckgo.com/lite?&q={}',
'DEFAULT':'https://google.com/search?hl=en&q={}',
'!d': 'https://lite.duckduckgo.com/lite?&q={}',
'!g': 'https://google.com/search?hl=en&q={}',
'!y': 'https://ya.ru/search/?text={}',
'!c': 'https://chat.openai.com/chat?q={}',
}
###########################################
@@ -60,4 +62,10 @@ c.url.default_page = 'file:///home/'+env['USER']+'/.local/share/qutebrowser/star
c.url.start_pages = ['file:///home/'+env['USER']+'/.local/share/qutebrowser/start.html']
########################################
# downloads
c.downloads.location.directory = "~/tmp/"
c.downloads.location.prompt = False
c.downloads.remove_finished = 10000
########################################
#print(f"Execution time {time.time() - start_ts}")

View File

@@ -1,3 +1,2 @@
#!/bin/sh
export INPUTRC="$HOME/.config/readline/inputrc"

View File

@@ -6,6 +6,16 @@ set vi-ins-mode-string \1\e[1 q\2
set vi-cmd-mode-string \1\e[2 q\2
#################################
############# new ###############
set keymap vi-insert
"\C-a":beginning-of-line
"\C-e":end-of-line
"\C-b":backward-char
"\C-f":forward-char
"\eb":backward-word
"\ef":forward-word
#################################
##### remap - colemak-dh #######
# n -> h
@@ -15,6 +25,8 @@ set keymap vi-command
"n":backward-char
"\C-n":backward-char
# e -> k (reverse swap)
set keymap vi-insert
"\C-e":"\C-j"
set keymap vi-command
"e":previous-history
"\C-e":kill-line
@@ -38,7 +50,7 @@ set keymap vi-command
"\C-k":next-history
# j -> e
set keymap vi-insert
"\C-e":self-insert
"\C-j":self-insert
set keymap vi-command
"j":vi-end-word
"J":vi-end-word
@@ -53,3 +65,9 @@ set keymap vi-insert
"\C-h":operate-and-get-next
#################################
########### custom ##############
$if qalc
set show-mode-in-prompt off
$endif
#################################

2
arch-user/config/screen/env.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
export SCREENRC="$HOME/.config/screen/screenrc"

View File

@@ -0,0 +1 @@
termcapinfo * ti@:te@

View File

@@ -1,8 +1,8 @@
# vim: filetype=swayconfig
set $mod Mod4
set $altmod Mod4+Mod5
set $altmod2 Mod4+Shift
set $altmod Mod4+Shift
set $altmod2 Mod4+Mod5
set $kbmod Alt_R
set $fwd m
set $left n
@@ -12,15 +12,18 @@ set $right o
set $bwd quotedbl
################ styles ####################
default_border pixel 1
default_border pixel 2
gaps inner 4
smart_borders on
smart_gaps on
show_marks on
title_align center
font pango:{{ .theme.font.name_regular }} {{ math.Sub .theme.font.size_base_pt .theme.font.size_step_pt }}
font pango:{{ .theme.font.name_regular }} {{ .theme.font.size_base_pt }}
output * bg #{{ .theme.color.bg }} solid_color
client.focused #{{ .theme.color.bg_accent_light }} #{{ .theme.color.bg_accent_light }} #{{ .theme.color.fg }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}
client.focused_tab_title #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.low 255 | conv.ToInt64 | printf "%02X" }}
client.focused_inactive #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.low 255 | conv.ToInt64 | printf "%02X" }}
client.unfocused #{{ .theme.color.bg_accent_dark }} #{{ .theme.color.bg_accent_dark }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.low 255 | conv.ToInt64 | printf "%02X" }}
client.focused_tab_title #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }}
client.focused_inactive #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }}
client.unfocused #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_dark }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }}
client.urgent #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }} #{{ .theme.color.fg }} #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }}
bar {
position top
@@ -36,7 +39,7 @@ bar {
separator #{{ .theme.color.fg_dark }}
focused_workspace #{{ .theme.color.bg_accent_light }} #{{ .theme.color.bg_accent_light }} #{{ .theme.color.fg }}
inactive_workspace #{{ .theme.color.bg_accent_dark }} #{{ .theme.color.bg_accent_dark }} #{{ .theme.color.fg }}
urgent_workspace #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }} #{{ .theme.color.fg }}
urgent_workspace #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_dark }}
binding_mode #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }} #{{ .theme.color.fg }}
}
}
@@ -72,27 +75,73 @@ bindgesture swipe:left workspace next
############################################
############### containers #################
# top row - layouts
bindsym --to-code {
$mod+p layout splith
$altmod+p split h
$mod+l layout splitv
$altmod+l split v
$mod+f fullscreen
$mod+w layout tabbed
$altmod+w split v; layout tabbed
$mod+u split none
$mod+y layout stacking
$altmod+y split h; layout stacking
$altmod+1 mark 1
$altmod+2 mark 2
$altmod+3 mark 3
$altmod+4 mark 4
$altmod+5 mark 5
$altmod+6 mark 6
$altmod+7 mark 7
$altmod+8 mark 8
$altmod+9 mark 9
$altmod+0 mark 0
$mod+1 [con_mark="1"] focus
$mod+2 [con_mark="2"] focus
$mod+3 [con_mark="3"] focus
$mod+4 [con_mark="4"] focus
$mod+5 [con_mark="5"] focus
$mod+6 [con_mark="6"] focus
$mod+7 [con_mark="7"] focus
$mod+8 [con_mark="8"] focus
$mod+9 [con_mark="9"] focus
$mod+0 [con_mark="0"] focus
$mod+Minus opacity minus 0.05
$altmod+Minus opacity plus 0.05
}
# mid row - focus, movement
bindsym --to-code {
$mod+$fwd focus child
$altmod+KP_1 mark 1
$altmod+KP_2 mark 2
$altmod+KP_3 mark 3
$altmod+KP_4 mark 4
$altmod+KP_5 mark 5
$altmod+KP_6 mark 6
$altmod+KP_7 mark 7
$altmod+KP_8 mark 8
$altmod+KP_9 mark 9
$altmod+KP_0 mark 0
$mod+KP_1 [con_mark="1"] focus
$mod+KP_2 [con_mark="2"] focus
$mod+KP_3 [con_mark="3"] focus
$mod+KP_4 [con_mark="4"] focus
$mod+KP_5 [con_mark="5"] focus
$mod+KP_6 [con_mark="6"] focus
$mod+KP_7 [con_mark="7"] focus
$mod+KP_8 [con_mark="8"] focus
$mod+KP_9 [con_mark="9"] focus
$mod+KP_0 [con_mark="0"] focus
}
bindsym --to-code {
$altmod+p split v
$mod+l layout splith
$altmod+l split h
$mod+f fullscreen
$mod+w layout stacking
$altmod+w split v; layout stacking
$mod+q split v; layout stacking
$mod+u split none
$altmod+u split none
$mod+y layout tabbed
$altmod+y split h; layout tabbed
$mod+j focus parent
}
bindsym --to-code {
$mod+$fwd exec ~/.local/bin/sway/focus-cousin.sh prev
$mod+$left focus left
$mod+$up focus up
$mod+$down focus down
$mod+$right focus right
$mod+$bwd focus parent
$mod+$bwd exec ~/.local/bin/sway/focus-cousin.sh next
$altmod+$left move left 40px
$altmod+$up move up 40px
$altmod+$down move down 40px
@@ -102,21 +151,29 @@ bindsym --to-code {
$altmod2+$down resize grow height 4ppt or 40px
$altmod2+$right resize grow width 2ppt or 40px
}
# bottom row - 3d
bindsym --to-code {
$mod+d scratchpad show
$altmod+x sticky enable; move scratchpad
$mod+z focus tiling
$altmod+z focus floating; floating disable; sticky disable
$altmod+d sticky enable; move scratchpad
$mod+k focus tiling
$altmod+k focus floating; floating disable; sticky disable
$mod+h focus floating
$altmod+h floating enable; sticky enable
$mod+k focus prev sibling
$mod+Comma opacity minus 0.05
$mod+Period opacity plus 0.05
$mod+slash focus next sibling
$mod+x exec wtype -M ctrl x -m ctrl
$mod+c exec wtype -M ctrl c -m ctrl
$mod+v exec wtype -M ctrl v -m ctrl
$altmod+v exec ~/.local/bin/sway/paste-from-history.sh
$mod+Slash exec ~/.local/bin/sway/search-mode.sh
$mod+z focus child
}
bindsym --to-code {
$mod+Left focus left
$mod+Up focus up
$mod+Down focus down
$mod+Right focus right
$altmod+Left move left 40px
$altmod+Up move up 40px
$altmod+Down move down 40px
$altmod+Right move right 40px
}
floating_modifier $mod normal
############################################
@@ -125,6 +182,11 @@ floating_modifier $mod normal
bindsym --to-code {
# generic
$mod+Escape kill
# basic scripts
$mod+Return exec alacritty msg create-window
$altmod+Return exec alacritty
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
$mod+Space exec ~/.local/bin/menu/run.sh
# media
XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%-
XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+
@@ -132,19 +194,17 @@ bindsym --to-code {
XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% && pkill -SIGRTMIN+2 i3blocks
XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5% && pkill -SIGRTMIN+2 i3blocks
XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks
# basic scripts
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
$mod+Return exec footclient
$mod+Space exec run.sh
XF86Calculator exec .local/bin/menu/run-calc.sh calc tui
}
##############################################
################# daemons ####################
exec foot -s
exec mako
exec swayidle
exec alacritty --daemon
exec wl-paste --watch cliphist store
##############################################
############## app-specific ##################
for_window [app_id="_float"] floating enable, resize set 960 540
##############################################
#############################################

View File

@@ -1,2 +1,4 @@
timeout 280 'notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "idle" -t 20000'
timeout 300 'systemctl suspend'
timeout 280 '[ "$(cat /sys/class/power_supply/AC/online 2>/dev/null)" = "0" ] && notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "idle" -t 20000 -h string:x-canonical-private-synchronous:inactivity' resume '[ "$(cat /sys/class/power_supply/AC/online 2>/dev/null)" = "0" ] && notify-send "" -a "idle" -t 1 -h string:x-canonical-private-synchronous:inactivity'
timeout 300 '[ "$(cat /sys/class/power_supply/AC/online 2>/dev/null)" = "0" ] && systemctl suspend'
timeout 1780 'notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "idle" -t 20000 -h string:x-canonical-private-synchronous:inactivity' resume 'notify-send "" -a "idle" -t 1 -h string:x-canonical-private-synchronous:inactivity'
timeout 1800 'systemctl suspend'

View File

@@ -46,6 +46,31 @@ set wildmenu
set wildmode=list:longest,full
set gdefault
" colors
colorscheme default
set t_Co=16
set notermguicolors
set t_RV= " bugfix
" new
highlight LineNr ctermfg=5 ctermbg=none
autocmd VimEnter * highlight SignColumn ctermbg=none
" fg magenta (5) -> blue (4)
highlight Title term=bold ctermfg=4 gui=bold
highlight Special term=bold ctermfg=4
highlight PreProc term=underline ctermfg=4
highlight Underlined term=underline cterm=underline ctermfg=4 gui=underline
" fg blue (4 or 12) -> magenta (5)
highlight SpecialKey term=bold ctermfg=5
highlight Directory term=bold ctermfg=5
highlight Folded term=standout ctermfg=5 ctermbg=7
highlight FoldColumn term=standout ctermfg=5 ctermbg=7
highlight SignColumn term=standout ctermfg=5 ctermbg=7
highlight Comment term=bold ctermfg=5
highlight NonText term=bold ctermfg=5 gui=bold
highlight DiffDelete term=bold ctermfg=5 ctermbg=14 gui=bold
highlight Changed ctermfg=5
" bg
highlight SpellCap cterm=underline ctermfg=9 ctermbg=none gui=undercurl
"###########################################
"############## file-specific ###############
@@ -68,7 +93,7 @@ noremap! <C-e> <C-j>
" i -> k
noremap i k
noremap I K
noremap! <C-i> <C-k>
"noremap! <C-i> <C-k> " breaks tab
" o -> l
noremap o l
noremap O L
@@ -93,6 +118,15 @@ noremap! <C-h> <C-o>
"#################################
"############### new keybinds ###############
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
cnoremap <M-b> <S-Left>
cnoremap <M-f> <S-Right>
"############################################
"####### custom commands #########
" W - Save file as superuser
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
@@ -111,7 +145,7 @@ noremap! <C-е> <C-ж>
" i -> k
noremap и к
noremap И К
noremap! <C-и> <C-к>
"noremap! <C-и> <C-к> " breaks tab
" o -> l
noremap о л
noremap О Л

View File

@@ -0,0 +1,11 @@
[ -f ~/.bashrc ] && . ~/.bashrc
stty intr ^K
alias ssh='wssh'
alias sudo='wsudo'
su() {
if [ "$1" = "-" ]; then
shift && wsudo - -u "$@"
else
wsudo -u "$@"
fi
}

View File

@@ -0,0 +1 @@
export WSCOMPAT_DIR=~/.config/workspace-compat

View File

@@ -0,0 +1,41 @@
#!/bin/bash
if [ -z "$WSCOMPAT_DIR" ] || [ "$WS_IS_COMPAT" != 1 ]; then
exit 0
fi
[ -f /etc/profile ] && . /etc/profile
[ -f ~/.profile ] && . ~/.profile
export EDITOR=vim
export SHELL=/bin/bash
export PATH="$WSCOMPAT_DIR:$PATH"
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/bashrc"
{{ tmpl.Inline (file.Read "config/workspace-compat/bashrc") . }}
WSCOMPAT_EOF_04tcIQE7
export VIMINIT="source $WSCOMPAT_DIR/vimrc"
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/vimrc"
{{ tmpl.Inline (file.Read "config/vim/vimrc.tmpl") . }}
WSCOMPAT_EOF_04tcIQE7
export INPUTRC="$WSCOMPAT_DIR/inputrc"
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/inputrc"
{{ tmpl.Inline (file.Read "config/readline/inputrc") . }}
WSCOMPAT_EOF_04tcIQE7
export LESSKEYIN="$WSCOMPAT_DIR/lesskey"
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/lesskey"
{{ tmpl.Inline (file.Read "config/less/lesskey") . }}
WSCOMPAT_EOF_04tcIQE7
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/wssh"
{{ tmpl.Inline (file.Read "bin/wssh") . }}
WSCOMPAT_EOF_04tcIQE7
chmod +x "$WSCOMPAT_DIR/wssh"
cat << 'WSCOMPAT_EOF_04tcIQE7' > "$WSCOMPAT_DIR/wsudo"
{{ tmpl.Inline (file.Read "bin/wsudo") . }}
WSCOMPAT_EOF_04tcIQE7
chmod +x "$WSCOMPAT_DIR/wsudo"

View File

@@ -1,2 +1,5 @@
GIT_USER_EMAIL=
GIT_USER_NAME=
BACKUP_KEY_VOL_UUID=
BACKUP_DATA_VOL_UUID=
AI_OPENROUTER_KEY=

View File

@@ -78,16 +78,4 @@ xkb_symbols "yurmak" {
#######################################
############# disable old #############
# This block disables old mappings completely
# so that your only option is to use new ones.
# Feel free to remove it, nothing will break =)
key.type = "ONE_LEVEL";
replace key <ESC> { [ VoidSymbol ] };
replace key <LEFT> { [ VoidSymbol ] };
replace key <UP> { [ VoidSymbol ] };
replace key <RGHT> { [ VoidSymbol ] };
replace key <DOWN> { [ VoidSymbol ] };
#######################################
};

View File

@@ -16,7 +16,7 @@ xkb_symbols "yurmak" {
replace key <LCTL> { [ Super_L ] };
replace key <LWIN> { [ Alt_R ] };
replace key <LALT> { [ ISO_Level3_Shift ] };
replace key <RALT> { [ ALT_L ] };
replace key <RALT> { [ Alt_L ] };
#####################################
########### characters ##############
@@ -78,16 +78,4 @@ xkb_symbols "yurmak" {
#######################################
############# disable old #############
# This block disables old mappings completely
# so that your only option is to use new ones.
# Feel free to remove it, nothing will break =)
key.type = "ONE_LEVEL";
replace key <ESC> { [ VoidSymbol ] };
replace key <LEFT> { [ VoidSymbol ] };
replace key <UP> { [ VoidSymbol ] };
replace key <RGHT> { [ VoidSymbol ] };
replace key <DOWN> { [ VoidSymbol ] };
#######################################
};

View File

@@ -1,10 +0,0 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f -- "$0")")"
umask 002
export IS_COMPAT=1
gomplate --file config/vim/vimrc --out ../linux-compat/home/.vimrc
gomplate --file config/readline/inputrc --out ../linux-compat/home/.inputrc
gomplate --file config/less/lesskey --out ../linux-compat/home/.lesskey

View File

@@ -48,7 +48,7 @@ mkdir -p "${USER_DIRS[@]}"
########## scripts #############
cp -rf bin/* ~/.local/bin
LN_EXCLUDE_DIRS=(i3blocks bemenu)
LN_EXCLUDE_DIRS=(i3blocks menu sway)
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
for sdir in bin/*; do
@@ -59,7 +59,7 @@ for sdir in bin/*; do
-exec rm {} \;
#shellcheck disable=SC2016
find ~/.local/bin/"$sdir" -maxdepth 1 -type f -perm -u+rwx | \
xargs -0 -d \\n -n 1 sh -c 'ln -s "$1" "/$HOME/.local/bin/$(basename "$(dirname "$1")")-${1##*/}"' sh
xargs -0 -d \\n -n 1 sh -c 'ln -s "$1" "/$HOME/.local/bin/$(basename "$(dirname "$1")")-$(basename "$1" .sh)"' sh
done
################################
@@ -71,8 +71,8 @@ gomplate --input-dir config \
--plugin jq=/bin/jq \
-c theme=config/theme.json \
-c user="file:///$HOME/.config/workspace.conf?type=application/x-env" \
--exclude /workspace.conf
--exclude /workspace.conf \
--exclude /workspace-compat/* --exclude !/workspace-compat/env.sh
ln -sf ~/.config/bash/bashrc ~/.bashrc
ln -sf ~/.config/profile ~/.profile
ln -sf ~/.config/less/lesskey ~/.lesskey
@@ -80,7 +80,16 @@ mkdir -p ~/.gnupg && ln -sf ~/.config/gnupg/gpg-agent.conf ~/.gnupg
################################
############# data ############
cp -rf data/* ~/.local/share
gomplate --input-dir data \
--output-map "$HOME/.local/share/{{ .in | strings.ReplaceAll \".tmpl\" \"\" }}" \
--exclude-processing "!*.tmpl" \
-c theme=config/theme.json
###############################
########### compat ############
export IS_COMPAT=1
gomplate --file config/workspace-compat/profile.tmpl --out ~/.config/workspace-compat/profile
export IS_COMPAT=0
###############################
swaymsg reload || true

View File

@@ -1,55 +0,0 @@
set editing-mode vi
########### prompt ##############
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[1 q\2
set vi-cmd-mode-string \1\e[2 q\2
#################################
##### remap - colemak-dh #######
# n -> h
set keymap vi-insert
"\C-n":backward-delete-char
set keymap vi-command
"n":backward-char
"\C-n":backward-char
# e -> k
set keymap vi-command
"e":previous-history
"\C-e":kill-line
# i -> j
#set keymap vi-insert
# "\C-i":accept-line # ascii code conflicts with tab
set keymap vi-command
"i":next-history
# "\C-i":accept-line # ascii code conflicts with tab
# o -> l
set keymap vi-command
"o":forward-char
"\C-o":clear-screen
# k -> n
#set keymap vi-insert
#"\C-k":menu-complete # bound to intr, use tab
set keymap vi-command
"k":vi-search-again
"K":vi-search-again
"\C-k":next-history
# j -> e
set keymap vi-insert
"\C-e":self-insert
set keymap vi-command
"j":vi-end-word
"J":vi-end-word
# l -> i
set keymap vi-insert
"\C-l":complete
set keymap vi-command
"l":vi-insertion-mode
"L":vi-insert-beg
# h -> o
set keymap vi-insert
"\C-h":operate-and-get-next
#################################

View File

@@ -1,48 +0,0 @@
###### colemak dh movement #####
# n -> h
#n Help
#N Help
# e -> k
e back-line
^E back-line
E back-line-force
# i -> j
i forw-line
J forw-line-force
# o -> l
^O repaint
# k -> n
^K forw-line
k repeat-search
\ek repeat-search-all
K reverse-search
\eK reverse-search-all
#^O^K osc8-forw-search
#^Ok osc8-forw-search
:k next-file
# j -> e
j forw-line
^J forw-line
J examine
:j examine
# l -> i
# noop
# h -> o
#^H^H osc8-open
############################
######### custom ###########
n left-scroll
o right-scroll
############################

View File

@@ -1,139 +0,0 @@
"########## system ###########
set nocompatible
set ttyfast
set encoding=utf-8
set mouse=a
set autoread
au FocusGained,BufEnter * silent! checktime
"#############################
"######### generic ###########
" status line
set showmode
set showcmd
set ruler
" syntax hl
syntax enable
filetype on
filetype plugin on
" lines
set number
set relativenumber
set numberwidth=3
set wrap
set showmatch " brackets
" search
set hlsearch
set incsearch
set ignorecase
set smartcase
" tabs
set shiftwidth=4
set tabstop=4
set softtabstop=0
set noexpandtab
" scroll
set scrolloff=5
" commands
set wildmenu
set wildmode=list:longest,full
set gdefault
"###########################################
"############## file-specific ###############
autocmd FileType markdown setlocal spell
autocmd FileType gitcommit setlocal spell
autocmd FileType markdown setlocal complete+=kspell
autocmd FileType gitcommit setlocal complete+=kspell
"############################################
"####### remap - colemak-dh #######
" n -> h
noremap n h
noremap N H
noremap! <C-n> <C-h>
" e -> k
noremap e k
noremap E K
noremap! <C-e> <C-k>
" i -> j
noremap i j
noremap I J
noremap! <C-i> <C-j>
" o -> l
noremap o l
noremap O L
noremap! <C-o> <C-l>
" k -> n
noremap k n
noremap K N
noremap! <C-k> <C-n>
" j -> e
noremap j e
noremap J E
noremap! <C-j> <C-e>
" l -> i
noremap l i
noremap L I
noremap! <C-l> <C-i>
" h -> o
noremap h o
noremap H O
noremap! <C-h> <C-o>
"#################################
"####### custom commands #########
" W - Save file as superuser
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
"#################################
"######### localization ##########
set langmap=ьЬыЫфФпПбБжЖлЛуУяЯаАрРсСтТгГмМнНеЕиИоОчЧцЦдДвВзЗкКхХ;qQwWfFpPbBjJlLuUyYaArRsStTgGmMnNeEiIoOxXcCdDvVzZkKhH
" n -> h
noremap н х
noremap Н Х
noremap! <C-н> <C-х>
" e -> k
noremap е к
noremap Е К
noremap! <C-е> <C-к>
" i -> j
noremap и ж
noremap И Ж
noremap! <C-и> <C-ж>
" o -> l
noremap о л
noremap О Л
noremap! <C-о> <C-л>
" k -> n
noremap к н
noremap К Н
noremap! <C-к> <C-н>
" j -> e
noremap й е
noremap Й Е
noremap! <C-й> <C-е>
" l -> i
noremap л и
noremap Л И
noremap! <C-л> <C-и>
" h -> o
noremap х о
noremap Х O
noremap! <C-х> <C-о>
"#################################
"############# hacks #############
"################################

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f -- "$0")")"
[[ -z "$1" ]] && echo "ERROR: no destination" >&1 && exit 1
scp -r home/. "$1:/tmp/workspace"
ssh "$1" "cp -rfT /tmp/workspace ~/ && rm -rf /tmp/workspace"