From b49b7ed34d38377543c5f62d2d3bd8a71b7359a3 Mon Sep 17 00:00:00 2001 From: Yuri Zamyatin Date: Sat, 29 Mar 2025 22:40:40 +0000 Subject: [PATCH] wip --- .../tlp.conf} | 0 arch-root/_install/custom/laptop.sh.yrz.am.sh | 5 +- arch-root/_install/greetd.toml | 7 + arch-root/install.sh | 16 ++- arch-user/bin/init | 6 + arch-user/bin/run.sh | 1 + arch-user/config/profile.part | 1 - arch-user/config/sway/config.tmpl | 130 ++++++++++-------- arch-user/config/swayidle/config | 2 + arch-user/config/theme.sh | 2 +- arch-user/config/xkb/symbols/us | 2 +- arch-user/install.sh | 28 +++- 12 files changed, 126 insertions(+), 74 deletions(-) rename arch-root/_install/custom/{laptop-tlp.conf => _laptop.sh.yrz.am/tlp.conf} (100%) create mode 100644 arch-root/_install/greetd.toml create mode 100755 arch-user/bin/init create mode 100644 arch-user/config/swayidle/config diff --git a/arch-root/_install/custom/laptop-tlp.conf b/arch-root/_install/custom/_laptop.sh.yrz.am/tlp.conf similarity index 100% rename from arch-root/_install/custom/laptop-tlp.conf rename to arch-root/_install/custom/_laptop.sh.yrz.am/tlp.conf diff --git a/arch-root/_install/custom/laptop.sh.yrz.am.sh b/arch-root/_install/custom/laptop.sh.yrz.am.sh index d3e9c98..415174d 100644 --- a/arch-root/_install/custom/laptop.sh.yrz.am.sh +++ b/arch-root/_install/custom/laptop.sh.yrz.am.sh @@ -10,8 +10,5 @@ file_has_line "/etc/profile" "export FEAT_BRIGHTNESS=brightnessctl" # power install tlp systemctl enable tlp --now -cp_chown custom/laptop-tlp.conf /etc/tlp.conf root:root 644 +cp_chown custom/_laptop.sh.yrz.am/tlp.conf /etc/tlp.conf root:root 644 systemctl restart tlp - -# apps -install libreoffice-still diff --git a/arch-root/_install/greetd.toml b/arch-root/_install/greetd.toml new file mode 100644 index 0000000..b359c36 --- /dev/null +++ b/arch-root/_install/greetd.toml @@ -0,0 +1,7 @@ +[terminal] +vt = 1 + +[default_session] +command = "agreety --cmd .local/bin/init" +source_profile = false +user = "greeter" diff --git a/arch-root/install.sh b/arch-root/install.sh index 9a6aad1..3b118af 100644 --- a/arch-root/install.sh +++ b/arch-root/install.sh @@ -6,19 +6,22 @@ PACKAGES=( # system linux base linux-firmware lvm2 sudo polkit # base - pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # system - openssh man-db restic htop # admin utils + pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # system + openssh man-db restic htop # admin utils + + # generic runtime + nodejs dash # cli programs vifm vim # navigation & editors - dash shellcheck # shell scripting + shellcheck # shell scripting hugo miniserve neomutt translate-shell # www gnupg pass pass-otp # crypt jq libqalculate imagemagick # data processing git zip # others # desktop env - greetd wlr-randr sway swaybg swayidle xorg-xwayland # basic + greetd wlr-randr 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 @@ -31,6 +34,9 @@ PACKAGES=( # extensions vim-ale vim-fugitive + # not so good + telegram-desktop libreoffice-still + ) install() { @@ -89,6 +95,8 @@ while read -r entity; do fi done >~/.local/state/sway/out.log 2>>~/.local/state/sway/err.log diff --git a/arch-user/bin/run.sh b/arch-user/bin/run.sh index a1f90c0..6c811a4 100755 --- a/arch-user/bin/run.sh +++ b/arch-user/bin/run.sh @@ -14,6 +14,7 @@ else ) fi LIST+=( + "gui" "telegram-desktop" "gui" "gimp" "gui" "sqlitebrowser" # tui diff --git a/arch-user/config/profile.part b/arch-user/config/profile.part index 6eb3caf..d28d061 100644 --- a/arch-user/config/profile.part +++ b/arch-user/config/profile.part @@ -1,4 +1,3 @@ #!/bin/bash -export SESSION_START_COMMAND="sway --unsupported-gpu" export PATH=$PATH:~/.local/bin diff --git a/arch-user/config/sway/config.tmpl b/arch-user/config/sway/config.tmpl index 8dbd3b2..636d36c 100644 --- a/arch-user/config/sway/config.tmpl +++ b/arch-user/config/sway/config.tmpl @@ -3,6 +3,7 @@ set $mod Mod4 set $altmod Mod4+Mod5 set $altmod2 Mod4+Shift +set $kbmod Alt_R set $fwd m set $left n set $up e @@ -44,7 +45,7 @@ input "type:keyboard" { xkb_layout us(yz),ru(yz) repeat_rate 50 } -bindsym --to-code Super_L input "type:keyboard" xkb_switch_layout next; exec pkill -SIGRTMIN+1 i3blocks +bindsym --to-code $kbmod input "type:keyboard" xkb_switch_layout next; exec pkill -SIGRTMIN+1 i3blocks input "type:touchpad" { tap enabled natural_scroll enabled @@ -52,81 +53,90 @@ input "type:touchpad" { ############################################ ############### workspaces ################# -bindsym --to-code $mod+a workspace 1:a -bindsym --to-code $mod+r workspace 2:r -bindsym --to-code $mod+s workspace 3:s -bindsym --to-code $mod+t workspace 4:t -bindsym --to-code $mod+g workspace 5:g -bindsym --to-code $altmod+a move container to workspace 1:a -bindsym --to-code $altmod+r move container to workspace 2:r -bindsym --to-code $altmod+s move container to workspace 3:s -bindsym --to-code $altmod+t move container to workspace 4:t -bindsym --to-code $altmod+g move container to workspace 5:g +bindsym --to-code { + $mod+a workspace 1:a + $mod+r workspace 2:r + $mod+s workspace 3:s + $mod+t workspace 4:t + $mod+g workspace 5:g + $altmod+a move container to workspace 1:a + $altmod+r move container to workspace 2:r + $altmod+s move container to workspace 3:s + $altmod+t move container to workspace 4:t + $altmod+g move container to workspace 5:g +} bindgesture swipe:right workspace prev bindgesture swipe:left workspace next ############################################ ############### containers ################# # top row - layout modes, resize -bindsym --to-code $mod+q layout stacking -bindsym --to-code $mod+w layout tabbed -bindsym --to-code $mod+f fullscreen -bindsym --to-code $mod+p layout toggle split -bindsym --to-code $mod+l split v -bindsym --to-code $mod+u split h -bindsym --to-code $mod+y split none +bindsym --to-code { + $mod+q layout stacking + $mod+w layout tabbed + $mod+f fullscreen + $mod+p layout toggle split + $mod+l split v + $mod+u split h + $mod+y split none +} # mid row - focus, movement -bindsym --to-code $mod+$fwd focus child -bindsym --to-code $mod+$left focus left -bindsym --to-code $mod+$up focus up -bindsym --to-code $mod+$down focus down -bindsym --to-code $mod+$right focus right -bindsym --to-code $mod+$bwd focus parent -bindsym --to-code $altmod+$left move left 40px -bindsym --to-code $altmod+$up move up 40px -bindsym --to-code $altmod+$down move down 40px -bindsym --to-code $altmod+$right move right 40px -bindsym --to-code $altmod2+$left resize shrink width 2ppt or 40px -bindsym --to-code $altmod2+$up resize shrink height 4ppt or 40px -bindsym --to-code $altmod2+$down resize grow height 4ppt or 40px -bindsym --to-code $altmod2+$right resize grow width 2ppt or 40px +bindsym --to-code { + $mod+$fwd focus child + $mod+$left focus left + $mod+$up focus up + $mod+$down focus down + $mod+$right focus right + $mod+$bwd focus parent + $altmod+$left move left 40px + $altmod+$up move up 40px + $altmod+$down move down 40px + $altmod+$right move right 40px + $altmod2+$left resize shrink width 2ppt or 40px + $altmod2+$up resize shrink height 4ppt or 40px + $altmod2+$down resize grow height 4ppt or 40px + $altmod2+$right resize grow width 2ppt or 40px +} # bottom row - modeless, extra focus +bindsym --to-code { + $altmod+x move scratchpad + $mod+x scratchpad show + $altmod+z floating toggle + $mod+z focus mode_toggle + $mod+k focus prev sibling + $mod+h sticky toggle + $mod+Comma opacity minus 0.1 + $mod+Period opacity plus 0.1 + $mod+slash focus next sibling +} floating_modifier $mod normal -bindsym --to-code $altmod+x move scratchpad -bindsym --to-code $mod+x scratchpad show -bindsym --to-code $altmod+z floating toggle -bindsym --to-code $mod+z focus mode_toggle -bindsym --to-code $mod+k focus prev sibling -bindsym --to-code $mod+h sticky toggle -bindsym --to-code $mod+Comma opacity minus 0.1 -bindsym --to-code $mod+Period opacity plus 0.1 -bindsym --to-code $mod+slash focus next sibling ############################################ ################## actions #################### -# copy paste -bindsym --to-code $mod+d exec wtype -P XF86Cut -bindsym --to-code $mod+c exec wtype -P XF86Copy -bindsym --to-code $mod+v exec wtype -P XF86Paste -# media -bindsym --to-code XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%- && pkill -SIGRTMIN+2 i3blocks -bindsym --to-code XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+ && pkill -SIGRTMIN+2 i3blocks -bindsym --to-code XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle && pkill -SIGRTMIN+2 i3blocks -bindsym --to-code XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% && pkill -SIGRTMIN+2 i3blocks -bindsym --to-code XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5% && pkill -SIGRTMIN+2 i3blocks -bindsym --to-code XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks -# basic scripts -bindsym --to-code $mod+Escape kill -bindsym --to-code $mod+Return exec footclient -bindsym --to-code $mod+Space exec run.sh +bindsym --to-code { + # generic + $mod+Escape kill + # copy paste + $mod+d exec wtype -P XF86Cut + $mod+c exec wtype -P XF86Copy + $mod+v exec wtype -P XF86Paste + # media + XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%- && pkill -SIGRTMIN+2 i3blocks + XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+ && pkill -SIGRTMIN+2 i3blocks + XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle && 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 + XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks + # basic scripts + $mod+Return exec footclient + $mod+Space exec run.sh +} ############################################## ################# daemons #################### -exec swayidle -w \ - timeout 280 'notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "swayidle" -t 20000' \ - timeout 300 'systemctl suspend' exec foot -s -exec mako +exec ~/.local/bin/mako/init.sh +exec swayidle ############################################## ############## app-specific ################## diff --git a/arch-user/config/swayidle/config b/arch-user/config/swayidle/config new file mode 100644 index 0000000..c8ec1bf --- /dev/null +++ b/arch-user/config/swayidle/config @@ -0,0 +1,2 @@ +timeout 280 'notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "idle" -t 20000' +timeout 300 'systemctl suspend' diff --git a/arch-user/config/theme.sh b/arch-user/config/theme.sh index d6de8c1..05269cd 100644 --- a/arch-user/config/theme.sh +++ b/arch-user/config/theme.sh @@ -10,7 +10,7 @@ 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_SMALL_MULT=0.875 export THEME_SIZE_FONT_LARGE_MULT=1.1125 export THEME_FONT_REGULAR=Roboto export THEME_FONT_MONO="Roboto Mono" diff --git a/arch-user/config/xkb/symbols/us b/arch-user/config/xkb/symbols/us index 9f7cc21..08dd4f8 100644 --- a/arch-user/config/xkb/symbols/us +++ b/arch-user/config/xkb/symbols/us @@ -14,7 +14,7 @@ xkb_symbols "yz" { replace key { [ Super_L ] }; replace key { [ ISO_Level3_Shift ] }; replace key { [ Alt_L ] }; - + replace key { [ Alt_R ] }; # layer3 # TODO: migrate to type=ALPHANUMERIC # This would fix caps lock which i dont use anyway diff --git a/arch-user/install.sh b/arch-user/install.sh index 2b3d067..d63e607 100644 --- a/arch-user/install.sh +++ b/arch-user/install.sh @@ -10,9 +10,30 @@ umask 002 [[ "$(id -u)" == "0" ]] && echo "ERROR: wrong user" >&1 && exit 1 ####### file structure ######### -mkdir -p \ - ~/.config ~/.local/bin ~/.local/share ~/.cache \ - ~/tmp ~/know ~/dev ~/dl +USER_DIRS=( + ##### xdg ##### + ~/.config + ~/.local/bin # bkp=weak + ~/.local/share # bkp=weak + ~/.local/state + ~/.cache + # app + ~/.local/state/sway + ################ + ##### user ##### + # core knowledge base + ~/know # bkp=true,roam=true + # large blobs for knowledge base + ~/know-lfs # Large blobs for knowledge base. bkp=weak + # temp files with manual bulk cleanup + ~/tmp + # downloads + ~/dl # bkp=weak + # development - external vcs, tons of deps, etc. + ~/dev # bkp=weak + ################ +) +mkdir -p "${USER_DIRS[@]}" ################################ ########## scripts ############# @@ -35,6 +56,7 @@ cp -rf config/i3blocks ~/.config cp -rf config/git ~/.config cp -rf config/vim ~/.config cp -rf config/xkb ~/.config +cp -rf config/swayidle ~/.config # non-xdg cp -rf config/bash ~/.config