from cfgtools.files import DesktopEntry, XDGConfigFile, UserBin, normalize from cfgtools.hooks import after from cfgtools.system.arch import AUR from cfgtools.system.systemd import ensure_service, UserService from cfgtools.utils import hide_xdg_entry NAME = normalize(__name__) packages = {AUR("deadd-notification-center-bin")} files = [ XDGConfigFile(f"{NAME}/deadd.conf"), UserService(f"{NAME}/notifications.service"), UserBin(f"{NAME}/toggle-notifications.sh", "notifications-toggle"), DesktopEntry(f"{NAME}/notifications-toggle.desktop"), ] @after def start_notification_service() -> None: ensure_service("notifications", user=True) @after def cleanup_unwanted_avahi_entries() -> None: [hide_xdg_entry(e) for e in ["avahi-discover", "bvnc", "bssh"]]
from cfgtools.system.arch import Pacman from cfgtools.files import File, HOME, XDG_CONFIG_HOME, XDGConfigFile, normalize NAME = normalize(__name__) packages={ Pacman("xorg-xinit"), Pacman("xorg-server"), Pacman("xorg-xmodmap"), Pacman("xorg-xrdb"), } files=[ File(f"{NAME}/xorg.target", XDG_CONFIG_HOME / "systemd/user/xorg.target"), File(f"{NAME}/xinitrc", HOME / ".xinitrc"), XDGConfigFile(f"{NAME}/xinitrc.d/90-systemd"), XDGConfigFile(f"{NAME}/xinitrc.d/10-xmodmap"), XDGConfigFile(f"{NAME}/xinitrc.d/10-xresources"), XDGConfigFile(f"{NAME}/caps-ctrl-swap.xmodmap"), XDGConfigFile(f"{NAME}/Xresources"), ]
from cfgtools.files import EnvironmentFile, UserBin, XDGConfigFile, normalize from cfgtools.system.arch import Pacman from cfgtools.system.ubuntu import Apt NAME = normalize(__name__) CONFIG_FILES = ["vimrc", "ftplugin", "plugin", "plugins.vim"] packages = {Pacman("vim"), Apt("vim")} files = [ EnvironmentFile(NAME), UserBin(f"{NAME}/wrapper.sh", "vim"), ] + [XDGConfigFile(f"{NAME}/{f}") for f in CONFIG_FILES]
from cfgtools.files import XDGConfigFile from cfgtools.system.arch import AUR, Pacman packages = {Pacman("alacritty"), AUR("./aur/pkgs/ttf-hack-ext")} files = [ XDGConfigFile("alacritty/alacritty.yml"), ]
import subprocess from pathlib import Path from cfgtools.files import XDGConfigFile from cfgtools.hooks import after from cfgtools.system.arch import Pacman from cfgtools.system.systemd import ensure_service packages = {Pacman("xdg-user-dirs")} files = [XDGConfigFile("user_dirs/dirs", "user-dirs.dirs")] @after def ensure_user_dirs_exist() -> None: with open("user_dirs/dirs", "r") as dirs_file: for line in dirs_file: if line.startswith("#"): continue dirname = line.split("=")[1]\ .strip('"\n')\ .replace("$HOME", str(Path.home())) location = Path(dirname) if not location.exists(): location.mkdir(parents=True) # this *can't* run first otherwise it will remove the symlink and replace # with a bad default file ensure_service("xdg-user-dirs-update", user=True)
from cfgtools.files import UserBin, XDGConfigFile, normalize from cfgtools.system.arch import Pacman from cfgtools.system.ubuntu import Apt import homebin NAME = normalize(__name__) packages = { Pacman("openssh"), Pacman("git"), Pacman("man-db"), Apt("git"), Apt("openssh-client") } files = [ XDGConfigFile(f"{NAME}/config"), XDGConfigFile(f"{NAME}/ignore"), UserBin(f"{NAME}/wrapper.sh", "git"), ]
from cfgtools.files import XDGConfigFile from cfgtools.system.arch import Pacman packages = {Pacman("sxhkd")} files = [XDGConfigFile("sxhkd/sxhkdrc")]
from cfgtools.files import XDGConfigFile, normalize from cfgtools.system.arch import Pacman NAME = normalize(__name__) packages = {Pacman("papirus-icon-theme")} files = [ XDGConfigFile(f"{NAME}/settings.ini", "gtk-3.0/settings.ini"), ]
from cfgtools.files import XDGConfigFile from cfgtools.system.arch import AUR, Pacman packages = {Pacman("rofi"), AUR("./aur/pkgs/ttf-hack-ext")} files = [ XDGConfigFile("rofi/config.rasi"), XDGConfigFile("rofi/themes/icons_launcher.rasi"), ]
from cfgtools.files import XDGConfigFile, UserBin, normalize from cfgtools.system.arch import Pacman NAME = normalize(__name__) packages={Pacman("npm")} files=[ XDGConfigFile(f"{NAME}/npmrc", "npm/npmrc"), UserBin(f"{NAME}/wrapper.sh", "npm"), ]
from cfgtools.system.arch import AUR, Pacman from cfgtools.files import XDGConfigFile, normalize NAME = normalize(__name__) pkgs = {Pacman("wezterm"), AUR("./aur/pkgs/ttf-iosevka-ext")} files = [ XDGConfigFile(f"{NAME}/wezterm.lua", "wezterm/wezterm.lua"), ]
from cfgtools.system.arch import Pacman from cfgtools.system.python import VirtualEnv from cfgtools.system.systemd import ensure_service, UserService import dropbox ENABLED = True NAME = normalize(__name__) packages = {Pacman("calcurse")} virtualenv = VirtualEnv("gcal-sync", "gcsa") files = [ UserBin(f"{NAME}/gcal-sync.sh", "gcal-sync"), UserService(f"{NAME}/gcal-sync.service"), UserService(f"{NAME}/gcal-sync.timer"), XDGConfigFile(f"{NAME}/config", "calcurse/conf"), DesktopEntry(f"{NAME}/calcurse.desktop"), dropbox.EncryptedFile( "credentials/gcal-sync.json.gpg", XDG_CONFIG_HOME / "calcurse/credentials.json", ), ] @after def enable_sync_timer() -> None: global ENABLED if not ENABLED: return ensure_service("gcal-sync.timer", user=True)
from cfgtools.files import DesktopEntry, XDG_CONFIG_HOME, XDGConfigFile, UserBin, normalize from cfgtools.system.arch import AUR, Pacman import alacritty import tmux import dropbox NAME = normalize(__name__) packages = {Pacman("cmus"), AUR("ncspot")} files = [ XDGConfigFile(f"{NAME}/ncspot.toml", "ncspot/config.toml"), XDGConfigFile(f"{NAME}/cmus", "cmus/rc"), XDGConfigFile(f"{NAME}/cmus.theme", "cmus/local.theme"), UserBin(f"{NAME}/music-tmux.sh", "music-tmux"), UserBin(f"{NAME}/playerctl-wrapper.sh", "playerctl"), DesktopEntry(f"{NAME}/music-sidebar.desktop"), dropbox.EncryptedFile( "credentials/ncspot.toml.gpg", XDG_CONFIG_HOME / "ncspot/credentials.toml", ), ]
from cfgtools.system.arch import AUR, Pacman from cfgtools.system.python import VirtualEnv from cfgtools.system.systemd import ensure_service, UserService NAME = normalize(__name__) packages={ AUR("polybar"), AUR("./aur/pkgs/ttf-anonymous-pro-ext"), AUR("ttf-material-design-icons-git"), Pacman("python-gobject"), Pacman("noto-fonts"), Pacman("noto-fonts-emoji"), } systemhud_repo = GitRepository("[email protected]:jdost/systemhud.git") systemhud_venv = VirtualEnv("systemhud") files=[ UserService("polybar/statusbar.service"), XDGConfigFile(f"{NAME}/config"), XDGConfigFile(f"{NAME}/modules"), ] @after def enable_statusbar_service() -> None: ensure_service("statusbar", user=True) @after def setup_systemhud_repo() -> None: installed = False for installed_req in systemhud_venv.installed_requirements: if "jdost/systemhud.git" in installed_req: installed = True
from cfgtools.files import DesktopEntry, UserBin, XDGConfigFile, normalize from cfgtools.system.arch import Pacman import rofi NAME = normalize(__name__) packages = {Pacman("maim"), Pacman("which"), Pacman("xclip")} files = [ UserBin(f"{NAME}/screencap-menu.sh", "rofi-screencap"), XDGConfigFile(f"{NAME}/config.rasi", "rofi/themes/screencap.rasi"), DesktopEntry(f"{NAME}/screencap.desktop"), ]
import vim from cfgtools.system.arch import Pacman from cfgtools.system.ubuntu import Apt from cfgtools.files import XDGConfigFile packages = { Pacman("neovim"), Pacman("python-pynvim"), Apt("neovim"), Apt("python3-neovim"), } nvim_files = { XDGConfigFile("vim/neovim.vim", "nvim/init.vim"), }
from cfgtools.files import XDGConfigFile, normalize from cfgtools.system.arch import Pacman import dropbox NAME = normalize(__name__) packages = {Pacman("qutebrowser"), Pacman("pdfjs"), Pacman("python-adblock")} files = [ XDGConfigFile(f"{NAME}/config.py", "qutebrowser/config.py"), XDGConfigFile(dropbox.DROPBOX_DIR / "greasemonkey", "qutebrowser/greasemonkey"), XDGConfigFile( dropbox.DROPBOX_DIR / "configs/qutebrowser/quickmarks", "qutebrowser/quickmarks", ), ] + [ XDGConfigFile(f"{NAME}/{n}.py", f"qutebrowser/modules.d/{n}.py") for n in ["conditionals", "hints", "privacy", "theme"] ]
NAME = normalize(__name__) python_tools = [ "black", "flake8", "isort", "mypy", "mypy-ls", "neovim", "pynvim", "python-lsp-black", "python-lsp-server", ] packages = { Pacman("python"), Pacman("python-wheel"), Apt("python3"), Apt("python3-pip"), Apt("python3-venv"), VirtualEnv("python-code-tools", *python_tools), } files = [ XDGConfigFile(f"{NAME}/pip.conf", "pip/pip.conf"), EnvironmentFile(NAME), XDGConfigFile(f"{NAME}/python_startup.py", "python/startup.py"), XDGConfigFile(f"{NAME}/black.toml", "black"), XDGConfigFile(f"{NAME}/isort.cfg", "isort.cfg"), ]
from cfgtools.files import EnvironmentFile, XDGConfigFile, HOME, normalize from cfgtools.system.arch import Pacman from cfgtools.system import GitRepository import dropbox import rofi NAME = normalize(__name__) packages = { Pacman("pass"), Pacman("yubikey-manager"), Pacman("xclip"), Pacman("xdotool"), GitRepository( HOME / ".local/dropbox/pass.git", HOME / ".local/password_store", ), } files = [ XDGConfigFile(f"{NAME}/totp_rofi", "rofi/scripts/totp"), XDGConfigFile(f"{NAME}/pass_rofi", "rofi/scripts/pass"), XDGConfigFile(f"{NAME}/config.rasi", "rofi/themes/auth.rasi"), EnvironmentFile(NAME), ]
from cfgtools.files import HOME, UserBin, XDGConfigFile, normalize from cfgtools.hooks import after from cfgtools.system.arch import Pacman from cfgtools.system.systemd import ensure_service, UserService from cfgtools.utils import run NAME = normalize(__name__) packages = {Pacman("luakit")} files = [ UserBin(f"{NAME}/adblock-update.sh", "_adblock-update"), UserService(f"{NAME}/adblock-update.service"), UserService(f"{NAME}/adblock-update.timer"), XDGConfigFile(f"{NAME}/userconf.lua"), XDGConfigFile(f"{NAME}/theme.lua"), ] @after def periodic_adblock_updates() -> None: ensure_service("adblock-update.timer", user=True) if not (HOME / ".local/share/luakit/adblock/easylist.txt").exists(): run("_update-adblock")
packages = { Pacman("zsh"), Pacman("zsh-syntax-highlighting"), Pacman("zsh-completions"), AUR("./aur/pkgs/cli-utils"), Apt("zsh"), Apt("zsh-common"), Apt("zsh-syntax-highlighting"), NixPkgBin("exa"), NixPkgBin("ripgrep", "rg"), NixPkgBin("colordiff"), NixPkgBin("fzf"), } files = [ File(f"{NAME}/zshrc", HOME / ".zshrc"), XDGConfigFile(f"{NAME}/settings"), EnvironmentFile(NAME), ] @after def change_user_shell() -> None: zsh_bin = "/bin/zsh" if os.environ.get("SHELL") == zsh_bin: return if _SUDO_CHSH: subprocess.run(["sudo", "chsh", "-s", zsh_bin, getpass.getuser()]) else: subprocess.run(["chsh", "-s", zsh_bin])
from cfgtools.files import XinitRC, XDGConfigFile, normalize from cfgtools.system.arch import Pacman import alacritty import deadd import picom import polybar import rofi import sxhkd import xorg NAME = normalize(__name__) packages = {Pacman("bspwm"), Pacman("xorg-xsetroot")} files = [ XDGConfigFile(f"{NAME}/bspwmrc"), XDGConfigFile(f"{NAME}/polybar", "polybar/bspwm"), XinitRC(NAME, priority=99), ]
from cfgtools.files import (HOME, EnvironmentFile, UserBin, XDGConfigFile, normalize) from cfgtools.system.arch import Pacman from cfgtools.system.ubuntu import Apt NAME = normalize(__name__) packages = {Pacman("tmux"), Apt("tmux")} files = [ XDGConfigFile(f"{NAME}/tmux.conf", "tmux/tmux.conf"), EnvironmentFile(NAME), UserBin(f"{NAME}/wrapper.sh", "tmux") ]
from cfgtools.files import XDGConfigFile from cfgtools.system.arch import Pacman, AUR system_packages = { Pacman("zathura"), Pacman("zathura-pdf-mupdf"), AUR("./aur/pkgs/ttf-hack-ext"), } files = [ XDGConfigFile("zathura/zathurarc"), ]
from cfgtools.files import DesktopEntry, UserBin, XDGConfigFile, XDG_CONFIG_HOME, normalize from cfgtools.system.arch import Pacman import dropbox import mpv import web_xdg_open NAME = normalize(__name__) packages = {Pacman("streamlink"), Pacman("xclip")} files = [ XDGConfigFile(f"{NAME}/config", "streamlink/config"), DesktopEntry(f"{NAME}/streamlink.desktop"), UserBin(f"{NAME}/streamlink-clipboard.sh", "_streamlink-clipboard"), dropbox.EncryptedFile( "credentials/streamlink.crunchyroll.gpg", XDG_CONFIG_HOME / "streamlink/config.crunchyroll", ), web_xdg_open.SettingsFile(f"{NAME}/web-xdg-open", "streamlink"), ]
from cfgtools.files import XDGConfigFile, normalize from cfgtools.hooks import after from cfgtools.system.arch import AUR from cfgtools.system.systemd import ensure_service, UserService from cfgtools.utils import hide_xdg_entry import aur NAME = normalize(__name__) system_packages={AUR("picom-git")} files=[ XDGConfigFile(f"{NAME}/picom.conf"), UserService(f"{NAME}/compositor.service"), ] unwanted_entries=["compton", "picom"] @after def start_compositor_service() -> None: ensure_service("compositor", user=True) @after def hide_picom_desktop_entries() -> None: [hide_xdg_entry(e) for e in unwanted_entries]
from cfgtools.files import EnvironmentFile, XDGConfigFile from cfgtools.system.arch import AUR from cfgtools.system.nix import NixPkgBin packages = {AUR("./aur/pkgs/cli-utils"), NixPkgBin("bat")} files = [ XDGConfigFile(f"{__name__}/config"), EnvironmentFile(__name__), ]
from cfgtools.hooks import after from cfgtools.files import XDGConfigFile, normalize from cfgtools.system.arch import Pacman from cfgtools.utils import hide_xdg_entry import web_xdg_open NAME = normalize(__name__) packages = {Pacman("mpv"), Pacman("yt-dlp")} files = [ XDGConfigFile(f"{NAME}/mpv.conf"), web_xdg_open.SettingsFile(f"{NAME}/web-xdg-open", "mpv"), ] @after def hide_unwanted_mpv_entries() -> None: [hide_xdg_entry(e) for e in ["lstopo", "qvidcap", "qv4l2"]]