From 29a90d44d8d61f4447a542bd53e96ad037ba2f78 Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Mon, 27 Oct 2025 15:31:39 +0100 Subject: [PATCH] added endos.py - the sweet nextgen install script --- .gitsecret/paths/mapping.cfg | 2 +- .../profile_default/ipython_config.py | 0 .../.jupyter}/jupyter_console_config.py | 0 .../.jupyter}/jupyter_notebook_config.py | 0 .../.jupyter}/jupyter_qtconsole_config.py | 0 ROOT/etc/systemd/logind.conf.d/suspend.conf | 8 + ROOT/etc/systemd/sleep.conf.d/hibernate.conf | 2 + custom-sl3/sway/config.d/99_input | 3 + custom-sl3/sway/config.d/99_output | 1 + custom-spro5/sway/config.d/99_input | 3 + custom-spro5/sway/config.d/99_output | 1 + manjaro.sh => deprecated_manjaro.sh | 0 endos.py | 347 ++++++++++++++++++ environment.d/0-sway.conf | 5 - foot/foot.ini | 8 +- homeassistant/SERVICE_ACCOUNT.JSON.secret | Bin 2249 -> 2246 bytes sway/config.d/10_application_defaults | 31 ++ sway/config.d/10_autostart_applications | 50 +++ sway/config.d/10_default | 247 +++++++++++++ sway/config.d/10_input | 19 + sway/config.d/10_theme | 38 ++ vdirsyncer/config.secret | Bin 1299 -> 1295 bytes 22 files changed, 758 insertions(+), 7 deletions(-) rename {ipython => HOME/.ipython}/profile_default/ipython_config.py (100%) rename {jupyter => HOME/.jupyter}/jupyter_console_config.py (100%) rename {jupyter => HOME/.jupyter}/jupyter_notebook_config.py (100%) rename {jupyter => HOME/.jupyter}/jupyter_qtconsole_config.py (100%) create mode 100644 ROOT/etc/systemd/logind.conf.d/suspend.conf create mode 100644 ROOT/etc/systemd/sleep.conf.d/hibernate.conf create mode 100644 custom-sl3/sway/config.d/99_input create mode 100644 custom-sl3/sway/config.d/99_output create mode 100644 custom-spro5/sway/config.d/99_input create mode 100644 custom-spro5/sway/config.d/99_output rename manjaro.sh => deprecated_manjaro.sh (100%) create mode 100755 endos.py create mode 100644 sway/config.d/10_application_defaults create mode 100644 sway/config.d/10_autostart_applications create mode 100644 sway/config.d/10_default create mode 100644 sway/config.d/10_input create mode 100644 sway/config.d/10_theme diff --git a/.gitsecret/paths/mapping.cfg b/.gitsecret/paths/mapping.cfg index c9b8a83..ad9d13e 100644 --- a/.gitsecret/paths/mapping.cfg +++ b/.gitsecret/paths/mapping.cfg @@ -1,2 +1,2 @@ homeassistant/SERVICE_ACCOUNT.JSON:5a3eabcbc53278f7713423b0ea20d0558f6334f8a1f6aed2a2e4cfb2ca9c93ab -vdirsyncer/config:4858db17e53be276ae7dbff5492f039c316652bc624fe079891b69f6988306b0 +vdirsyncer/config:73434db7346e1d070c38c8099c0c8ec99925f4d89ba3e558875fa2a179f41a25 diff --git a/ipython/profile_default/ipython_config.py b/HOME/.ipython/profile_default/ipython_config.py similarity index 100% rename from ipython/profile_default/ipython_config.py rename to HOME/.ipython/profile_default/ipython_config.py diff --git a/jupyter/jupyter_console_config.py b/HOME/.jupyter/jupyter_console_config.py similarity index 100% rename from jupyter/jupyter_console_config.py rename to HOME/.jupyter/jupyter_console_config.py diff --git a/jupyter/jupyter_notebook_config.py b/HOME/.jupyter/jupyter_notebook_config.py similarity index 100% rename from jupyter/jupyter_notebook_config.py rename to HOME/.jupyter/jupyter_notebook_config.py diff --git a/jupyter/jupyter_qtconsole_config.py b/HOME/.jupyter/jupyter_qtconsole_config.py similarity index 100% rename from jupyter/jupyter_qtconsole_config.py rename to HOME/.jupyter/jupyter_qtconsole_config.py diff --git a/ROOT/etc/systemd/logind.conf.d/suspend.conf b/ROOT/etc/systemd/logind.conf.d/suspend.conf new file mode 100644 index 0000000..33648b7 --- /dev/null +++ b/ROOT/etc/systemd/logind.conf.d/suspend.conf @@ -0,0 +1,8 @@ +[Login] +IdleAction=suspend-then-hibernate +IdleActionSec=10min +HandlePowerKey=suspend-then-hibernate +HandlePowerKeyLongPress=poweroff +HandleLidSwitch=suspend-then-hibernate +HandleLidSwitchExternalPower=suspend-then-hibernate +HandleLidSwitchDocked=ignore diff --git a/ROOT/etc/systemd/sleep.conf.d/hibernate.conf b/ROOT/etc/systemd/sleep.conf.d/hibernate.conf new file mode 100644 index 0000000..1dcc192 --- /dev/null +++ b/ROOT/etc/systemd/sleep.conf.d/hibernate.conf @@ -0,0 +1,2 @@ +[sleep] +HibernateDelaySec=30min diff --git a/custom-sl3/sway/config.d/99_input b/custom-sl3/sway/config.d/99_input new file mode 100644 index 0000000..2ddd5c4 --- /dev/null +++ b/custom-sl3/sway/config.d/99_input @@ -0,0 +1,3 @@ +input type:touchpad { + pointer_accel 0.8 +} diff --git a/custom-sl3/sway/config.d/99_output b/custom-sl3/sway/config.d/99_output new file mode 100644 index 0000000..3fbb277 --- /dev/null +++ b/custom-sl3/sway/config.d/99_output @@ -0,0 +1 @@ +output eDP-1 resolution 2736x1824 scale 1.6 diff --git a/custom-spro5/sway/config.d/99_input b/custom-spro5/sway/config.d/99_input new file mode 100644 index 0000000..ad2c42e --- /dev/null +++ b/custom-spro5/sway/config.d/99_input @@ -0,0 +1,3 @@ +input type:touchpad { + pointer_accel 0.4 +} diff --git a/custom-spro5/sway/config.d/99_output b/custom-spro5/sway/config.d/99_output new file mode 100644 index 0000000..465ac40 --- /dev/null +++ b/custom-spro5/sway/config.d/99_output @@ -0,0 +1 @@ +output eDP-1 resolution 2496x1664 scale 1.6 diff --git a/manjaro.sh b/deprecated_manjaro.sh similarity index 100% rename from manjaro.sh rename to deprecated_manjaro.sh diff --git a/endos.py b/endos.py new file mode 100755 index 0000000..c027073 --- /dev/null +++ b/endos.py @@ -0,0 +1,347 @@ +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.13" +# dependencies = [ +# "defopt", +# ] +# /// +# TODO +# add or deprecate +# - ROOT/etc/[greetd|qtgreet] +# - ROOT/usr/local/bin/start-sway +# - custom-droneship +# - custom-mothership +# - homeassistant + musicassistant +# - environment.d +# - HOME/.profile +# - waybar +# - mypy +# - mako +# - helix +# - nushell +from difflib import unified_diff +from os.path import lexists +from pathlib import Path +from subprocess import run +from urllib.request import urlretrieve + +HOME = Path("~").expanduser() +CFG = HOME / ".config" +DOTFILES = HOME / "dotfiles" +CUSTOMDIR = DOTFILES / f"custom-{open('/etc/hostname').read().strip()}" +installmap = dict( + fonts=("noto-fonts-emoji", "ttf-hack", "font-manager"), + nushell=("nushell", "oh-my-posh", "carapace-bin", "zoxide"), + tmux=("tmux", "urlscan"), + nvim=("neovim", "ripgrep"), + utils=("uv", "bat", "ncdu", "unzip", "jq"), + gittools=("tig", "diff-so-fancy", "git-secret", "git-delta", "git-lfs", "lazygit"), + pdftools=("sioyek", "zathura", "zathura-pdf-mupdf", "zathura-djvu", "zathura-ps"), + media=("vlc", "mpv", "protobuf", "yt-dlp", "quodlibet", "qimgv"), + filebrowsers=("pcmanfm", "yazi", "ranger", "zoxide", "eza"), + netbrowsers=( + "qutebrowser", + "firefox", + "python-adblock", + "python-tldextract", + "bitwarden-cli", # for qutebrowser autofill + ), + chat=("discordo-git", "gurk"), + emailcalrss=( + "khard", # contacts + "khal", # calendar + "aerc", # email + "newsboat", # rss reader + "vdirsyncer", # sync calendar+contacts + "pandoc", # md2html for aerc + "pass", # password manager for aerc and newsboat + "w3m", # terminal browser for aerc and newsboat + "urlscan", # url finder for newsboat + "python-aiohttp-oauthlib", # for google vdirsyncer + ), + monitors=( + "btop", # hardware + "nvtop", # gpu + "lazyjournal", # journald + "isd", # systemd + "bandwhich", # network + ), + apps=("bitwarden", "qalculate-gtk", "vesktop"), + swaytools=( + "flashfocus", # quick flash when changing app in focus + "noisetorch", # noise cancellation + "unipicker", # unicode symbol selector + "wl-clip-persist", # keep clipboard after close + "wlsunset", # eye saver + "blueman", # bluetooth + "wdisplays", # ui for display settings + "wev", # debugging of ui + "gtklock", # lock screen + ), + remotedata=("rclone", "dropbox", "minio-client"), + screensharing=( + "wireplumber", + "xdg-desktop-portal", + "xdg-desktop-portal-wlr", + ), + optional_nvidia=("cuda", "nvidia-settings"), + optional_coolercontrol=("coolercontrol",), + optional_containers=( + "docker", + "docker-compose", + "docker-buildx", # advanced build + "qemu-user-static-binfmt", # build arm64 + "qemu-user-static", # build arm64 + "dry-bin", # docker tui + "k9s", # kubernetes tui + ), + optional_nvidia_containers=("nvidia-docker",), +) + + +def compare(src: Path, tgt: Path) -> str: + if src.is_dir(): + diff = "" + for subsrc in src.glob("**/*"): + subpath = subsrc.relative_to(src) # NOTE: dirty code! + subtgt = tgt / subpath + if subtgt.exists() and lexists(subtgt): + diff += compare(subsrc, subtgt) + return diff + else: + srcdata = open(src).readlines() if src.exists() else [] + tgtdata = open(tgt).readlines() if tgt.exists() else [] + return "".join(unified_diff(srcdata, tgtdata, str(src), str(tgt))) + + +def helper_maybe_symlink(src: Path, tgt: Path, overwrite: bool) -> bool: + src = src.expanduser() + tgt = tgt.expanduser() + tgt.parent.mkdir(exist_ok=True) + if lexists(tgt): + if not overwrite: + if diff := compare(src, tgt): + print("DIFF:\n" + diff) + if input("overwrite? (y/n) ") == "n": + return False + if tgt.is_file() or tgt.is_symlink(): + tgt.unlink() + else: + tgt.rmdir() + tgt.symlink_to(src) + return True + + +def helper_symlink_contents( + src_folder: Path, tgt_folder: Path, overwrite: bool +) -> None: + src_folder = src_folder.expanduser() + tgt_folder = tgt_folder.expanduser() + tgt_folder.mkdir(exist_ok=True) + assert src_folder.is_dir() + assert tgt_folder.is_dir() or tgt_folder.is_symlink() + for src in src_folder.iterdir(): + if src.name.endswith(".secret"): # git-secret item + continue + helper_maybe_symlink(src, tgt_folder / src.name, overwrite) + + +def helper_check_if_installed(pkg: str) -> bool: + return run(["yay", "-Qs", pkg], capture_output=True).returncode == 0 + + +def helper_uninstall(*pkgs: str) -> None: + for pkg in pkgs: + run(["yay", "-Rns", pkg], capture_output=True) + + +def helper_install(*pkgs: str, reinstall: bool) -> None: + for pkg in pkgs: + if reinstall or not helper_check_if_installed(pkg): + assert run(["yay", "-S", pkg]).returncode == 0 + + +def install_fonts(reinstall: bool) -> None: + urlretrieve( + "https://raw.githubusercontent.com/SUNET/static_sunet_se/refs/heads/master/fonts/Akkurat-Mono.otf", + Path("~/.local/share/fonts/Akkurat-Mono.otf").expanduser(), + ) + helper_install(*installmap["fonts"], reinstall=reinstall) + + +def install_nushell(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["nushell"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "nushell", CFG / "nushell", overwrite) + run("sudo chsh -s /usr/bin/nu".split()) + url = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/refs/heads/main/themes/peru.omp.json" + run(["oh-my-posh", "init", "nu", "--config", url]) + + +def install_tmux(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["tmux"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "tmux", CFG / "tmux", overwrite) + tpmpath = CFG / "tmux/plugins/tpm" + if overwrite or not lexists(tpmpath): + if lexists(tpmpath): + if tpmpath.is_symlink(): + tpmpath.unlink() + else: + tpmpath.rmdir() + run(["git", "clone", "https://github.com/tmux-plugins/tpm", tpmpath]) + + +def install_nvim(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["nvim"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "nvim", CFG / "nvim", overwrite) + + +def install_gittools(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["gittools"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "tig", CFG / "tig", overwrite) + helper_maybe_symlink(DOTFILES / "HOME/.gitconfig", Path("~/.gitconfig"), overwrite) + + +def install_pdftools(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["pdftools"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "sioyek", CFG / "sioyek", overwrite) + helper_symlink_contents(DOTFILES / "zathura", CFG / "zathura", overwrite) + + +def install_filebrowsers(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["filebrowsers"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "ranger", CFG / "ranger", overwrite) + helper_symlink_contents(DOTFILES / "yazi", CFG / "yazi", overwrite) + for plugin in [ + "chmod", + "git", + "mount", + "piper", + "smart-enter", + "smart-filter", + "toggle-pane", + ]: + run(f"ya pkg add yazi-rs/plugins:{plugin}".split()) + + +def install_chat(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["chat"], reinstall=reinstall) + helper_symlink_contents(DOTFILES / "discordo", CFG / "discordo", overwrite) + helper_symlink_contents(DOTFILES / "gurk", CFG / "gurk", overwrite) + + +def install_emailcalrss(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["emailcalrss"], reinstall=reinstall) + for tgt in ["vdirsyncer", "khard", "khal", "aerc", "newsboat"]: + helper_symlink_contents(DOTFILES / tgt, CFG / tgt, overwrite) + for sub in [".local/share/applications/userapp-khalimport.des", ".w3m/keymap"]: + helper_maybe_symlink(DOTFILES / "HOME" / sub, HOME / sub, overwrite) + run(f"chmod 600 {CFG / 'aerc/accounts.conf'}".split()) + + +def install_swaytools(overwrite: bool, reinstall: bool) -> None: + helper_install(*installmap["swaytools"], reinstall=reinstall) + for base in [DOTFILES, CUSTOMDIR]: + sub = "sway/config.d" + helper_symlink_contents(base / sub, CFG / sub, overwrite) + run("sudo systemctl enable --now bluetooth".split()) + for sub in [ + "etc/systemd/logind.conf.d/suspend.conf", + "etc/systemd/sleep.conf.d/hibernate.conf", + ]: + run(["sudo", "cp", str(DOTFILES / "ROOT" / sub), str(Path("/") / sub)]) + run("sudo systemctl enable --now bluetooth".split()) + + +def configure_pytools(overwrite: bool) -> None: + for sub in [".ipython/profile_default", ".jupyter"]: + helper_symlink_contents(DOTFILES / "HOME" / sub, HOME / sub, overwrite) + + +def configure_foot(overwrite: bool) -> None: + helper_symlink_contents(DOTFILES / "foot", CFG / "foot", overwrite) + + +def installer( + overwrite: bool = False, + reinstall: bool = False, + with_gpu: bool = False, + with_containers: bool = False, + with_coolercontrol: bool = False, +) -> None: + if helper_check_if_installed("cliphist"): + helper_uninstall("cliphist") + print("removed cliphist") + install_fonts(reinstall) + print("installed fonts") + install_nushell(overwrite, reinstall) + print("installed nushell") + install_tmux(overwrite, reinstall) + print("installed tmux") + install_nvim(overwrite, reinstall) + print("installed nvim") + helper_install(*installmap["utils"], reinstall=reinstall) + print("installed utils") + install_gittools(overwrite, reinstall) + print("installed gittools") + install_pdftools(overwrite, reinstall) + print("installed pdftools") + helper_install(*installmap["media"], reinstall=reinstall) + print("installed media") + install_filebrowsers(overwrite, reinstall) + print("installed filebrowsers") + helper_install(*installmap["netbrowsers"], reinstall=reinstall) + print("installed netbrowsers") + install_emailcalrss(overwrite, reinstall) + print("installed emailcalrss") + install_chat(overwrite, reinstall) + print("installed chat") + helper_install(*installmap["monitors"], reinstall=reinstall) + print("installed monitors") + helper_install(*installmap["apps"], reinstall=reinstall) + print("installed apps") + install_swaytools(overwrite, reinstall) + print("installed sway") + helper_install(*installmap["remotedata"], reinstall=reinstall) + print("installed remotedata") + helper_install(*installmap["screensharing"], reinstall=reinstall) + print("installed screensharing") + configure_pytools(overwrite=overwrite) + print("configured python tools") + configure_foot(overwrite=overwrite) + print("configured foot") + if with_gpu: + helper_install(*installmap["optional_nvidia"], reinstall=reinstall) + print("installed nvidia") + if with_containers: + helper_install(*installmap["optional_containers"], reinstall=reinstall) + run("sudo systemctl enable --now docker.service".split()) + helper_symlink_contents(DOTFILES / "k9s", CFG / "k9s", overwrite) + print("installed containers") + if with_gpu and with_containers: + helper_install(*installmap["optional_nvidia_containers"], reinstall=reinstall) + print("installed nvidia containers") + if with_coolercontrol: + helper_install(*installmap["optional_coolercontrol"], reinstall=reinstall) + run("sudo systemctl enable --now coolercontrold.service".split()) + print("installed coolercontrol") + print(""" + MANUAL NEXT STEPS: + + set up vdirsyncer with google calendar using + https://vdirsyncer.pimutils.org/en/stable/config.html#google + + allow firefox windowed fullscreen by setting full-screen-api.ignore-widgets + to true in about:config + + set coolercontrold log level to WARN: + `sudo systemctl edit coolercontrold.service` + + docker with non-root daemon + `sudo groupadd docker && sudo usermod -aG docker $USER` + """) + + +if __name__ == "__main__": + import defopt + + defopt.run(installer) diff --git a/environment.d/0-sway.conf b/environment.d/0-sway.conf index 17ad520..d9b3ca6 100644 --- a/environment.d/0-sway.conf +++ b/environment.d/0-sway.conf @@ -11,12 +11,7 @@ NO_AT_BRIDGE=1 # QT theme QT_QPA_PLATFORMTHEME=qt5ct -# defaults -SYSTEMD_EDITOR=/usr/bin/nvim -EDITOR=/usr/bin/nvim -VISUAL=/usr/bin/nvim TERMINAL=/usr/bin/footclient -PAGER="bat --style=header,rule,snip" BROWSER=/usr/bin/qutebrowser # sioyek fix diff --git a/foot/foot.ini b/foot/foot.ini index b2ad24e..0616663 100644 --- a/foot/foot.ini +++ b/foot/foot.ini @@ -1,8 +1,14 @@ [main] -term=xterm-256color font=monospace:size=10,JetBrainsMono Nerd Font:size=10 dpi-aware=yes +[environment] +SYSTEMD_EDITOR=/usr/bin/nvim +EDITOR=/usr/bin/nvim +VISUAL=/usr/bin/nvim +PAGER="bat --style=header,rule,snip" +BROWSER=/usr/bin/qutebrowser + [scrollback] lines=100000 diff --git a/homeassistant/SERVICE_ACCOUNT.JSON.secret b/homeassistant/SERVICE_ACCOUNT.JSON.secret index 74fcb6a40f358670d6681048c311513affab8d7e..3b6935d1ab979bba870a4ec6ec75d2789c058a18 100644 GIT binary patch literal 2246 zcmV;%2s!tK0gMA{hqi78NQ7wt3;ri@YJyiqp>r8OI{I*|t6VD$Wb}&7y)Cai7WOIM zY1t$wZRj#}M4iaad|uxacM5RZD3b6Zy_E$$;JEDF zvXAy{j|psZ+lZS!rQkrVB9yHoV!cO*{70cI>7it(NE_F#*p4?d`pKoD3aVdMxlE(j zJENPU9<;sWY+Gh-jKN`s`U(-6*@`*BCMRUfC!&f<1F=4MFPF-azr-K!4*V+ad-~OEE3^UGE+zJsY%Az zb}pS7vyHvh4AO=qR8Xcdcg?2{l){97-oKU^OMC1rp<4px@Dl++G)}XK`^GX+5rL*vlr2Xco16?Pfx!{Z{s0__?uccY+@e;dt9#^ z$x_bF^lzkl3RZ~>F8WKBj_v|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 index 0000000..9bb778e --- /dev/null +++ b/sway/config.d/10_application_defaults @@ -0,0 +1,31 @@ +# Custom windowing rules +for_window [class="Yad" instance="yad"] floating enable +for_window [app_id="yad"] floating enable +for_window [app_id="blueman-manager"] floating enable, resize set width 40 ppt height 30 ppt +for_window [app_id="pavucontrol" ] floating enable, resize set width 40 ppt height 30 ppt +for_window [window_role="pop-up"] floating enable +for_window [window_role="bubble"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="Preferences"] floating enable +for_window [window_type="dialog"] floating enable +for_window [window_type="menu"] floating enable +for_window [window_role="About"] floating enable +for_window [title="File Operation Progress"] floating enable, border pixel 1, sticky enable, resize set width 40 ppt height 30 ppt +for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt +for_window [title="Picture in picture"] floating enable, sticky enable +for_window [title="waybar_htop"] floating enable, resize set width 70 ppt height 70 ppt +for_window [title="waybar_nmtui"] floating enable +for_window [title="Save File"] floating enable +for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill +# https://github.com/ValveSoftware/steam-for-linux/issues/1040 +for_window [app_id="^steam$"] floating enable +for_window [app_id="^Steam$"] floating enable +for_window [app_id="^steam$" title="^Steam$"] floating disable + +# Inhibit idle +for_window [app_id="firefox"] inhibit_idle fullscreen +for_window [app_id="Chromium"] inhibit_idle fullscreen + +# Don't allow applications to inhibit shortcuts, i.e. grab total control of the +# keyboard. Chrome currently abuses this by enabling it for all "--app=..." shortcuts. +seat * shortcuts_inhibitor disable diff --git a/sway/config.d/10_autostart_applications b/sway/config.d/10_autostart_applications new file mode 100644 index 0000000..03358e0 --- /dev/null +++ b/sway/config.d/10_autostart_applications @@ -0,0 +1,50 @@ +# Auth with polkit-gnome: +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +# Import environment variables for user systemd service manager +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK + +# Update dbus environments with display variables +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + +# Idle configuration +exec swayidle idlehint 1 +exec_always swayidle -w before-sleep "gtklock -d" + +# Desktop notifications +exec mako + +# Start foot server +exec_always --no-startup-id foot --server + +# Autotiling +exec autotiling + +# Network Applet +exec nm-applet --indicator + +# Firewall Applet +exec sleep 2 && firewall-applet + +# nwg-drawer +exec_always nwg-drawer -r -c 7 -is 90 -mb 10 -ml 50 -mr 50 -mt 10 + +# focus switch animations +exec systemctl --user enable --now flashfocus + +# usb automount +exec systemctl --user enable --now pcmanfm + +# persist clipboard after close +exec_always { + # persist clipboard after close + pkill -x wl-clip-persist + wl-clip-persist --clipboard regular --all-mime-type-regex '(?i)^(?!image/x-inkscape-svg).+' +} + +# enable noisetorch +exec_always { + noisetorch -u + noisetorch -i +} diff --git a/sway/config.d/10_default b/sway/config.d/10_default new file mode 100644 index 0000000..625899d --- /dev/null +++ b/sway/config.d/10_default @@ -0,0 +1,247 @@ +# Logo key. Use Mod1 for Alt. +set $mod Mod4 + +# Add Vim key support +set $left h +set $down j +set $up k +set $right l + +# Set default terminal emulator +set $term footclient + +# Application launcher +set $launcher fuzzel + +# Application menu +set $menu nwg-drawer + +# Power Menu +set $powermenu ~/.config/sway/scripts/power_menu.sh + +### Key bindings +# +# Basics: +# + bindsym $mod+r reload + + # Launch the terminal + bindsym $mod+Return exec $term + bindsym $mod+Shift+Return exec foot + + # Open the power menu + bindsym $mod+Shift+e exec $powermenu + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $launcher + + # Menu + bindsym $mod+Shift+d exec $menu + + # Lock screen + bindsym $mod+f1 exec gtklock + + # Activities + bindsym $mod+p exec ~/.config/sway/scripts/window_switcher.sh + + # Move windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Change "normal" to "inverse" to switch left and right + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + +# +# Moving around: +# + bindsym { + # Change window focus + $mod+Left focus left + $mod+Down focus down + $mod+Up focus up + $mod+Right focus right + # Vim key support + $mod+$left focus left + $mod+$down focus down + $mod+$up focus up + $mod+$right focus right + + # Move the focused window + $mod+Shift+Left move left + $mod+Shift+Down move down + $mod+Shift+Up move up + $mod+Shift+Right move right + # Vim key support + $mod+Shift+$left move left + $mod+Shift+$down move down + $mod+Shift+$up move up + $mod+Shift+$right move right + } + +# +# Workspaces: +# + # Workspace bindings are using bindcode instead of bindsym for better Azerty compatibility. + # https://github.com/EndeavourOS-Community-Editions/sway/pull/81 + # Use wev to find keycodes for setting up other bindings this way. + + bindcode { + # Switch to workspace + $mod+10 workspace number 1 + $mod+11 workspace number 2 + $mod+12 workspace number 3 + $mod+13 workspace number 4 + $mod+14 workspace number 5 + $mod+15 workspace number 6 + $mod+16 workspace number 7 + $mod+17 workspace number 8 + $mod+18 workspace number 9 + $mod+19 workspace number 10 + + # Move focused container to workspace + $mod+Shift+10 move container to workspace number 1 + $mod+Shift+11 move container to workspace number 2 + $mod+Shift+12 move container to workspace number 3 + $mod+Shift+13 move container to workspace number 4 + $mod+Shift+14 move container to workspace number 5 + $mod+Shift+15 move container to workspace number 6 + $mod+Shift+16 move container to workspace number 7 + $mod+Shift+17 move container to workspace number 8 + $mod+Shift+18 move container to workspace number 9 + $mod+Shift+19 move container to workspace number 10 + } + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. + +# +# Layout stuff: +# + # Set how the current window will be split + # Split the window vertically + # bindsym $mod+v splitv + # Split the window horizontally + # bindsym $mod+b splith + # Toggle + bindsym $mod+q split toggle + + # Switch the current container between different layout styles + bindsym $mod+w layout stacking + bindsym $mod+t layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle between tiling and floating mode + bindsym $mod+Shift+space floating toggle + bindsym $mod+Ctrl+space sticky toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent + # Move focus to the child container + bindsym $mod+Shift+a focus child + +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show + +# +# Resizing containers: +# + bindsym { + # Resize with arrow keys + $mod+ctrl+Right resize shrink width 10 px + $mod+ctrl+Up resize grow height 10 px + $mod+ctrl+Down resize shrink height 10 px + $mod+ctrl+Left resize grow width 10 px + # Resize with Vim keys + $mod+ctrl+$right resize shrink width 10 px + $mod+ctrl+$up resize grow height 10 px + $mod+ctrl+$down resize shrink height 10 px + $mod+ctrl+$left resize grow width 10 px + } + + # Resize floating windows with mouse scroll: + bindsym --whole-window --border { + # Resize vertically + $mod+button4 resize shrink height 5 px or 5 ppt + $mod+button5 resize grow height 5 px or 5 ppt + # Resize horizontally + $mod+Shift+button4 resize shrink width 5 px or 5 ppt + $mod+Shift+button5 resize grow width 5 px or 5 ppt + } + +# +# Media Keys +# + bindsym { + # Volume + XF86AudioRaiseVolume exec pamixer -ui 2 + XF86AudioLowerVolume exec pamixer -ud 2 + XF86AudioMute exec pamixer --toggle-mute + + # Player + XF86AudioPlay exec playerctl play-pause + XF86AudioNext exec playerctl next + XF86AudioPrev exec playerctl previous + + # Backlight + XF86MonBrightnessUp exec brightnessctl -c backlight set +5% + XF86MonBrightnessDown exec brightnessctl -c backlight set 5%- + } + +# +# App shortcuts +# + bindsym $mod+u exec unipicker --command "rofi -dmenu | wl-copy" + + # Launch the file explorer + bindsym $mod+b exec pcmanfm + + # Dismiss message + bindsym $mod+n exec makoctl dismiss + bindsym $mod+Shift+n exec makoctl dismiss -a + + # Launch the browser + bindsym $mod+o exec qutebrowser + + # config tools + set $mode_monitor (b) btop, (h) htop, (s) isd, (j) journal, (n) nvtop + mode "$mode_monitor" { + bindsym b exec $term_float btop, mode "default" + bindsym h exec $term_float htop, mode "default" + bindsym s exec $term_float isd, mode "default" + bindsym j exec $term_float lazyjournal, mode "default" + bindsym n exec $term_float nvtop, mode "default" + + bindsym Return mode "default" + bindsym Escape mode "default" + } + bindsym $mod+m mode "$mode_monitor" + +# +# Screenshots +# + # Snip a selection and pipe to swappy + bindsym print exec grim -g "$(slurp)" - | swappy -f - + # Screenshot a window and pipe to swappy + bindsym Ctrl+Print exec ~/.config/sway/scripts/screenshot_window.sh + # Screenshot the current display and pipe to swappy + bindsym Shift+Print exec ~/.config/sway/scripts/screenshot_display.sh + diff --git a/sway/config.d/10_input b/sway/config.d/10_input new file mode 100644 index 0000000..bcf2115 --- /dev/null +++ b/sway/config.d/10_input @@ -0,0 +1,19 @@ +input type:touchpad { + dwt enabled + tap disabled + natural_scroll enabled + accel_profile "adaptive" +} + +input type:keyboard { + xkb_layout "us" + xkb_variant "altgr-weur" + xkb_options "caps:escape" + repeat_delay 400 + repeat_rate 30 +} + +input type:mouse { + accel_profile "flat" + pointer_accel 0.5 +} diff --git a/sway/config.d/10_theme b/sway/config.d/10_theme new file mode 100644 index 0000000..4c205e4 --- /dev/null +++ b/sway/config.d/10_theme @@ -0,0 +1,38 @@ +# Apply gtk theming +exec_always ~/.config/sway/scripts/import-gsettings + +# Set inner/outer gaps +gaps inner 2 +gaps outer 0 + +# Hide titlebar on windows: +default_border pixel 1 + +# Default Font +font pango:Noto Sans Regular 10 + +# Thin borders: +smart_borders on + +# Set wallpaper: +exec ~/.azotebg + +# Title format for windows +for_window [shell="xdg_shell"] title_format "%title (%app_id)" +for_window [shell="x_wayland"] title_format "%class - %title" + +# class border bground text indicator child_border +client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4 +client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A +client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36 +client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555 +client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36 +client.background #F8F8F2 + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + swaybar_command waybar +} diff --git a/vdirsyncer/config.secret b/vdirsyncer/config.secret index 83fec2a099778f5258748b196c6e7dfa7c300c51..48270688c714435768f0efc2013943c65fb16164 100644 GIT binary patch literal 1295 zcmV+q1@QWX0gMA{hqi78NQ7wt3;?h`HWW1Z9qQ1#Nv_1IM6PS@wd@tfCrI64n1ju9 z9uKb^7jH2;D zUuMHyHX)9&DN`V7r9ot}$$XhNv1BEIbcV+e1GF}pTeg~QZwf!EvUk+9mP&#eTMuck zKVf8D3a#MJMiTI61%Y{V3ib-IVoSutt6C~lrfRwu_`@OFSF|@qwy5Qdub@#kAPa9B zRcl&G1K?~_bHJbLSJaNg5%9~-0JlRG!1ey?q(nH-1GUyhvX9k17dXJ`FO>%Fxnzm5 zdm(*lX1?9nN9*#2k9SFmJL4!~Nvg3Jr-B7D?DM?Yn1@0t6V+SQ)qbgBi}vTNGqX^Q44c1H|Pzj{g}f zz7hckK#R}}oQxvnniOu6BKNSatn8fU~Mpt~*r(D@9RO-%M22y|ISJaE2UmDUeY4+0T0T=ekeQEn-<`0b>@9P?e z?p}+uqUbYM9PAr<{f2u$A%+!@>rYwzslnV^U@?^x{*pp?a>-ab{ilT;;LO#6pB@Zs z!hY`h%OwGpxBq2UD2O0aBCQWQ+f2kXU(xxKOhO&ijB{4>dmwTL`81bg#EQho)9a*>$)dNz!|*=@q))GxQ=G$qV~f@_-S0vtk@ zPJcQR*1awlT~?_$4V>zDrW)YkPSncEBUpy+-m zog_n#r*4Ykq37UB*+i;X3slI$s{^~-_;E8@F8WBEw5K})eKy3jF4S3TN9I*@SylB` z#_5a2y^29UYm^!kH(D%q2oU^5MXRXWyo@Hw;_0f&4r?tSL_sk8po zJ^31Q?g&kFJQ$u2t>ZltDXdh?=oky`oO+g@Huo#Q2a_fDQK74e*T;m?^4s+zi4v5oJLGa>X!Y$R#|I#atq=B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