Compare commits

...

21 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
39 changed files with 263 additions and 146 deletions

View File

@@ -6,16 +6,19 @@ PACKAGES=(
linux base linux-firmware lvm2 sudo polkit # base linux base linux-firmware lvm2 sudo polkit # base
pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # device management pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # device management
openssh strace sysstat htop screen man-db which rlwrap # system openssh rsync strace sysstat htop screen man-db which dnsutils # system
nodejs dash jq # runtime nodejs dash jq # runtime
qemu-system-x86 # virt qemu-system-x86 # virt
postgresql #db
rlwrap fzf # shell helpers
vifm vim less # nav & edit vifm vim less # nav & edit
vim-ale vim-fugitive # vim plugins vim-ale vim-fugitive # vim plugins
just shellcheck # shell scripting just shellcheck # shell scripting
git zip # data processing git zip # storage
bc xxd # data processing
gnupg pass pass-otp pwgen # crypt gnupg pass pass-otp pwgen # crypt
imv mpv imagemagick gimp # media imv mpv imagemagick gimp # media
aichat libqalculate translate-shell # utils aichat libqalculate translate-shell # utils
@@ -26,8 +29,8 @@ PACKAGES=(
neomutt telegram-desktop # communication neomutt telegram-desktop # communication
greetd sway swaybg swayidle # desktop basic greetd sway swaybg swayidle # desktop basic
alacritty bemenu-wayland i3blocks mako libnotify # terminals, ui alacritty wmenu i3blocks mako libnotify # terminals, ui
wev wl-clipboard wtype slurp grim # interaction wev wl-clipboard cliphist wtype slurp grim # interaction
ttf-roboto ttf-roboto-mono otf-font-awesome # fonts ttf-roboto ttf-roboto-mono otf-font-awesome # fonts
kvantum kvantum-qt5 kvantum-theme-materia materia-gtk-theme # themes kvantum kvantum-qt5 kvantum-theme-materia materia-gtk-theme # themes

View File

@@ -1,12 +0,0 @@
#!/bin/sh
shift
page="$1"
if [ -z "$page" ]; then
page="$(
man -k . | \
(bemenu --prompt "man" || exec ~/.local/bin/bemenu/run.sh) | \
sed ' s/\s\+\-.*//;s/ //g'
)"
fi
exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "man '$page' || read -n1"

View File

@@ -1,22 +0,0 @@
#!/bin/bash
rl_full="$(cat "$HOME/.config/bemenu/"*.runlist)"
rl="$(echo "$rl_full" | cut -d' ' -f2-)"
inp="$(echo "$rl" | bemenu --prompt ">")"
[ -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;;
float-sh) exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "$SHELL" -c "($inp)";;
float-sh-keep) exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "($inp); read -n1";;
*) exec bash "$HOME/.local/bin/bemenu/run-$exectr.sh" "${inp_arr[@]}"
esac

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" echo "🔌 $cap% ${w}W"
else else
echo "🔋 $cap% ${w}W" echo "🔋 $cap% ${w}W"
[ "$cap" -lt "15" ] && exit 33 if [ "$cap" -lt "15" ]; then
exit 33
fi
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 #!/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, ### This file is covered by the GNU General Public License,
### which should be included with libshell as the file LICENSE. ### which should be included with libshell as the file LICENSE.
### All copyright information are listed in the COPYING. ### All copyright information are listed in the COPYING.
@@ -6,13 +8,13 @@
#exec 2>/tmp/pinentry.log #exec 2>/tmp/pinentry.log
#set -x #set -x
############################### PATCH #################################
. ~/.config/menu/env.sh
#######################################################################
VERSION='1.0' VERSION='1.0'
FLAVOR='bash' FLAVOR='bash'
############################### PATCH #################################
. ~/.config/bemenu/env.sh
#######################################################################
keyinfo='' keyinfo=''
error='' error=''
timeout=0 timeout=0
@@ -123,9 +125,8 @@ cmd_getpin()
output="$( output="$(
echo -n "|" echo -n "|"
############################### PATCH ################################# ############################### PATCH #################################
bemenu \ ~/.local/bin/menu/horizontal.sh \
--password indicator \ -Pp "${prompt:-$def_prompt}" \
--prompt "${prompt:-$def_prompt}" \
</dev/null | tr -d '\n' </dev/null | tr -d '\n'
ret=${PIPESTATUS[0]} ret=${PIPESTATUS[0]}
# yad \ # yad \

View File

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

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"

View File

@@ -3,10 +3,10 @@ set -e
cd "$PASSWORD_STORE_DIR" cd "$PASSWORD_STORE_DIR"
pws="$(find -path "*/.*" -prune -o -path "*/cred/*" -name "*.gpg" -printf '%P\n' | sed 's/\.gpg$//')" pws="$(find -path "*/.*" -prune -o -path "*/cred/*" -name "*.gpg" -printf '%P\n' | sed 's/\.gpg$//')"
pw="$(echo "$pws" | bemenu --prompt "pass")" pw="$(echo "$pws" | ~/.local/bin/menu/vertical.sh -p "pass")"
case "$2" in case "$2" in
info) exec alacritty msg create-window --class="term_float" --working-directory="$HOME" --command "pass $pw | vim -";; 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";; 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";; *) pass -c "$pw" && notify-send "$pw" -a pass "Password copied to clipboard, clears in 45s";;
esac esac

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
sure() { sure() {
echo yes | bemenu --prompt "sure?" || exec ~/.local/bin/bemenu/run.sh echo yes | ~/.local/bin/menu/horizontal.sh -p "sure?" || exec ~/.local/bin/menu/run.sh
} }
case "$1" in case "$1" in

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"

View File

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

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

@@ -41,7 +41,7 @@ formatted_list=$(echo "$window_list" | while IFS='|' read -r id app_id name work
printf "%s%s%s %s %s\n" "$workspace" "$indicator" "$id" "$app_id" "$name" printf "%s%s%s %s %s\n" "$workspace" "$indicator" "$id" "$app_id" "$name"
done) done)
selection=$(echo "$formatted_list" | bemenu --auto-select --width-factor 100 --prompt "/" --index "$(echo "$formatted_list" | awk 'substr($0,2,1)==">" {print NR-1}')" ) selection=$(echo "$formatted_list" | ~/.local/bin/menu/vertical.sh -p "/")
[ -z "$selection" ] && exit 0 [ -z "$selection" ] && exit 0
window_id=$(echo "$selection" | sed -E 's/^...([0-9]+).*/\1/') window_id=$(echo "$selection" | sed -E 's/^...([0-9]+).*/\1/')

View File

@@ -1,9 +1,6 @@
# see https://github.com/sigoden/aichat/blob/main/config.example.yaml # see https://github.com/sigoden/aichat/blob/main/config.example.yaml
# see https://github.com/sigoden/aichat/blob/main/models.yaml # see https://github.com/sigoden/aichat/blob/main/models.yaml
model: openrouter:anthropic/claude-sonnet-4
function_calling: false
clients: clients:
- type: openai-compatible - type: openai-compatible
@@ -12,22 +9,9 @@ clients:
api_key: {{ .user.AI_OPENROUTER_KEY }} api_key: {{ .user.AI_OPENROUTER_KEY }}
models: models:
- name: anthropic/claude-opus-4 - name: anthropic/claude-sonnet-4.5
max_input_tokens: 200000 max_input_tokens: 350000
max_output_tokens: 20000 max_output_tokens: 65000
require_max_tokens: true
input_price: 15
output_price: 75
supports_vision: true
supports_function_calling: true
patch:
body:
reasoning:
effort: high
- name: anthropic/claude-sonnet-4
max_input_tokens: 200000
max_output_tokens: 20000
require_max_tokens: true require_max_tokens: true
input_price: 3 input_price: 3
output_price: 15 output_price: 15
@@ -38,35 +22,15 @@ clients:
reasoning: reasoning:
effort: high effort: high
- name: deepseek/deepseek-chat-v3.1 - name: deepseek/deepseek-v3.2-exp
max_input_tokens: 163840 max_input_tokens: 163840
input_price: 0.20 input_price: 0.20
output_price: 0.80 output_price: 0.40
patch: patch:
body: body:
reasoning: reasoning:
effort: high effort: high
- name: deepseek/deepseek-chat-v3.1:free
max_input_tokens: 163840
input_price: 0
output_price: 0
patch:
body:
reasoning:
effort: high
- name: perplexity/sonar-pro
max_input_tokens: 200000
input_price: 3
output_price: 15
- name: perplexity/sonar
max_input_tokens: 127072
input_price: 1
output_price: 1
- name: openai/gpt-4.1 - name: openai/gpt-4.1
max_input_tokens: 1047576 max_input_tokens: 1047576
max_output_tokens: 32768 max_output_tokens: 32768

View File

@@ -1,3 +0,0 @@
---
model: openrouter:deepseek/deepseek-chat-v3.1:free
---

View File

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

View File

@@ -1,3 +0,0 @@
---
model: openrouter:anthropic/claude-opus-4
---

View File

@@ -2,6 +2,8 @@
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
shopt -s autocd
stty intr ^K stty intr ^K
alias ssh='wssh' alias ssh='wssh'
@@ -11,8 +13,16 @@ alias ls='ls --color=auto'
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias node='NODE_NO_READLINE=1 rlwrap node' 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 export EDITOR=vim
export FZF_COMPLETION_TRIGGER='*'
eval "$(fzf --bash)"
PS0+='\e]133;C\e\\' PS0+='\e]133;C\e\\'
command_done() { command_done() {
printf '\e]133;D\e\\' printf '\e]133;D\e\\'

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 }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--ab #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--hb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--fb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--tb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--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 @@
--color=base16

View File

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

View File

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

View File

@@ -1,19 +1,18 @@
separator_block_width=20 separator_block_width=20
command=~/.local/bin/i3blocks/$BLOCK_NAME.sh command=~/.local/bin/i3blocks/$BLOCK_NAME.sh
[weather] [bandwidth]
label=⛅ interval=10
interval=3600
[volume]
interval=once
signal=2
{{ if file.Exists "/sys/class/power_supply/ACAD/" }} {{ if file.Exists "/sys/class/power_supply/ACAD/" }}
[battery] [battery]
interval=10 interval=10
{{ end }} {{ end }}
[volume]
interval=once
signal=2
[xkb_layout] [xkb_layout]
label=⌨ label=⌨
interval=once interval=once

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

@@ -62,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'] 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}") #print(f"Execution time {time.time() - start_ts}")

View File

@@ -25,6 +25,8 @@ set keymap vi-command
"n":backward-char "n":backward-char
"\C-n":backward-char "\C-n":backward-char
# e -> k (reverse swap) # e -> k (reverse swap)
set keymap vi-insert
"\C-e":"\C-j"
set keymap vi-command set keymap vi-command
"e":previous-history "e":previous-history
"\C-e":kill-line "\C-e":kill-line

View File

@@ -39,7 +39,7 @@ bar {
separator #{{ .theme.color.fg_dark }} separator #{{ .theme.color.fg_dark }}
focused_workspace #{{ .theme.color.bg_accent_light }} #{{ .theme.color.bg_accent_light }} #{{ .theme.color.fg }} 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 }} 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 }} binding_mode #{{ .theme.color.fg_accent }} #{{ .theme.color.fg_accent }} #{{ .theme.color.fg }}
} }
} }
@@ -161,6 +161,7 @@ bindsym --to-code {
$mod+x exec wtype -M ctrl x -m ctrl $mod+x exec wtype -M ctrl x -m ctrl
$mod+c exec wtype -M ctrl c -m ctrl $mod+c exec wtype -M ctrl c -m ctrl
$mod+v exec wtype -M ctrl v -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+Slash exec ~/.local/bin/sway/search-mode.sh
$mod+z focus child $mod+z focus child
} }
@@ -181,6 +182,11 @@ floating_modifier $mod normal
bindsym --to-code { bindsym --to-code {
# generic # generic
$mod+Escape kill $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 # media
XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%- XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%-
XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+ XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+
@@ -188,11 +194,7 @@ bindsym --to-code {
XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% && pkill -SIGRTMIN+2 i3blocks 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 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 XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks
XF86Calculator exec .local/bin/bemenu/run-calc.sh calc tui XF86Calculator exec .local/bin/menu/run-calc.sh calc tui
# basic scripts
$mod+Return exec alacritty msg create-window
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
$mod+Space exec ~/.local/bin/bemenu/run.sh
} }
############################################## ##############################################
@@ -200,6 +202,7 @@ bindsym --to-code {
exec mako exec mako
exec swayidle exec swayidle
exec alacritty --daemon exec alacritty --daemon
exec wl-paste --watch cliphist store
############################################## ##############################################
############## app-specific ################## ############## app-specific ##################

View File

@@ -48,7 +48,7 @@ mkdir -p "${USER_DIRS[@]}"
########## scripts ############# ########## scripts #############
cp -rf bin/* ~/.local/bin cp -rf bin/* ~/.local/bin
LN_EXCLUDE_DIRS=(i3blocks bemenu sway) LN_EXCLUDE_DIRS=(i3blocks menu sway)
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} " ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
for sdir in bin/*; do for sdir in bin/*; do
@@ -73,7 +73,6 @@ gomplate --input-dir config \
-c user="file:///$HOME/.config/workspace.conf?type=application/x-env" \ -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 --exclude /workspace-compat/* --exclude !/workspace-compat/env.sh
ln -sf ~/.config/bash/bashrc ~/.bashrc ln -sf ~/.config/bash/bashrc ~/.bashrc
ln -sf ~/.config/profile ~/.profile ln -sf ~/.config/profile ~/.profile
ln -sf ~/.config/less/lesskey ~/.lesskey ln -sf ~/.config/less/lesskey ~/.lesskey
@@ -81,7 +80,10 @@ mkdir -p ~/.gnupg && ln -sf ~/.config/gnupg/gpg-agent.conf ~/.gnupg
################################ ################################
############# data ############ ############# 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 ############ ########### compat ############