This commit is contained in:
Yuri Zamyatin 2025-01-01 00:24:48 +00:00
parent c2d061800f
commit b190c24860
9 changed files with 172 additions and 73 deletions

View File

@ -4,7 +4,7 @@ set -e
PACKAGES=(
# system
linux base linux-firmware lvm2 sudo polkit greetd # basic
linux base linux-firmware lvm2 sudo polkit # basic
openssh networkmanager man-db restic htop # admin utils
# cli programs
@ -15,17 +15,18 @@ PACKAGES=(
git zip # others
# desktop env
sway swaybg xorg-xwayland # basic
greetd sway swaybg xorg-xwayland # basic
foot bemenu-wayland i3blocks mako libnotify # terminals, ui
wev wl-clipboard wtype slurp grim # interaction
ttf-roboto ttf-roboto-mono # fonts
# gui apps
imv mpv gimp # media
firefox sqlitebrowser qt5-wayland
qutebrowser qt6-wayland # www
sqlitebrowser qt5-wayland # db
# extensions
firefox-tridactyl vim-ale vim-fugitive
vim-ale vim-fugitive
)

View File

@ -1,2 +1,19 @@
#!/bin/sh
export BEMENU_OPTS="--ignorecase --width-factor 0.5 --fn \"Roboto Mono 14\" --list 500 --border 1 --scrollbar autohide --bdr #9988ff --nb #0d1117d9 --ab #0d1117d9"
export BEMENU_OPTS="\
--ignorecase \
--width-factor 0.5 \
--fn \"$THEME_FONT_MONO $THEME_SIZE_FONT_LARGE_PT\" \
--list 500 \
--border 1 \
--scrollbar autohide \
--bdr #$THEME_COLOR_FG_ACCENT$THEME_OPACITY_MID_HEX \
--scf #$THEME_COLOR_FG_ACCENT$THEME_OPACITY_MID_HEX \
--nb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--ab #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--hb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--nf #$THEME_COLOR_FG \
--af #$THEME_COLOR_FG \
--hf #$THEME_COLOR_FG_ACCENT \
--tf #$THEME_COLOR_FG_ACCENT \
--ff #$THEME_COLOR_FG_ACCENT \
"

View File

@ -0,0 +1,7 @@
config.load_autoconfig(False)
config.set('tabs.tabs_are_windows', True)
config.set('tabs.show', 'never')
for mode in ['normal','insert','hint','passthrough','command','prompt','yesno','register']:
config.bind('<Cut>', 'fake-key -g <Ctrl-x>', mode)
config.bind('<Copy>', 'fake-key -g <Ctrl-c>', mode)
config.bind('<Paste>', 'fake-key -g <Ctrl-v>', mode)

View File

@ -5,9 +5,9 @@
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
# title=foot
title=term
# locked-title=no
font=Roboto Mono:size=12
font=$THEME_FONT_MONO:size=$THEME_SIZE_FONT_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>
@ -83,8 +83,8 @@ pad=8x4 # optionally append 'center'
# long-press-delay=400
[colors]
alpha=0.85
background=0d1117
alpha=$THEME_OPACITY_HIGH
background=$THEME_COLOR_BG
# foreground=ffffff
# flash=7f7f00
# flash-alpha=0.5

View File

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

View File

@ -84,7 +84,7 @@ bindsym --to-code $mod+v exec wtype -P XF86Paste
default_border pixel 1
smart_borders on
title_align center
font pango:Roboto 10
font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_SMALL_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$THEME_OPACITY_MID_HEX $THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX #$THEME_COLOR_FG_DARK #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_BG_ACCENT_LIGHT
@ -95,7 +95,7 @@ client.unfocused #$THEME_COLOR_BG_ACCENT_DARK #$THEME_COLOR_BG_ACCENT_DARK #$THE
################## bar #####################
bar {
position top
font pango:Roboto Mono 12
font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_BASE_PT
status_command i3blocks
strip_workspace_numbers yes
separator_symbol |

View File

@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/sh
# std
export THEME_COLOR_FG=ffffff # main text
export THEME_COLOR_FG_DARK=b8bcc1 # secondary text
export THEME_COLOR_FG_ACCENT=9988ff # highlighted text, scrollbars (low-mid transp)
@ -8,7 +9,15 @@ export THEME_COLOR_BG_ACCENT_DARK=020030 # alt bg
export THEME_OPACITY_LOW=0.2
export THEME_OPACITY_MID=0.55
export THEME_OPACITY_HIGH=0.85
export THEME_SIZE_FONT_BASE_PX=16
export THEME_SiZE_FONT_SMALL_MULT=0.875
export THEME_SIZE_FONT_LARGE_MULT=1.1125
export THEME_FONT_REGULAR=Roboto
export THEME_FONT_MONO="Roboto Mono"
# calculated
export THEME_SIZE_FONT_BASE_PT=12
export THEME_SIZE_FONT_SMALL_PT=10.5
export THEME_SIZE_FONT_LARGE_PT=13.5
export THEME_OPACITY_LOW_HEX=33
export THEME_OPACITY_MID_HEX=8C
export THEME_OPACITY_HIGH_HEX=D9

View File

@ -18,23 +18,26 @@ cp_subst() {
envsubst "$VARS" < "$1" > "$2"
}
# simple
cp -rf config/foot ~/.config
# xdg simple
cp -rf config/i3blocks ~/.config
cp -rf config/git ~/.config
cp -rf config/vim ~/.config
cp -rf config/xkb ~/.config
cp -rf config/qutebrowser ~/.config
# non-xdg
cp -rf config/bash/bashrc ~/.bashrc
# templated
cp_subst config/sway/config.tmpl ~/.config/sway/config
cp_subst config/foot/foot.ini.tmpl ~/.config/foot/foot.ini
# dynamic
cp -rf config/profile ~/.profile
cat config/bemenu/config.sh >> ~/.profile
cat config/theme.sh >> ~/.profile
# shellcheck disable=SC2129
echo -e "\n# GENERATED" >> ~/.profile
sed '/^#/d' config/theme.sh >> ~/.profile
sed '/^#/d' config/bemenu/config.sh >> ~/.profile
################################
swaymsg reload

View File

@ -1,65 +1,127 @@
#!/bin/sh
#!/bin/bash
LIST=();
if [ "$USER" = "yrzam" ]; then
WEB="\
web projects
web life\
"
LIST+=(
"web" "web projects"
"web" "web life"
)
else
WEB=web
LIST+=(
"web" "web"
)
fi
LIST="\
term
$WEB
vifm
vim
gimp
htop
man
sway reload
logout
poweroff
reboot\
"
out=$(bemenu --prompt "" << EOF
$LIST
EOF
LIST+=(
"gui" "gimp"
"gui" "sqlitebrowser"
"shell_tui" "vifm"
"shell_tui" "vim"
"tui" "htop"
"tui" "nmtui"
"man" "man"
"screenpick-todo" "screenshot all"
"screenpick-todo" "screenshot selection"
"pass" "pass"
"term" "term"
"brightness" "brightness"
"direct" "sway reload"
"power" "logout"
"power-todo" "inhibit"
"power" "suspend"
"power" "poweroff"
"power" "poweroff --check-inhibitors=no"
"power" "reboot"
)
conf() {
# generic
sure() {
echo yes | bemenu --prompt "sure?"
}
case "$out " in
" ");;
"web "*)
profile="${out##* }"
if [ "$profile" != "web" ]; then
exec firefox -P "$profile"
else
exec firefox
fi;;
"man ")
page="$(man -k . | bemenu --prompt "man" | awk '{print $1}')"
[ -n "$page" ] && exec footclient man "$page";;
"logout ")
conf && swaymsg exit;;
"poweroff "|"reboot ")
conf && exec systemctl "$out";;
"sway reload ")
exec $out;;
# term session
"term ")
exec footclient -D ~/;;
# term exec pure
"man "*|"htop ")
exec footclient -D ~/ "$out";;
# term exec in shell
"vifm "*|"vim "*)
exec footclient -D ~/ "$SHELL" -c "$out";;
#term exec in shell and wait
*)
exec footclient -D ~/ "$SHELL" -c "$out; read -n1";;
esac
exec_gui() {
exec "$@"
}
exec_tui() {
exec footclient -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() {
/bin/qutebrowser --set tabs.tabs_are_windows true --set tabs.show never "https://google.com"
}
exec_power() {
case "$1" in
poweroff|reboot|suspend) sure && systemctl "$@";;
logout) sure && swaymsg exit;;
esac
}
exec_brightness() {
shift
target="$1"
if [ -z "$target" ]; then
current="$(($(brightnessctl g)*100/$(brightnessctl m)))%"
list="$(echo ok; echo 1%; seq 5 5 100 | sed 's/$/%/')";
target="$(
echo "$list" | bemenu --prompt "$current ->"
)";
fi
if [ -n "$target" ] && [ "$target" != "ok" ]; then
brightnessctl set "$target"
[ -z "$1" ] && exec_brightness brightness
fi
}
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_pass() {
echo 1
}
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