1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
urosm 39f2d64803 update `README.md` 2024-05-05 18:04:41 +02:00
urosm 0ba0e19b05 update `sway` config 2024-05-05 18:04:34 +02:00
2 changed files with 161 additions and 224 deletions

View File

@ -13,6 +13,8 @@ set $white #e2e2e2
set $blue #856cff
set $magenta #ff1170
set $red #fa3500
set $orange #d06600
set $green #009843
# workspaces
set $wsq 0:q:cmd
@ -27,27 +29,39 @@ set $wso 8:o:cmd
set $wsp 9:p:rdp
# modes
set $session_mode " session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff "
set $layout_mode " layout: split(h) split(v) (s)tacking (t)abbed "
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff"
set $layout_mode "layout: split(h) split(v) (s)tacking (t)abbed"
# commands
set $swaylock swaylock -f \
--color=$black \
--indicator-radius 1200 \
--inside-color=$blue \
--inside-clear-color=$green \
--inside-caps-lock-color=$orange \
--inside-ver-color=$magenta \
--inside-wrong-color=$red \
--text-color=#00000000 \
--text-clear-color=#00000000 \
--text-ver-color=#00000000 \
--text-wrong-color=#00000000
# bar ##########################################################################
bar {
separator_symbol ""
status_command status.sh
status_edge_padding 0
status_padding 0
strip_workspace_numbers yes
wrap_scroll yes
colors {
background $black
statusline $blue
separator $blue
# border background text
focused_workspace $black $black $magenta
active_workspace $black $black $white
inactive_workspace $black $black $blue
urgent_workspace $black $black $red
}
separator_symbol " | "
status_command status.sh
strip_workspace_numbers yes
wrap_scroll yes
colors {
background $black
statusline $blue
separator $blue
# border background text
focused_workspace $black $black $magenta
active_workspace $black $black $white
inactive_workspace $black $black $blue
urgent_workspace $black $black $red
}
}
# workspace_layout #############################################################
@ -62,13 +76,13 @@ bindsym $mod+shift+f floating toggle
# focus
bindsym {
$mod+$up focus up
$mod+$down focus down
$mod+$left focus left
$mod+$right focus right
$mod+a focus parent
$mod+s focus child
$mod+g focus mode_toggle
$mod+$up focus up
$mod+$down focus down
$mod+$left focus left
$mod+$right focus right
$mod+a focus parent
$mod+s focus child
$mod+g focus mode_toggle
}
# fullscreen
@ -76,30 +90,30 @@ bindsym $mod+f fullscreen toggle
# mode
bindsym {
$mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable
$mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable
}
# move
bindsym {
$mod+shift+$up move up
$mod+shift+$down move down
$mod+shift+$left move left
$mod+shift+$right move right
--to-code $mod+shift+tab move workspace back_and_forth, workspace back_and_forth
--to-code $mod+shift+q move workspace $wsq, workspace $wsq
--to-code $mod+shift+w move workspace $wsw, workspace $wsw
--to-code $mod+shift+e move workspace $wse, workspace $wse
--to-code $mod+shift+r move workspace $wsr, workspace $wsr
--to-code $mod+shift+t move workspace $wst, workspace $wst
--to-code $mod+shift+y move workspace $wsy, workspace $wsy
--to-code $mod+shift+u move workspace $wsu, workspace $wsu
--to-code $mod+shift+i move workspace $wsi, workspace $wsi
--to-code $mod+shift+o move workspace $wso, workspace $wso
--to-code $mod+shift+p move workspace $wsp, workspace $wsp
--to-code $mod+shift+bracketleft move workspace prev, workspace prev
--to-code $mod+shift+bracketright move workspace next, workspace next
$mod+colon move scratchpad
$mod+shift+$up move up
$mod+shift+$down move down
$mod+shift+$left move left
$mod+shift+$right move right
--to-code $mod+shift+tab move workspace back_and_forth, workspace back_and_forth
--to-code $mod+shift+q move workspace $wsq, workspace $wsq
--to-code $mod+shift+w move workspace $wsw, workspace $wsw
--to-code $mod+shift+e move workspace $wse, workspace $wse
--to-code $mod+shift+r move workspace $wsr, workspace $wsr
--to-code $mod+shift+t move workspace $wst, workspace $wst
--to-code $mod+shift+y move workspace $wsy, workspace $wsy
--to-code $mod+shift+u move workspace $wsu, workspace $wsu
--to-code $mod+shift+i move workspace $wsi, workspace $wsi
--to-code $mod+shift+o move workspace $wso, workspace $wso
--to-code $mod+shift+p move workspace $wsp, workspace $wsp
--to-code $mod+shift+bracketleft move workspace prev, workspace prev
--to-code $mod+shift+bracketright move workspace next, workspace next
$mod+colon move scratchpad
}
# scratchpad
@ -110,61 +124,61 @@ bindsym $mod+shift+g sticky toggle
# exec
bindsym {
$mod+return exec footclient
$mod+shift+return exec foot
$mod+space exec footclient -T "run" sh -c "IFS=:; find \$PATH -type f,l -perm -100 | fzy -p'run > ' | xargs -r swaymsg exec"
$mod+shift+space exec footclient -T "find" sh -c "find | fzy -p'find > ' | xargs -r swaymsg exec xdg-open"
$mod+home exec footclient -T "nmcli" nmcli_fzy.sh
$mod+shift+home exec footclient -T "nmtui" sh -c "nmtui"
$mod+end exec footclient -T "mount" udisksctl_fzy.sh
$mod+x exec makoctl dismiss
$mod+shift+x exec makoctl restore
print exec grim - | wl-copy
$mod+return exec footclient
$mod+shift+return exec foot
$mod+space exec fuzzel
$mod+shift+space exec "$(fuzzel -d -l 0 -p'$ ')"
$mod+slash exec xdg-open "$(find -type f | fuzzel -d -p'$ xdg-open ')"
$mod+home exec footclient nmtui connect
$mod+shift+home exec footclient nmtui
$mod+n exec makoctl dismiss
$mod+shift+n exec makoctl restore
print exec grim - | wl-copy
}
# exec (laptop)
bindsym {
XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_source "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl set "+1%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl set "1%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl set "+10%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl set "10%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl set "+1%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl set "1%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl set "+10%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl set "10%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
}
# resize
bindsym {
$mod+control+$left resize shrink width
$mod+control+$down resize grow height
$mod+control+$up resize shrink height
$mod+control+$right resize grow width
$mod+control+$left resize shrink width
$mod+control+$down resize grow height
$mod+control+$up resize shrink height
$mod+control+$right resize grow width
}
# workspace
bindsym {
--to-code $mod+tab workspace back_and_forth
--to-code $mod+q workspace $wsq
--to-code $mod+w workspace $wsw
--to-code $mod+e workspace $wse
--to-code $mod+r workspace $wsr
--to-code $mod+t workspace $wst
--to-code $mod+y workspace $wsy
--to-code $mod+u workspace $wsu
--to-code $mod+i workspace $wsi
--to-code $mod+o workspace $wso
--to-code $mod+p workspace $wsp
--to-code $mod+bracketleft workspace prev
--to-code $mod+bracketright workspace next
--to-code $mod+tab workspace back_and_forth
--to-code $mod+q workspace $wsq
--to-code $mod+w workspace $wsw
--to-code $mod+e workspace $wse
--to-code $mod+r workspace $wsr
--to-code $mod+t workspace $wst
--to-code $mod+y workspace $wsy
--to-code $mod+u workspace $wsu
--to-code $mod+i workspace $wsi
--to-code $mod+o workspace $wso
--to-code $mod+p workspace $wsp
--to-code $mod+bracketleft workspace prev
--to-code $mod+bracketright workspace next
}
# client.* #####################################################################
# class border background text indicator child_border
client.focused $black $black $magenta $red $black
client.focused_inactive $black $black $blue $black $black
client.unfocused $black $black $blue $black $black
client.urgent $black $black $red $black $black
# class border background text indicator child_border
client.focused $magenta $magenta $black $red $black
client.focused_inactive $blue $blue $black $black $black
client.unfocused $blue $blue $black $black $black
client.urgent $red $red $black $black $black
# default_border ###############################################################
default_border normal 0
@ -174,18 +188,18 @@ default_floating_border normal 0
# exec #########################################################################
exec {
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
swayidle -w \
timeout 300 'swaylock -fu -c$blue' \
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
before-sleep 'swaylock -fu -c$blue'
wlsunset -l 45 -L 15
mako
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
swayidle -w \
timeout 300 '$swaylock' \
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
before-sleep '$swaylock'
wlsunset -l 45 -L 15
mako
}
workspace $wse
exec "foot --server", exec "sleep 0.1; footclient"
exec foot -s
# focus_wrapping ###############################################################
focus_wrapping yes
@ -197,10 +211,10 @@ font monospace 13
# keyboard
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
}
# touchpad
@ -212,26 +226,26 @@ input "type:touchpad" {
# session
mode $session_mode {
bindsym {
r reload, mode default
l exec swaylock -fu -c$blue, mode default
q exit, mode default
s exec systemctl suspend, mode default
b exec systemctl reboot, mode default
p exec systemctl poweroff, mode default
escape mode default
}
bindsym {
r reload, mode default
l exec $swaylock, mode default
q exit, mode default
s exec systemctl suspend, mode default
b exec systemctl reboot, mode default
p exec systemctl poweroff, mode default
escape mode default
}
}
# layout
mode $layout_mode {
bindsym {
h layout splith, mode default
v layout splitv, mode default
s layout stacking, mode default
t layout tabbed, mode default
escape mode default
}
bindsym {
h layout splith, mode default
v layout splitv, mode default
s layout stacking, mode default
t layout tabbed, mode default
escape mode default
}
}
# seat #########################################################################
@ -239,3 +253,5 @@ seat * hide_cursor 1000
# output #######################################################################
output * background $black solid_color
# vim:

141
README.md
View File

@ -1,150 +1,71 @@
# dot
This repo tracks user and system configuration files, installed packages
and used commands for several machines or virtual servers. All are
running Debian. The `milano` section documents our desktop setup based
on `sway`, `foot`, `neovim` and `fzy`.
and initial command history for setting-up a desktop environment running Debian
testing/unstable with `sway`, `foot`, `fuzzel` and `neovim`.
## milano
## bootstrap the dotfiles
```sh
# urosm@milano
## bootstrap dotfiles
```
sudo apt install git
git init -b main
git remote add origin gitea@git.kompot.si:urosm/dot.git
git pull origin main
## disable annoying .sudo_as_admin_successful file
```
## setup urosm@milano
```sh
# disable the annoying `.sudo_as_admin_successful` file
sudo cp -ri .config/sudoers.d /etc/
## update to debian testing
# update to debian testing
sudo cp -ri .config/apt /etc/
sudo apt update
sudo apt full-upgrade
sudo apt install apt-listbugs apt-listchanges
## reconfigure locales
# reconfigure locales
sudo dpkg-reconfigure locales
## install tasksel packages
sudo tasksel install web-server
sudo tasksel install ssh-server
## harden ssh
sudo cp -ri .config/ssh /etc/
systemctl restart sshd
## install and configure firewall
sudo apt install ufw
sudo ufw allow "SSH"
sudo ufw allow 1194/udp
sudo ufw enable
## install utils
sudo apt install network-manager
# configure and start firewall
sudo cp -ri .config/nftables.conf /etc/
systemctl enable --now nftables.service
# configure and install networking
sudo cp -ir .config/network /etc/
sudo apt install network-manager
# install utils
sudo apt install udisks2
sudo apt install jq
sudo apt install fzy
## install neovim
sudo apt install neovim
## install desktop packages
# install desktop packages
sudo apt install sway
sudo apt install swayidle swaylock
sudo apt install brightnessctl wlsunset
sudo apt install wl-clipboard grim
sudo apt install libnotify-bin mako-notifier
sudo apt install grim
sudo apt install mako-notifier libnotify-bin
sudo apt install fonts-agave
## install and configure audio packages
# install neovim
sudo apt install neovim wl-clipboard
# install and configure audio packages
sudo apt install pipewire-audio
systemctl --user enable --now wireplumber.service
## install writing packages
# install writing packages
sudo apt install make
sudo apt install pandoc
sudo apt install texlive-latex-extra
sudo apt install texlive-lang-european
## install web packages
# install web packages
sudo apt install firefox
sudo apt install thunderbird
## install media packages
# install media packages
sudo apt install mpv
sudo apt install zathura
sudo apt install inkscape
## install office packages
# install office packages
sudo apt install libreoffice libreoffice-gtk3
sudo apt install libreoffice-l10n-sl
## install printing packages
# install printing and scanning packages
sudo apt install cups printer-driver-all
sudo adduser urosm lpadmin
## install scanning packages
sudo apt install simple-scan
## install pdf processing packages
# install pdf processing packages
sudo apt install qpdf ocrmypdf
## install rdp packages
# install rdp packages
sudo apt install remmina
## install and setup ikiwiki
sudo apt install ikiwiki
sudo apt install libfile-mimeinfo-perl libhighlight-perl libhtml-tree-perl libimage-magick-perl liblocale-gettext-perl libmailtools-perl libnet-amazon-s3-perl libnet-inet6glue-perl libsearch-xapian-perl libsort-naturally-perl libtext-csv-perl libtext-multimarkdown-perl libtext-textile-perl libtext-typography-perl libtext-wikicreole-perl libtext-wikiformat-perl libxml-feed-perl libxml-writer-perl
chmod 711 $HOME
sudo a2enmod userdir
sudo a2enmod cgi
sudo cp .config/apache2/sites-available/kontrakurs.localhost.conf /etc/apache2/sites-available/
sudo cp .config/apache2/sites-available/bavbavhaus.localhost.conf /etc/apache2/sites-available/
sudo a2ensite kontrakurs.localhost bavbavhaus.localhost
systemctl restart apache2
```
## {padova,tivoli,genova}
```sh
ssh root@padova
adduser urosm
adduser urosm sudo
exit
ssh-copy-id urosm@padova
ssh urosm@padova
## bootstrap dotfiles
sudo apt update
sudo apt upgrade
sudo apt install git
git init -b main
git remote add origin gitea@git.kompot.si:urosm/dot.git
git pull origin main
## disable annoying .sudo_as_admin_successful file
sudo cp -ri .config/sudoers.d /etc/
## install screen
sudo apt install screen
## install and configure firewall
sudo apt install ufw
sudo ufw allow "SSH" # ssh
sudo ufw allow 1194/udp # vpn
sudo ufw allow "WWW Full" # web
sudo ufw allow "SMTP" # mail
sudo ufw allow "Mail submission" # mail
sudo ufw allow "IMAP" # mail
sudo ufw allow "IMAPS" # mail
sudo ufw enable
## harden ssh
sudo cp -ri .config/ssh /etc/
sudo systemctl restart sshd
## install and configure wireguard
sudo cp -ir .config/sysctl.d /etc/
sudo sysctl -p
sudo apt install wireguard
sudo cp -i .config/wireguard/padova.conf /etc/wireguard/
wg-quick up padova
## install and configure webserver
sudo tasksel install web-server
sudo a2enmod rewrite
sudo a2enmod userdir
sudo a2enmod cgi
chmod 711 "$HOME"
sudo cp -ir .config/apache2/sites-available /etc/apache2/
sudo a2ensite bavbavhaus.net
sudo a2ensite kontrakurs.org
sudo systemctl reload apache2
## install certbot
sudo apt install certbot
sudo apt install python3-certbot-apache
sudo certbot --apache
## install ikiwiki
sudo apt install --install-recommends ikiwiki
sudo apt install libfile-mimeinfo-perl libhighlight-perl libhtml-tree-perl libimage-magick-perl liblocale-gettext-perl libmailtools-perl libnet-amazon-s3-perl libnet-inet6glue-perl libsearch-xapian-perl libsort-naturally-perl libtext-csv-perl libtext-multimarkdown-perl libtext-textile-perl libtext-typography-perl libtext-wikicreole-perl libtext-wikiformat-perl libxml-feed-perl libxml-writer-perl
## enable unattended-upgrades
sudo apt install unattended-upgrades apt-listchanges
sudo dpkg-reconfigure -plow unattended-upgrades
```