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

View File

@ -1,2 +1,19 @@
#!/bin/sh #!/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 # login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode # 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 # 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-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font> # font-italic=<italic variant of regular font>
# font-bold-italic=<bold+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 # long-press-delay=400
[colors] [colors]
alpha=0.85 alpha=$THEME_OPACITY_HIGH
background=0d1117 background=$THEME_COLOR_BG
# foreground=ffffff # foreground=ffffff
# flash=7f7f00 # flash=7f7f00
# flash-alpha=0.5 # flash-alpha=0.5

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/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 echo

View File

@ -84,7 +84,7 @@ bindsym --to-code $mod+v exec wtype -P XF86Paste
default_border pixel 1 default_border pixel 1
smart_borders on smart_borders on
title_align center title_align center
font pango:Roboto 10 font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_SMALL_PT
output * bg #$THEME_COLOR_BG solid_color 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 #$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 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 #####################
bar { bar {
position top position top
font pango:Roboto Mono 12 font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_BASE_PT
status_command i3blocks status_command i3blocks
strip_workspace_numbers yes strip_workspace_numbers yes
separator_symbol | separator_symbol |

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/sh
# std
export THEME_COLOR_FG=ffffff # main text export THEME_COLOR_FG=ffffff # main text
export THEME_COLOR_FG_DARK=b8bcc1 # secondary text export THEME_COLOR_FG_DARK=b8bcc1 # secondary text
export THEME_COLOR_FG_ACCENT=9988ff # highlighted text, scrollbars (low-mid transp) 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_LOW=0.2
export THEME_OPACITY_MID=0.55 export THEME_OPACITY_MID=0.55
export THEME_OPACITY_HIGH=0.85 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_LOW_HEX=33
export THEME_OPACITY_MID_HEX=8C export THEME_OPACITY_MID_HEX=8C
export THEME_OPACITY_HIGH_HEX=D9 export THEME_OPACITY_HIGH_HEX=D9

View File

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

View File

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