From f733dbf75f5c0886c99fdc29ce3610537501efb9 Mon Sep 17 00:00:00 2001 From: Ben Grande <ben.grande.b@gmail.com> Date: Mon, 30 Oct 2023 09:31:16 +0000 Subject: [PATCH] test --- .gitignore | 7 + .pre-commit-config.yaml | 23 +- .pre-commit-hooks.yaml | 12 + .reuse/dep5 | 12 +- .salt-lint | 4 + CONTRIBUTING.md | 75 ++ LICENSES/CC-BY-SA-3.0.txt | 99 +++ LICENSES/CC-BY-SA-4.0.txt | 170 ++++ LICENSES/MIT.txt | 9 + README.md | 98 +-- copyright.txt | 3 - minion.d/qusal.conf | 4 + qusal/ansible/create.sls | 121 +-- qusal/ansible/install.sls | 29 +- qusal/browser/create.sls | 67 +- qusal/debian-minimal/create.sls | 82 +- qusal/debian/create.sls | 82 +- qusal/dev/create.sls | 148 ++-- qusal/dev/install-salt-tools.sls | 32 +- qusal/dev/install.sls | 31 +- qusal/docker/install.sls | 37 +- .../kde-activity-changed-notifier | 4 +- qusal/dom0/files/bin/kde-write-rules | 53 -- qusal/dom0/files/bin/qubes-kde-win-rules | 72 ++ qusal/dom0/kde.sls | 9 + qusal/dotfiles/README.md | 74 -- qusal/dotfiles/copy-all.sls | 52 -- qusal/dotfiles/copy-git.sls | 65 -- qusal/dotfiles/copy-gtk.sls | 23 - qusal/dotfiles/copy-net.sls | 27 - qusal/dotfiles/copy-pgp.sls | 23 - qusal/dotfiles/copy-pgp.top | 9 - qusal/dotfiles/copy-sh.sls | 43 - qusal/dotfiles/copy-sh.top | 9 - qusal/dotfiles/copy-ssh.sls | 24 - qusal/dotfiles/copy-ssh.top | 9 - qusal/dotfiles/copy-tmux.sls | 37 - qusal/dotfiles/copy-tmux.top | 9 - qusal/dotfiles/copy-vim.sls | 23 - qusal/dotfiles/copy-vim.top | 9 - qusal/dotfiles/copy-x11.sls | 27 - qusal/dotfiles/copy-x11.top | 9 - .../The Qubes Project/qubes-qube-manager.conf | 37 - qusal/dotfiles/files/git/.config/git/config | 154 ---- .../git/.config/git/config.d/qubes-devel | 10 - qusal/dotfiles/files/git/.config/git/ignore | 35 - qusal/dotfiles/files/git/.config/git/message | 3 - .../.config/git/sample/gitconfig.local.sample | 12 - .../git/.config/git/shell/.git-shell-lib | 28 - .../files/git/.config/git/shell/description | 26 - .../dotfiles/files/git/.config/git/shell/help | 9 - .../dotfiles/files/git/.config/git/shell/init | 35 - .../dotfiles/files/git/.config/git/shell/list | 17 - .../.config/git/shell/no-interactive-login | 23 - .../files/git/.config/git/template/config | 17 - .../.config/git/template/hooks/pre-receive | 51 -- .../git/.config/git/template/info/exclude | 5 - qusal/dotfiles/files/git/.config/tig/config | 75 -- .../files/gtk/.config/gtk-2.0/bookmarks | 5 - .../files/gtk/.config/gtk-2.0/gtkrc-2.0 | 19 - .../gtk-2.0/qubes-incoming-bookmark-created | 3 - .../files/gtk/.config/gtk-3.0/bookmarks | 5 - .../gtk-3.0/qubes-incoming-bookmark-created | 3 - .../files/gtk/.config/gtk-3.0/settings.ini | 20 - .../files/gtk/.config/gtk-4.0/bookmarks | 5 - .../files/gtk/.config/gtk-4.0/settings.ini | 20 - qusal/dotfiles/files/net/.config/curl/.curlrc | 1 - qusal/dotfiles/files/net/.config/curl/curlrc | 5 - .../files/net/.config/urlview/urlview | 5 - qusal/dotfiles/files/net/.config/wget/wgetrc | 5 - qusal/dotfiles/files/net/.urlview | 1 - qusal/dotfiles/files/net/.w3m/keymap | 256 ------ qusal/dotfiles/files/pgp/.gnupg/gpg.conf | 23 - qusal/dotfiles/files/qvm-copy-dotfiles | 38 - qusal/dotfiles/files/setup.sh | 45 -- qusal/dotfiles/files/sh/.bash_env | 1 - qusal/dotfiles/files/sh/.bash_logout | 1 - qusal/dotfiles/files/sh/.bash_profile | 1 - qusal/dotfiles/files/sh/.bashrc | 1 - qusal/dotfiles/files/sh/.config/bash/bash_env | 15 - .../files/sh/.config/bash/bash_logout | 9 - .../files/sh/.config/bash/bash_profile | 10 - qusal/dotfiles/files/sh/.config/bash/bashrc | 106 --- qusal/dotfiles/files/sh/.config/bash/inputrc | 136 ---- .../files/sh/.config/dircolors/dircolors | 174 ----- .../dotfiles/files/sh/.config/less/lessfilter | 20 - qusal/dotfiles/files/sh/.config/less/lesskey | 21 - .../files/sh/.config/less/lesskey-old | Bin 62 -> 0 bytes qusal/dotfiles/files/sh/.config/sh/profile | 133 ---- qusal/dotfiles/files/sh/.config/sh/shrc | 284 ------- .../dotfiles/files/sh/.config/user-dirs.dirs | 19 - .../files/sh/.config/user-dirs.locale | 5 - qusal/dotfiles/files/sh/.config/zsh/.zlogout | 1 - qusal/dotfiles/files/sh/.config/zsh/.zprofile | 1 - qusal/dotfiles/files/sh/.config/zsh/.zshenv | 1 - qusal/dotfiles/files/sh/.config/zsh/.zshrc | 1 - qusal/dotfiles/files/sh/.config/zsh/zlogout | 9 - qusal/dotfiles/files/sh/.config/zsh/zprofile | 12 - qusal/dotfiles/files/sh/.config/zsh/zshenv | 12 - qusal/dotfiles/files/sh/.config/zsh/zshrc | 462 ----------- qusal/dotfiles/files/sh/.profile | 1 - qusal/dotfiles/files/sh/.zprofile | 1 - qusal/dotfiles/files/ssh/.ssh/config | 24 - .../files/ssh/.ssh/config.d/.gitignore | 0 .../files/ssh/.ssh/known_hosts.d/.gitignore | 0 .../files/tmux/.config/tmux/tmux.conf | 142 ---- .../.config/vim/after/autoload/pathogen.vim | 355 --------- .../vim/.config/vim/after/colors/tango2.vim | 64 -- .../vim/.config/vim/after/colors/torte.vim | 52 -- .../.config/vim/after/colors/vividchalk.vim | 193 ----- .../vim/.config/vim/after/ftdetect/.gitignore | 0 .../.config/vim/after/ftplugin/markdown.vim | 36 - .../vim/.config/vim/after/indent/.gitignore | 0 .../vim/.config/vim/after/macros/less.vim | 4 - .../vim/.config/vim/after/plugin/cool.vim | 130 --- .../.config/vim/after/plugin/lastplace.vim | 51 -- .../.config/vim/after/plugin/update-time.vim | 82 -- .../vim/.config/vim/after/syntax/.gitignore | 0 .../vim/bundle/vim-jinja/ftdetect/jinja.vim | 22 - .../vim/bundle/vim-jinja/ftplugin/jinja.vim | 22 - .../vim/bundle/vim-jinja/syntax/jinja.vim | 126 --- .../vim/bundle/vim-salt/ftdetect/salt.vim | 16 - .../vim/bundle/vim-salt/ftplugin/salt.vim | 29 - .../vim/bundle/vim-salt/indent/salt.vim | 158 ---- .../vim/bundle/vim-salt/syntax/salt.vim | 55 -- .../.config/vim/bundle/vim-salt/test/file.sls | 28 - qusal/dotfiles/files/vim/.config/vim/vimrc | 737 ------------------ qusal/dotfiles/files/x11/.Xresources | 1 - qusal/dotfiles/files/x11/.config/x11/xinitrc | 9 - qusal/dotfiles/files/x11/.config/x11/xprofile | 73 -- .../dotfiles/files/x11/.config/x11/xresources | 316 -------- qusal/dotfiles/files/x11/.config/x11/xsession | 9 - .../dotfiles/files/x11/.config/x11/xsessionrc | 9 - qusal/dotfiles/files/x11/.xsession | 1 - qusal/dotfiles/files/x11/.xsessionrc | 1 - qusal/fedora-minimal/create.sls | 82 +- qusal/fedora/create.sls | 82 +- qusal/media/create.sls | 140 ++-- qusal/mgmt/create.sls | 46 +- qusal/mutt/README.md | 3 + qusal/mutt/configure.sls | 11 +- qusal/mutt/create.sls | 58 +- qusal/mutt/files/mutt/conf.d/bindings.muttrc | 86 -- qusal/mutt/files/mutt/conf.d/colors.muttrc | 116 --- qusal/mutt/files/mutt/conf.d/lists.muttrc | 11 - qusal/mutt/files/mutt/conf.d/mailbox.muttrc | 51 -- qusal/mutt/files/mutt/conf.d/pgp.muttrc | 41 - qusal/mutt/files/mutt/conf.d/server.muttrc | 36 - qusal/mutt/files/mutt/muttrc | 16 - qusal/mutt/install.sls | 11 +- qusal/qubes-builder/create.sls | 92 ++- .../files/rpc/qubesbuilder.FileCopyIn | 6 +- qusal/reader/create.sls | 72 +- qusal/remmina/create.sls | 108 +-- qusal/signal/create.sls | 65 +- qusal/ssh/create.sls | 88 ++- qusal/ssh/install.sls | 2 - qusal/sys-cacher/create.sls | 48 +- qusal/sys-firewall/create.sls | 150 ++-- qusal/sys-git/README.md | 5 +- qusal/sys-git/create.sls | 47 +- .../files/client/git-core/git-init-qrexec | 47 +- .../files/client/git-core/git-remote-qrexec | 4 +- .../client/git-core/git-remote-qrexec-connect | 51 +- qusal/sys-git/install-client.sls | 7 +- qusal/sys-git/install.sls | 2 + qusal/sys-net/create.sls | 182 ++--- qusal/sys-net/prefs-disp.sls | 4 +- qusal/sys-net/prefs.sls | 4 +- qusal/sys-pgp/create.sls | 42 +- qusal/sys-pgp/install.sls | 21 +- qusal/sys-pihole/README.md | 36 +- qusal/sys-pihole/configure-dvm.sls | 15 + qusal/sys-pihole/configure-dvm.top | 9 + qusal/sys-pihole/create.sls | 105 ++- qusal/sys-pihole/files/policy/default.policy | 9 + qusal/sys-pihole/install.sls | 1 - qusal/sys-ssh-agent/README.md | 17 +- qusal/sys-ssh-agent/configure.sls | 13 +- qusal/sys-ssh-agent/create.sls | 46 +- qusal/sys-ssh-agent/files/rpc/qusal.SshAgent | 16 + .../files/{agent => server}/bin/qvm-ssh-agent | 4 +- .../systemd/qubes-ssh-agent-sock@.service | 0 qusal/sys-ssh-agent/install-client.sls | 25 +- qusal/sys-ssh-agent/install.sls | 36 +- .../map.jinja} | 0 qusal/sys-sshfs/README.md | 68 ++ qusal/sys-sshfs/clone.sls | 8 + qusal/sys-sshfs/clone.top | 10 + qusal/sys-sshfs/configure-client.sls | 57 ++ .../configure-client.top} | 2 +- qusal/sys-sshfs/configure.sls | 29 + .../copy-git.top => sys-sshfs/configure.top} | 4 +- qusal/sys-sshfs/create.sls | 46 ++ qusal/sys-sshfs/create.top | 10 + qusal/sys-sshfs/files/client/50_sshfs.conf | 8 + .../files/client/qubes-ssh-forwarder.socket | 15 + .../files/client/qubes-ssh-forwarder@.service | 11 + qusal/sys-sshfs/files/policy/default.policy | 9 + qusal/sys-sshfs/files/rpc/qusal.Sshfs | 7 + qusal/sys-sshfs/install-client.sls | 38 + .../install-client.top} | 2 +- qusal/sys-sshfs/install.sls | 44 ++ .../copy-gtk.top => sys-sshfs/install.top} | 4 +- qusal/sys-syncthing/README.md | 3 - qusal/sys-syncthing/create.sls | 88 ++- qusal/sys-syncthing/init.top | 2 + qusal/sys-syncthing/install.sls | 21 +- qusal/sys-usb/create.sls | 138 ++-- qusal/terraform/create.sls | 40 +- qusal/terraform/install.sls | 6 +- qusal/utils/macros/install-repo.sls | 4 + qusal/utils/macros/sync-appmenus.sls | 2 +- qusal/utils/tools/builder/core.sls | 33 +- qusal/utils/tools/builder/doc.sls | 5 - qusal/vault/create.sls | 58 +- qusal/vault/install.sls | 22 +- scripts/shell-lint.sh | 1 + scripts/spec-get.sh | 5 +- scripts/update-toc.sh | 18 + 220 files changed, 2520 insertions(+), 7400 deletions(-) create mode 100644 .pre-commit-hooks.yaml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSES/CC-BY-SA-3.0.txt create mode 100644 LICENSES/CC-BY-SA-4.0.txt create mode 100644 LICENSES/MIT.txt delete mode 100644 copyright.txt delete mode 100755 qusal/dom0/files/bin/kde-write-rules create mode 100755 qusal/dom0/files/bin/qubes-kde-win-rules delete mode 100644 qusal/dotfiles/README.md delete mode 100644 qusal/dotfiles/copy-all.sls delete mode 100644 qusal/dotfiles/copy-git.sls delete mode 100644 qusal/dotfiles/copy-gtk.sls delete mode 100644 qusal/dotfiles/copy-net.sls delete mode 100644 qusal/dotfiles/copy-pgp.sls delete mode 100644 qusal/dotfiles/copy-pgp.top delete mode 100644 qusal/dotfiles/copy-sh.sls delete mode 100644 qusal/dotfiles/copy-sh.top delete mode 100644 qusal/dotfiles/copy-ssh.sls delete mode 100644 qusal/dotfiles/copy-ssh.top delete mode 100644 qusal/dotfiles/copy-tmux.sls delete mode 100644 qusal/dotfiles/copy-tmux.top delete mode 100644 qusal/dotfiles/copy-vim.sls delete mode 100644 qusal/dotfiles/copy-vim.top delete mode 100644 qusal/dotfiles/copy-x11.sls delete mode 100644 qusal/dotfiles/copy-x11.top delete mode 100644 qusal/dotfiles/files/dom0/The Qubes Project/qubes-qube-manager.conf delete mode 100644 qusal/dotfiles/files/git/.config/git/config delete mode 100644 qusal/dotfiles/files/git/.config/git/config.d/qubes-devel delete mode 100644 qusal/dotfiles/files/git/.config/git/ignore delete mode 100644 qusal/dotfiles/files/git/.config/git/message delete mode 100644 qusal/dotfiles/files/git/.config/git/sample/gitconfig.local.sample delete mode 100644 qusal/dotfiles/files/git/.config/git/shell/.git-shell-lib delete mode 100755 qusal/dotfiles/files/git/.config/git/shell/description delete mode 100755 qusal/dotfiles/files/git/.config/git/shell/help delete mode 100755 qusal/dotfiles/files/git/.config/git/shell/init delete mode 100755 qusal/dotfiles/files/git/.config/git/shell/list delete mode 100755 qusal/dotfiles/files/git/.config/git/shell/no-interactive-login delete mode 100644 qusal/dotfiles/files/git/.config/git/template/config delete mode 100755 qusal/dotfiles/files/git/.config/git/template/hooks/pre-receive delete mode 100644 qusal/dotfiles/files/git/.config/git/template/info/exclude delete mode 100644 qusal/dotfiles/files/git/.config/tig/config delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-2.0/bookmarks delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-2.0/gtkrc-2.0 delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-2.0/qubes-incoming-bookmark-created delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-3.0/bookmarks delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-3.0/qubes-incoming-bookmark-created delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-3.0/settings.ini delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-4.0/bookmarks delete mode 100644 qusal/dotfiles/files/gtk/.config/gtk-4.0/settings.ini delete mode 120000 qusal/dotfiles/files/net/.config/curl/.curlrc delete mode 100644 qusal/dotfiles/files/net/.config/curl/curlrc delete mode 100644 qusal/dotfiles/files/net/.config/urlview/urlview delete mode 100644 qusal/dotfiles/files/net/.config/wget/wgetrc delete mode 120000 qusal/dotfiles/files/net/.urlview delete mode 100644 qusal/dotfiles/files/net/.w3m/keymap delete mode 100644 qusal/dotfiles/files/pgp/.gnupg/gpg.conf delete mode 100755 qusal/dotfiles/files/qvm-copy-dotfiles delete mode 100755 qusal/dotfiles/files/setup.sh delete mode 120000 qusal/dotfiles/files/sh/.bash_env delete mode 120000 qusal/dotfiles/files/sh/.bash_logout delete mode 120000 qusal/dotfiles/files/sh/.bash_profile delete mode 120000 qusal/dotfiles/files/sh/.bashrc delete mode 100644 qusal/dotfiles/files/sh/.config/bash/bash_env delete mode 100644 qusal/dotfiles/files/sh/.config/bash/bash_logout delete mode 100644 qusal/dotfiles/files/sh/.config/bash/bash_profile delete mode 100644 qusal/dotfiles/files/sh/.config/bash/bashrc delete mode 100644 qusal/dotfiles/files/sh/.config/bash/inputrc delete mode 100644 qusal/dotfiles/files/sh/.config/dircolors/dircolors delete mode 100755 qusal/dotfiles/files/sh/.config/less/lessfilter delete mode 100644 qusal/dotfiles/files/sh/.config/less/lesskey delete mode 100644 qusal/dotfiles/files/sh/.config/less/lesskey-old delete mode 100644 qusal/dotfiles/files/sh/.config/sh/profile delete mode 100644 qusal/dotfiles/files/sh/.config/sh/shrc delete mode 100644 qusal/dotfiles/files/sh/.config/user-dirs.dirs delete mode 100644 qusal/dotfiles/files/sh/.config/user-dirs.locale delete mode 120000 qusal/dotfiles/files/sh/.config/zsh/.zlogout delete mode 120000 qusal/dotfiles/files/sh/.config/zsh/.zprofile delete mode 120000 qusal/dotfiles/files/sh/.config/zsh/.zshenv delete mode 120000 qusal/dotfiles/files/sh/.config/zsh/.zshrc delete mode 100644 qusal/dotfiles/files/sh/.config/zsh/zlogout delete mode 100644 qusal/dotfiles/files/sh/.config/zsh/zprofile delete mode 100644 qusal/dotfiles/files/sh/.config/zsh/zshenv delete mode 100644 qusal/dotfiles/files/sh/.config/zsh/zshrc delete mode 120000 qusal/dotfiles/files/sh/.profile delete mode 120000 qusal/dotfiles/files/sh/.zprofile delete mode 100644 qusal/dotfiles/files/ssh/.ssh/config delete mode 100644 qusal/dotfiles/files/ssh/.ssh/config.d/.gitignore delete mode 100644 qusal/dotfiles/files/ssh/.ssh/known_hosts.d/.gitignore delete mode 100644 qusal/dotfiles/files/tmux/.config/tmux/tmux.conf delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/autoload/pathogen.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/colors/tango2.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/colors/torte.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/colors/vividchalk.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/ftdetect/.gitignore delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/ftplugin/markdown.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/indent/.gitignore delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/macros/less.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/plugin/cool.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/plugin/lastplace.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/plugin/update-time.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/after/syntax/.gitignore delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftdetect/jinja.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftplugin/jinja.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/syntax/jinja.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftdetect/salt.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftplugin/salt.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/indent/salt.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/syntax/salt.vim delete mode 100644 qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/test/file.sls delete mode 100644 qusal/dotfiles/files/vim/.config/vim/vimrc delete mode 120000 qusal/dotfiles/files/x11/.Xresources delete mode 100755 qusal/dotfiles/files/x11/.config/x11/xinitrc delete mode 100755 qusal/dotfiles/files/x11/.config/x11/xprofile delete mode 100644 qusal/dotfiles/files/x11/.config/x11/xresources delete mode 100755 qusal/dotfiles/files/x11/.config/x11/xsession delete mode 100755 qusal/dotfiles/files/x11/.config/x11/xsessionrc delete mode 120000 qusal/dotfiles/files/x11/.xsession delete mode 120000 qusal/dotfiles/files/x11/.xsessionrc delete mode 100644 qusal/mutt/files/mutt/conf.d/bindings.muttrc delete mode 100644 qusal/mutt/files/mutt/conf.d/colors.muttrc delete mode 100644 qusal/mutt/files/mutt/conf.d/lists.muttrc delete mode 100644 qusal/mutt/files/mutt/conf.d/mailbox.muttrc delete mode 100644 qusal/mutt/files/mutt/conf.d/pgp.muttrc delete mode 100644 qusal/mutt/files/mutt/conf.d/server.muttrc delete mode 100644 qusal/mutt/files/mutt/muttrc create mode 100644 qusal/sys-pihole/configure-dvm.sls create mode 100644 qusal/sys-pihole/configure-dvm.top create mode 100644 qusal/sys-pihole/files/policy/default.policy rename qusal/sys-ssh-agent/files/{agent => server}/bin/qvm-ssh-agent (94%) rename qusal/sys-ssh-agent/files/{agent => server}/systemd/qubes-ssh-agent-sock@.service (100%) rename qusal/{dotfiles/files/gtk/.config/gtk-4.0/qubes-incoming-bookmark-created => sys-ssh-agent/map.jinja} (100%) create mode 100644 qusal/sys-sshfs/README.md create mode 100644 qusal/sys-sshfs/clone.sls create mode 100644 qusal/sys-sshfs/clone.top create mode 100644 qusal/sys-sshfs/configure-client.sls rename qusal/{dotfiles/copy-all.top => sys-sshfs/configure-client.top} (77%) create mode 100644 qusal/sys-sshfs/configure.sls rename qusal/{dotfiles/copy-git.top => sys-sshfs/configure.top} (71%) create mode 100644 qusal/sys-sshfs/create.sls create mode 100644 qusal/sys-sshfs/create.top create mode 100644 qusal/sys-sshfs/files/client/50_sshfs.conf create mode 100644 qusal/sys-sshfs/files/client/qubes-ssh-forwarder.socket create mode 100644 qusal/sys-sshfs/files/client/qubes-ssh-forwarder@.service create mode 100644 qusal/sys-sshfs/files/policy/default.policy create mode 100755 qusal/sys-sshfs/files/rpc/qusal.Sshfs create mode 100644 qusal/sys-sshfs/install-client.sls rename qusal/{dotfiles/copy-net.top => sys-sshfs/install-client.top} (78%) create mode 100644 qusal/sys-sshfs/install.sls rename qusal/{dotfiles/copy-gtk.top => sys-sshfs/install.top} (71%) diff --git a/.gitignore b/.gitignore index 3a67ed7..91c10b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: CC0-1.0 + qusal/qubesos-github-io qusal/sys-audio qusal/sys-wireguard +qusal/sys-syncthing +qusal/sys-rsync +qusal/sys-ssh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89e3da9..8a4ddfc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,18 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + --- repos: -- repo: local - hooks: - - id: salt-lint - name: salt-lint - entry: scripts/salt-lint.sh - language: script - pass_filenames: false + - repo: local + hooks: + - id: salt-lint + name: salt-lint + entry: scripts/salt-lint.sh + language: script + pass_filenames: false + - id: shellcheck + name: shellcheck + entry: scripts/shell-lint.sh + language: script + pass_filenames: false diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..ab4dd47 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2020 Liferay, Inc. <https://liferay.com> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +--- +- id: reuse + name: reuse + entry: reuse + args: ["lint"] + language: python + pass_filenames: false + description: "Lint the project for compliance with the REUSE Specification" diff --git a/.reuse/dep5 b/.reuse/dep5 index 4d62fa0..0e67b67 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,20 +3,12 @@ Upstream-Name: qusal Upstream-Contact: Benjamin Grande Miranda de Sousa <ben.grande.b@gmail.com> Source: https://github.com/ben-grande/qusal -Files: * -Copyright: 2023 Qusal contributors -License: GPL-3.0-or-later - -Files: .gitignore .pre-commit-config.yaml .salt-lint README.md minion.d/qusal.conf -Copyright: 2023 Qusal contributors -License: GPL-3.0-or-later - Files: */README.md Copyright: 2023 Qusal contributors -License: GPL-3.0-or-later +License: CC-BY-SA-4.0 Files: qusal/ansible/files/repo/* -Copyright: 2014 Launchpad PPA for Ansible, Inc. <https://ansible.com> +Copyright: 2014 Ansible, Inc. <https://ansible.com> License: CC0-1.0 Files: qusal/browser/files/repo/* diff --git a/.salt-lint b/.salt-lint index b1fdea3..a340f27 100644 --- a/.salt-lint +++ b/.salt-lint @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + --- skip_list: - 205 # use '.sls' as a Salt State file extension diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e64a88d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,75 @@ +<!-- +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: CC-BY-SA-4.0 +--> + +# Contributing to Qusal + +## Table of Contents + +* [Format](#format) + * [File naming](#file-naming) + * [Readme](#readme) + * [Qube naming](#qube-naming) + * [Qrexec](#qrexec) + +## Format + +### File naming + +1. Every State file `.sls` must have a Top file `.top`. This ensures that + every state can be applied with top. +2. Every project must have a `init.top`, it facilitates applying every state + by enabling a single top file. +3. State file naming should be common between the projects, it helps + understand the project as if it was any other. +5. Files names and state IDs should use `-` as separator, not `_`. + +### Readme + +1. Every project should have a README.md with at least the following sections: + Table of Contents, Description, Installation, Access Control (if changed + Qrexec policy), Usage. + +### Qube naming + +1. Qube name format: + + - TemplateVM: `tpl-NAME` + - StandaloneVM: `NAME` + - AppVM: `NAME` + - DispVM: `disp-NAME` + - DispVM Template (AppVM): `dvm-NAME` + - Service qubes (not a class): `sys-NAME` + +2. Label/Color: + + - *Black* (Ultimately trusted): You must trust Dom0, Templates, Vaults, + Management qubes, these qubes control your system and hold valuable + information. Examples: dom0, tpl-ssh, vault, default-mgmt-dvm. + - *Gray* (Fully trusted): Trusted storage with extra RPC services that allow + certain operations to be made by the client and executed on the server or + may build components for other qubes. Examples: sys-cacher, sys-git, + sys-pgp, sys-ssh-agent, qubes-builder. + - *Purple* (Much trust): Has the ability to manager remote servers via + encrypted connections and depend on authorization provided by another qube. + Examples: ansible, dev, ssh, terraform. + - *Blue* (Very trusted): TODO + - *Green* (Trusted): TODO + - *Yellow* (Relatively trusted): TODO + - *Orange* (Slightly trusted): Controls the network flow of data to the + client, normally a firewall. Examples: sys-firewall, sys-vpn, sys-pihole. + - *Red* (Untrusted): Holds untrusted data (PCI devices, untrusted programs, + disposables for opening untrusted files or web pages). Examples: sys-net, + sys-usb, dvm-browser. + +### Qrexec + +1. Don't use `*` for source and destination, use `@anyvm` instead +2. Target qube for policies must be `@default`. It allows for the real target + to be set by Dom0 via the `target=` redirection parameter, instead of + having to modify the client to target a different server via + `qrexec-client-vm`. +3. Target qube for client script must default to `@default`, but other targets + must be allowed via parameters. diff --git a/LICENSES/CC-BY-SA-3.0.txt b/LICENSES/CC-BY-SA-3.0.txt new file mode 100644 index 0000000..39a8591 --- /dev/null +++ b/LICENSES/CC-BY-SA-3.0.txt @@ -0,0 +1,99 @@ +Creative Commons Attribution-ShareAlike 3.0 Unported + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. + + b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License. + + c. "Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License. + + d. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. + + e. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. + + f. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. + + g. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. + + h. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. + + i. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + + j. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. + + k. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; + + b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; + + c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and, + + d. to Distribute and Publicly Perform Adaptations. + + e. For the avoidance of doubt: + + i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; + + ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, + + iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested. + + b. You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License. + + c. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. + + d. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + + b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + a. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + + b. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + + c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + + d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + + e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + + f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. + +Creative Commons Notice + +Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License. + +Creative Commons may be contacted at http://creativecommons.org/. diff --git a/LICENSES/CC-BY-SA-4.0.txt b/LICENSES/CC-BY-SA-4.0.txt new file mode 100644 index 0000000..835a683 --- /dev/null +++ b/LICENSES/CC-BY-SA-4.0.txt @@ -0,0 +1,170 @@ +Creative Commons Attribution-ShareAlike 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. + +Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution-ShareAlike 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. + + C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. + + 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..2071b23 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 496c2a7..473a898 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,29 @@ +<!-- +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: CC-BY-SA-4.0 +--> + # qusal ## Table of Contents * [Description](#description) * [Installation](#installation) + * [Requirements](#requirements) * [DomU](#domu) * [Dom0](#dom0) * [Usage](#usage) -* [Format](#format) - * [File naming](#file-naming) - * [Readme](#readme) - * [Qube naming](#qube-naming) - * [Qrexec](#qrexec) * [Legal](#legal) - * [Copyright](#copyright) - * [License](#license) ## Description Qusal - Salt Formulas for Qubes OS. Qusal providers a Free and Open Source solution to customizing various tasks -in Qubes OS, from switching PCI handlers to be disposables or app qubes to -installing different pieces of software on dedicated minimal templates. +in Qubes OS, from switching PCI handlers to be disposables or app qubes, +installing different pieces of software on dedicated minimal templates for +split agent operations for separating the key store from the client. Each project is in a separate directory, but they may interact with other projects. @@ -66,7 +67,7 @@ qvm-run -p dev tar -cC /home/user qusal | tar -xvC ~/QubesIncoming/dev qusal Copy the files to the Salt directories: ```sh cd qusal -./setup.sh +./scripts/setup.sh ``` The RPM Spec is not ready, don't try it unless for development. @@ -79,72 +80,33 @@ information on how to install the desired package. Qubes global settings (qubes-prefs) that will be managed: - **clockvm**: disp-sys-net, sys-net -- **default_audiovm**: dom0 # TODO - **default_dispvm**: reader -- **default_guivm**: dom0 # TODO - **default_netvm**: sys-pihole, sys-firewall or disp-sys-firewall - **management_dispvm**: dvm-mgmt - **updatevm**: sys-pihole, sys-firewall or disp-sys-firewall -## Format +To be implemented: +- **default_audiovm**: sys-audio +- **default_guivm**: sys-gui -### File naming +## Legal -1. Every State file `.sls` must have a Top file `.top`. This ensures that - every state can be applied with top. -2. Every project must have a `init.top`, it facilitates applying every state - by enabling a single top file. -3. State file naming should be common between the projects, it helps - understand the project as if it was any other. -5. Files names and state IDs should use `-` as separator, not `_`. +This project is [REUSE-compliant](https://reuse.software). It is difficult to +list all licenses and copyrights and keep them up-to-date here. -### Readme +The easiest way to get the copyright and license of the project with the reuse +tool: +```sh +reuse spdx +``` -1. Every project should have a README.md with at least the following sections: - Table of Contents, Description, Installation, Access Control (if changed - Qrexec policy), Usage. +You can also check these information manually by checking in the file header, +a companion `.license` or in `.reuse/dep5`. -### Qube naming +Here is a brief summary as of October 2023: -1. Qube name format: - - - TemplateVM: `tpl-NAME` - - StandaloneVM: `NAME` - - AppVM: `NAME` - - DispVM: `disp-NAME` - - DispVM Template (AppVM): `dvm-NAME` - - Service qubes (not a class): `sys-NAME` - -2. Label: - - - Black (Ultimately trusted): You must trust Dom0, Templates, Vaults, - Management qubes, these qubes control your system and hold valuable - information. Examples: dom0, tpl-ssh, vault, default-mgmt-dvm. - - Gray (Fully trusted): Trusted storage with extra RPC services that allow - certain operations to be made by the client and executed on the server. - Examples: sys-cacher, sys-git, sys-pgp, sys-ssh-agent. - - Purple, Blue, Green, Yellow (Relatively trusted per domain): Can be set - per user discretion, normally separated per domain (work, clients, - personal). - - Orange (Slightly trusted) Controls the flow of data to the client, - normally a firewall. Examples: sys-firewall, sys-vpn, sys-pihole. - - Red (Untrusted): Holds untrusted data (PCI devices, untrusted programs, - disposables for opening untrusted files or web pages). Examples: sys-net, - sys-usb, disp-sys-usb, disp-browser. - -### Qrexec - -1. Don't use `*` for source and destination, use `@anyvm` instead -2. Target qube for policies must be `@default`. It allows for the real target - to be set by Dom0 via the `target=` redirection parameter, instead of - having to modify the client to target a different server via - `qrexec-client-vm`. -3. Target qube for client script must default to `@default`, but other targets - must be allowed via parameters. - -## License - -All original source code is licensed under GPL-3.0-or-later. - -For more accurate information, check the individual files for license and -copyright ownership. +- All original source code is licensed under GPL-3.0-or-later. +- All documentation is licensed under CC-BY-SA-4.0. +- Some configuration and data files are licensed under CC0-1.0. +- Some borrowed code (`qusal/dotfiles/`) is licenses under BSD-2-Clause, + CC-BY-SA-4.0, GPL-2.0-only, GPL-3.0-only, MIT, Vim. diff --git a/copyright.txt b/copyright.txt deleted file mode 100644 index e16858a..0000000 --- a/copyright.txt +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later diff --git a/minion.d/qusal.conf b/minion.d/qusal.conf index 393d5fd..0485936 100644 --- a/minion.d/qusal.conf +++ b/minion.d/qusal.conf @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: CC0-1.0 + --- file_roots: base: diff --git a/qusal/ansible/create.sls b/qusal/ansible/create.sls index fed725f..9f9b49f 100644 --- a/qusal/ansible/create.sls +++ b/qusal/ansible/create.sls @@ -7,66 +7,71 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: tpl-{{ slsdotpath }} - - prefs: - - memory: 300 - - maxmem: 400 - - features: - - set: - - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop" - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +prefs: +- memory: 300 +- maxmem: 400 +features: +- set: + - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop" + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - netvm: "" - - vpus: 1 - - memory: 400 - - maxmem: 500 - - autostart: False - - include_in_backups: True - - features: - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" - - disable: - - service.cups - - service.cups-browsed +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- netvm: "" +- vpus: 1 +- memory: 400 +- maxmem: 500 +- autostart: False +- include_in_backups: True +features: +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}-minion": - qvm.vm: - - name: {{ slsdotpath }}-minion - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - netvm: "" - - vpus: 1 - - memory: 400 - - maxmem: 500 - - autostart: False - - include_in_backups: True - - features: - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }}-minion +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- netvm: "" +- vpus: 1 +- memory: 400 +- maxmem: 500 +- autostart: False +- include_in_backups: True +features: +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} {% from 'utils/macros/policy.sls' import policy_set with context -%} {{ policy_set(sls_path, '80') }} diff --git a/qusal/ansible/install.sls b/qusal/ansible/install.sls index 7ec6da0..ec27c6f 100644 --- a/qusal/ansible/install.sls +++ b/qusal/ansible/install.sls @@ -8,6 +8,7 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - utils.tools.zsh + - ssh.install "{{ slsdotpath }}-updated": pkg.uptodate: @@ -20,18 +21,6 @@ include: - skip_suggestions: True - pkgs: - ansible - {% if grains['os_family']|lower == 'debian' -%} - - openssh-client - - vim-nox - - python3-selinux - {% elif grains['os_family']|lower == 'redhat' -%} - - openssh-clients - - vim-enhanced - - vim-ansible - {% else -%} - - openssh-client - - vim - {% endif -%} - python3-argcomplete - python3-jmespath - openssh-server @@ -39,6 +28,22 @@ include: - bash-completion - man-db +{% set pkg = { + 'Debian': { + 'pkg': ['vim-nox', 'python3-selinux'], + }, + 'RedHat': { + 'pkg': ['vim-enhanced', 'vim-ansible'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} + "{{ slsdotpath }}-ssh-config": file.managed: - name: /etc/ssh/ssh_config.d/99-ssh-ansible.conf diff --git a/qusal/browser/create.sls b/qusal/browser/create.sls index 548af2a..03bb51b 100644 --- a/qusal/browser/create.sls +++ b/qusal/browser/create.sls @@ -7,35 +7,40 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: tpl-{{ slsdotpath }} - - prefs: - - memory: 300 - - maxmem: 2000 - - features: - - set: - - default-menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" - - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +prefs: +- memory: 300 +- maxmem: 2000 +features: +- set: + - default-menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" + - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - require: - - qvm: tpl-{{ slsdotpath }} - - name: dvm-{{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - memory: 300 - - maxmem: 2000 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- qvm: tpl-{{ slsdotpath }} +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- label: red +- memory: 300 +- maxmem: 2000 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/debian-minimal/create.sls b/qusal/debian-minimal/create.sls index f889d49..555ec8b 100644 --- a/qusal/debian-minimal/create.sls +++ b/qusal/debian-minimal/create.sls @@ -9,24 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ template.template_clean }}": - qvm.vm: - - name: {{ template.template_clean }} - - require: - - sls: {{ template.template_clean }}.clone - - present: - - label: black - - prefs: - - label: black - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - include_in_backups: False - - features: - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - "dvm-{{ template.template }}-absent": qvm.absent: - names: @@ -34,27 +16,49 @@ include: - {{ template.template_clean }}-dvm - {{ template.template }}-dvm -"dvm-{{ template.template_clean }}": - qvm.vm: - - name: dvm-{{ template.template_clean }} - - require: - - sls: {{ template.template_clean }}.clone - - present: - - template: {{ template.template }} - - label: red - - prefs: - - template: {{ template.template }} - - label: red - - memory: 300 - - maxmem: 400 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- template: {{ template.template }} +- label: red +prefs: +- template: {{ template.template }} +- label: red +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-set-default_template": cmd.run: diff --git a/qusal/debian/create.sls b/qusal/debian/create.sls index 0b7f3a4..41ba109 100644 --- a/qusal/debian/create.sls +++ b/qusal/debian/create.sls @@ -9,24 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ template.template_clean }}": - qvm.vm: - - name: {{ template.template_clean }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - label: black - - prefs: - - label: black - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - include_in_backups: False - - features: - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - "dvm-{{ template.template }}-absent": qvm.absent: - names: @@ -34,24 +16,46 @@ include: - {{ template.template_clean }}-dvm - {{ template.template }}-dvm -"dvm-{{ template.template_clean }}": - qvm.vm: - - name: dvm-{{ template.template_clean }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: {{ template.template }} - - label: red - - prefs: - - template: {{ template.template }} - - label: red - - memory: 300 - - maxmem: 800 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: {{ template.template }} +- label: red +prefs: +- template: {{ template.template }} +- label: red +- memory: 300 +- maxmem: 800 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template_clean }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/dev/create.sls b/qusal/dev/create.sls index 4ec5635..3d91734 100644 --- a/qusal/dev/create.sls +++ b/qusal/dev/create.sls @@ -7,75 +7,83 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - netvm: "" - - vpus: 1 - - memory: 400 - - maxmem: 600 - - autostart: False - - include_in_backups: True - - features: - - enable: - - service.split-gpg2-client - - service.crond - - disable: - - service.cups - - service.cups-browsed +{%- from "qvm/template.jinja" import load -%} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - netvm: "" - - vpus: 1 - - memory: 400 - - maxmem: 600 - - autostart: False - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- netvm: "" +- vpus: 1 +- memory: 400 +- maxmem: 600 +- autostart: False +- include_in_backups: True +features: +- enable: + - service.split-gpg2-client + - service.crond +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} -"disp-{{ slsdotpath }}": - qvm.vm: - - name: disp-{{ slsdotpath }} - - require: - - qvm: dvm-{{ slsdotpath }} - - present: - - template: dvm-{{ slsdotpath }} - - label: red - - class: DispVM - - prefs: - - template: dvm-{{ slsdotpath }} - - label: red - - vpus: 1 - - memory: 400 - - maxmem: 600 - - autostart: False - - include_in_backups: False - - features: - - disable: - - appmenus-dispvm - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- netvm: "" +- vpus: 1 +- memory: 400 +- maxmem: 600 +- autostart: False +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: disp-{{ slsdotpath }} +force: True +require: +- qvm: dvm-{{ slsdotpath }} +present: +- template: dvm-{{ slsdotpath }} +- label: red +- class: DispVM +prefs: +- template: dvm-{{ slsdotpath }} +- label: red +- vpus: 1 +- memory: 400 +- maxmem: 600 +- autostart: False +- include_in_backups: False +features: +- disable: + - appmenus-dispvm + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/dev/install-salt-tools.sls b/qusal/dev/install-salt-tools.sls index 457b452..5e5a56d 100644 --- a/qusal/dev/install-salt-tools.sls +++ b/qusal/dev/install-salt-tools.sls @@ -19,14 +19,30 @@ SPDX-License-Identifier: GPL-3.0-or-later - python3-pip - yamllint - ansible-lint - {% if grains['os_family']|lower == 'redhat' -%} - - salt-lint - {% endif -%} -# {% if grains['os_family']|lower != 'redhat' -%} -# pip-installed-salt-tools: -# cmd.run: -# - name: python3 -m pip install salt-lint -# {% endif -%} +{% set pkg = { + 'Debian': { + 'pkg': [], + }, + 'RedHat': { + 'pkg': ['salt-lint'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-salt-tools-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} + +# Fails because of cacher +{# +{% if grains['os_family']|lower != 'redhat' -%} +pip-installed-salt-tools: + cmd.run: + - name: python3 -m pip install --break-system-packages salt-lint +{% endif -%} +#} {% endif %} diff --git a/qusal/dev/install.sls b/qusal/dev/install.sls index c8a431b..18836fd 100644 --- a/qusal/dev/install.sls +++ b/qusal/dev/install.sls @@ -38,23 +38,26 @@ include: - texinfo - file - tree + - reuse - pre-commit - gitlint - ripgrep - fzf - {% if grains['os_family']|lower == 'debian' -%} - - shellcheck - - vim-nox - - fd-find - {% elif grains['os_family']|lower == 'redhat' -%} - - passwd - - fd-find - - ShellCheck - - vim-enhanced - {% else -%} - - fd - - shellcheck - - vim - {% endif -%} + +{% set pkg = { + 'Debian': { + 'pkg': ['shellcheck', 'vim-nox', 'fd-find'], + }, + 'RedHat': { + 'pkg': ['passwd', 'fd-find', 'ShellCheck', 'vim-enhanced'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} {% endif -%} diff --git a/qusal/docker/install.sls b/qusal/docker/install.sls index e4fca2f..d92bd4a 100644 --- a/qusal/docker/install.sls +++ b/qusal/docker/install.sls @@ -13,29 +13,24 @@ SPDX-License-Identifier: GPL-3.0-or-later pkg.uptodate: - refresh: True +{% set pkg = { + 'Debian': { + 'pkg_removed': ['docker.io', 'docker-doc', 'docker-compose', + 'podman-docker', 'containerd', 'runc'], + }, + 'RedHat': { + 'pkg_removed': ['docker', 'docker-client', 'docker-client-latest', + 'docker-common', 'docker-latest', + 'docker-latest-logrotate', 'docker-logrotate', + 'docker-selinux', 'docker-engine-selinux', + 'docker-engine'], + }, +}.get(grains.os_family) -%} + {# -"{{ slsdotpath }}-removed": +"{{ slsdotpath }}-removed-os-specific": pkg.removed: - - pkgs: - {% if grains['os_family']|lower == 'debian' -%} - - docker.io - - docker-doc - - docker-compose - - podman-docker - - containerd - - runc - {% elif grains['os_family']|lower == 'redhat' -%} - - docker - - docker-client - - docker-client-latest - - docker-common - - docker-latest - - docker-latest-logrotate - - docker-logrotate - - docker-selinux - - docker-engine-selinux - - docker-engine - {% endif -%} + - pkgs: {{ pkg.pkg_removed|sequence|yaml }} #} "{{ slsdotpath }}-installed": diff --git a/qusal/dom0/files/autostart-scripts/kde-activity-changed-notifier b/qusal/dom0/files/autostart-scripts/kde-activity-changed-notifier index 9c91d81..76c0469 100755 --- a/qusal/dom0/files/autostart-scripts/kde-activity-changed-notifier +++ b/qusal/dom0/files/autostart-scripts/kde-activity-changed-notifier @@ -1,9 +1,12 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2018 Oded Arbel <https://geek.co.li> # SPDX-FileCopyrightText: 2023 Qusal contributors # # SPDX-License-Identifier: GPL-3.0-or-later +## Credits: https://geek.co.il/2018/07/30/script-day-different-default-browser-per-kde-activity + set -eu if ! command -v notify-send >/dev/null && @@ -17,7 +20,6 @@ case "${XDG_SESSION_DESKTOP:-}" in *) exit 1;; esac -## https://geek.co.il/2018/07/30/script-day-different-default-browser-per-kde-activity service="org.kde.ActivityManager" interface="$service.Activities" path="/ActivityManager/Activities" diff --git a/qusal/dom0/files/bin/kde-write-rules b/qusal/dom0/files/bin/kde-write-rules deleted file mode 100755 index 5e2960f..0000000 --- a/qusal/dom0/files/bin/kde-write-rules +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC2317 -## Wrapper around kwriteconfig to write key=values to specific groups. -## TODO: finish -set -eu -echo "Unfinished work" >&2 -exit 2 - -# shellcheck disable=SC1091 -test -r "$HOME/.profile" && . "$HOME/.profile" -: "${XDG_CONFIG_HOME:=$HOME/.config}" -file="$XDG_CONFIG_HOME/kwinrulesrc" - -writeconf(){ - group="$1" - key="$2" - value="$3" - - kwriteconfig \ - --file "$file" \ - --group "rules-$group" \ - --key "$key" "$value" -} - -writeconf_group(){ - chosen_group="$1" - chosen_activity="$2" - writeconf "$chosen_group" Description "$chosen_group" - if test -n "$chosen_activity"; then - chosen_activity_id="$(kactivities-cli --list-activities | - cut -d " " -f 2,3 | grep -F " $chosen_activity" | cut -d " " -f 1)" - if test -z "$chosen_activity_id"; then - printf '%s\n' "Invalid activity name: $chosen_activity" - exit 1 - fi - writeconf "$chosen_group" activity "$chosen_activity_id" - writeconf "$chosen_group" activityrule 2 - fi - writeconf "$chosen_group" title "^\\[$chosen_group\\] .*" - writeconf "$chosen_group" titlematch 3 - writeconf "$chosen_group" wmclass "$chosen_group" - writeconf "$chosen_group" wmclasscomplete false - writeconf "$chosen_group" wmclassmatch 2 -} - -#writeconf_group dev -#writeconf_group disp -#writeconf disp title "^\\[disp[0-9]{4}\\] .*" diff --git a/qusal/dom0/files/bin/qubes-kde-win-rules b/qusal/dom0/files/bin/qubes-kde-win-rules new file mode 100755 index 0000000..68d0ff1 --- /dev/null +++ b/qusal/dom0/files/bin/qubes-kde-win-rules @@ -0,0 +1,72 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +## Write KWin rules for window of specific domain to be in specific activity. +# shellcheck disable=SC1090,SC2317 +set -eu + +file="${XDG_CONFIG_HOME:=$HOME/.config}/kwinrulesrc" + +usage(){ + echo "Usage: ${0##*/} <group> <activity> +Example: ${0##*/} personal personal +Example: ${0##*/} fun personal +Example: ${0##*/} work work +If domain is work, dvm-work, disp-work and work-something will all be present +in the work activity" >&2 + exit 1 +} + +writeconf(){ + group="$1" + key="$2" + value="$3" + + group_id="$(grep -B1 -- "^Description=$group$" "$file" | head -1 | tr -d "[" | tr -d "]")" + if test -z "${group_id}"; then + highest_id="$(grep -- "\[[0-9]\+\]" "$file" | tr -d "[" | tr -d "]" | sort | tail -1)" + if test -n "${highest_id}"; then + group_id="$((highest_id+1))" + else + group_id="0" + fi + fi + + kwriteconfig --file "$file" --group "$group_id" --key "$key" "$value" +} + +writeconf_group(){ + chosen_group="$1" + chosen_activity="$2" + writeconf "$chosen_group" Description "$chosen_group" + if test -n "$chosen_activity"; then + chosen_activity_id="$(kactivities-cli --list-activities | + awk -v activity="$chosen_activity" '$3 ~ activity {print $2}')" + if test -z "$chosen_activity_id"; then + printf '%s\n' "Invalid activity name: $chosen_activity" + exit 1 + fi + writeconf "$chosen_group" activity "$chosen_activity_id" + writeconf "$chosen_group" activityrule 2 + fi + + ## Regex: https://doc.qt.io/qt-6/qregularexpression.html + writeconf "$chosen_group" title "^\\[(disp-|dvm-)?$chosen_group(-\\S+)?\\] .*" + writeconf "$chosen_group" titlematch 3 + writeconf "$chosen_group" wmclass "$chosen_group" + writeconf "$chosen_group" wmclasscomplete false + writeconf "$chosen_group" wmclassmatch 2 +} + +case "${1-}" in + ""|-h|--?help) usage +esac +case "${2-}" in + "") usage +esac + +writeconf_group "${1}" "${2}" +dbus-send --type=signal /KWin org.kde.KWin.reloadConfig diff --git a/qusal/dom0/kde.sls b/qusal/dom0/kde.sls index 7edbf1f..29c0e8d 100644 --- a/qusal/dom0/kde.sls +++ b/qusal/dom0/kde.sls @@ -54,4 +54,13 @@ SPDX-License-Identifier: GPL-3.0-or-later - mode: '0755' - makedirs: True +"{{ slsdotpath }}-qubes-kde-win-rules": + file.managed: + - name: /home/user/.local/bin/qubes-kde-win-rules + - source: salt://{{ slsdotpath }}/files/bin/qubes-kde-win-rules + - user: user + - group: user + - mode: '0755' + - makedirs: True + {% endif -%} diff --git a/qusal/dotfiles/README.md b/qusal/dotfiles/README.md deleted file mode 100644 index eecf082..0000000 --- a/qusal/dotfiles/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# dotfiles - -## Table of Contents - -* [Description](#description) -* [Installation](#installation) -* [Usage](#usage) - -## Description - -Ben Grande's Dotfiles. - -Configuration and scripts targeting: - -- Usability: - - Vi keybindings for application movement - - Emacs keybindings for command-line editing - - XDG Specification to not clutter $HOME -- Portability: - - POSIX compliant code - - Drop-in configuration files - - Tested on Qubes OS Dom0, Debian, Fedora -- Tasks: - - GUI: x11, gtk - - SCM: git, tig, git-shell - - Keys: gpg, ssh - - Networking: curl, urlview, wget, w3m - - Productivity: tmux, vim - - Shell: sh, bash, zsh, less, dircolors - -## Installation - -You can simply deploy all configurations with: -```sh -./files/setup.sh -``` -Or target specific ones by specifying the directory name: -```sh -./files/setup.sh sh bash -``` -Note that some files might depend on other directories, specially `sh` which -is a base for `bash` and `zsh` but might also have environment variables for -`net` and `vim`. It also adds `$HOME/.local/bin` and -`$HOME/.local/bin/$HOSTNAME` to the `$PATH` variable, so if the project has -scripts, install the `sh` directory. - -Reload your shell: -```sh -exec $SHELL -``` - -Reload you X server: -```sh -. ~/.config/x11/xprofile -``` - -You need to logout and login again for some changes to take effect. - -## Usage - -The deployment replaces existing files and that is the goal, to make sure that -we have the same configuration of every machine. Support for local -configuration is implemented by including a local file per application. - -Supported programs and the expected file names in `$HOME`: - -- **bash**: .bashrc.local -- **git**: .gitconfig.local -- **sh**: .profile.local, .shrc.local -- **ssh**: .ssh/config.d/*.conf, .ssh/known_hosts.d/*.host -- **tmux**: .tmux.conf.local -- **vim**: .vimrc.local -- **x11**: .xprofile.local -- **zsh**: .zshrc.local diff --git a/qusal/dotfiles/copy-all.sls b/qusal/dotfiles/copy-all.sls deleted file mode 100644 index 2a95f98..0000000 --- a/qusal/dotfiles/copy-all.sls +++ /dev/null @@ -1,52 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -include: - - .copy-git - - .copy-gtk - - .copy-net - - .copy-pgp - - .copy-sh - - .copy-ssh - - .copy-tmux - - .copy-vim - - .copy-x11 - -{# -Unfortunately salt.states.file does not keep permissions when using salt-ssh. -Best option is 'file.managed mode: keep' or 'file.recurse file_mode: keep'. -https://docs.saltproject.io/en/latest/ref/states/all/salt.states.file.html -#} -{# -"{{ slsdotpath }}-absent-dotfiles-client": - file.absent: - - name: /tmp/dotfiles - -"{{ slsdotpath }}-copy-dotfiles-client": - file.recurse: - - source: salt://{{ slsdotpath }}/files - - name: /tmp/dotfiles - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-apply-dotfiles-client": - cmd.run: - - name: sh /tmp/dotfiles/setup.sh - - runas: user - -"{{ slsdotpath }}-fix-executables-permission": - file.directory: - - name: /home/user/.local/bin - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-absent-end-dotfiles-client": - file.absent: - - name: /tmp/dotfiles -#} diff --git a/qusal/dotfiles/copy-git.sls b/qusal/dotfiles/copy-git.sls deleted file mode 100644 index 398c660..0000000 --- a/qusal/dotfiles/copy-git.sls +++ /dev/null @@ -1,65 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-git-home": - file.recurse: - - name: /home/user - - source: salt://{{ slsdotpath }}/files/git - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-fix-executables-git-template-dir-home": - file.directory: - - name: /home/user/.config/git/template/hooks - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-fix-executables-git-shell-dir-home": - file.directory: - - name: /home/user/.config/git/shell - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-fix-executables-git-bin-dir-home": - file.directory: - - name: /home/user/.local/bin - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-copy-git-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/git - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root - -"{{ slsdotpath }}-fix-executables-git-template-dir-skel": - file.directory: - - name: /etc/skel/.config/git/template/hooks - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-fix-executables-git-shell-dir-skel": - file.directory: - - name: /home/user/.config/git/shell - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-fix-executables-git-bin-dir-skel": - file.directory: - - name: /home/user/.local/bin - - mode: '0755' - - recurse: - - mode diff --git a/qusal/dotfiles/copy-gtk.sls b/qusal/dotfiles/copy-gtk.sls deleted file mode 100644 index 7bd49a0..0000000 --- a/qusal/dotfiles/copy-gtk.sls +++ /dev/null @@ -1,23 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-gtk-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/gtk/ - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-copy-gtk-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/gtk/ - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root diff --git a/qusal/dotfiles/copy-net.sls b/qusal/dotfiles/copy-net.sls deleted file mode 100644 index d806809..0000000 --- a/qusal/dotfiles/copy-net.sls +++ /dev/null @@ -1,27 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-net-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/net/ - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - - keep_symlinks: True - - force_symlinks: True - -"{{ slsdotpath }}-copy-net-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/net/ - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root - - keep_symlinks: True - - force_symlinks: True diff --git a/qusal/dotfiles/copy-pgp.sls b/qusal/dotfiles/copy-pgp.sls deleted file mode 100644 index e870404..0000000 --- a/qusal/dotfiles/copy-pgp.sls +++ /dev/null @@ -1,23 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-pgp-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/pgp/ - - file_mode: '0600' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-copy-pgp-skel": - file.recurse: - - name: /etc/skel/ - - source: salt://{{ slsdotpath }}/files/pgp/ - - file_mode: '0600' - - dir_mode: '0700' - - user: root - - group: root diff --git a/qusal/dotfiles/copy-pgp.top b/qusal/dotfiles/copy-pgp.top deleted file mode 100644 index d5226b8..0000000 --- a/qusal/dotfiles/copy-pgp.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-pgp diff --git a/qusal/dotfiles/copy-sh.sls b/qusal/dotfiles/copy-sh.sls deleted file mode 100644 index e3cbc27..0000000 --- a/qusal/dotfiles/copy-sh.sls +++ /dev/null @@ -1,43 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-sh-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/sh - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - - keep_symlinks: True - - force_symlinks: True - -"{{ slsdotpath }}-fix-executables-sh-dir-home": - file.directory: - - name: /home/user/.local/bin - - file_mode: '0755' - - dir_mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-copy-sh-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/sh - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root - - keep_symlinks: True - - force_symlinks: True - -"{{ slsdotpath }}-fix-executables-sh-dir-skel": - file.directory: - - name: /etc/skel/.local/bin - - file_mode: '0755' - - dir_mode: '0755' - - recurse: - - mode diff --git a/qusal/dotfiles/copy-sh.top b/qusal/dotfiles/copy-sh.top deleted file mode 100644 index 7c1a8f6..0000000 --- a/qusal/dotfiles/copy-sh.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-sh diff --git a/qusal/dotfiles/copy-ssh.sls b/qusal/dotfiles/copy-ssh.sls deleted file mode 100644 index 1a0acb1..0000000 --- a/qusal/dotfiles/copy-ssh.sls +++ /dev/null @@ -1,24 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-ssh-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/ssh/ - - file_mode: '0600' - - dir_mode: '0700' - - user: user - - group: user - - backup: minion - -"{{ slsdotpath }}-copy-ssh-skel": - file.recurse: - - name: /etc/skel/ - - source: salt://{{ slsdotpath }}/files/ssh/ - - file_mode: '0600' - - dir_mode: '0700' - - user: root - - group: root diff --git a/qusal/dotfiles/copy-ssh.top b/qusal/dotfiles/copy-ssh.top deleted file mode 100644 index c7679aa..0000000 --- a/qusal/dotfiles/copy-ssh.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-ssh diff --git a/qusal/dotfiles/copy-tmux.sls b/qusal/dotfiles/copy-tmux.sls deleted file mode 100644 index 1f9deae..0000000 --- a/qusal/dotfiles/copy-tmux.sls +++ /dev/null @@ -1,37 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-tmux-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/tmux/ - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-fix-executables-tmux-home": - file.directory: - - name: /home/user/.local/bin - - mode: '0755' - - recurse: - - mode - -"{{ slsdotpath }}-copy-tmux-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/tmux/ - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root - -"{{ slsdotpath }}-fix-executables-tmux-skel": - file.directory: - - name: /home/user/.local/bin - - mode: '0755' - - recurse: - - mode diff --git a/qusal/dotfiles/copy-tmux.top b/qusal/dotfiles/copy-tmux.top deleted file mode 100644 index d577c25..0000000 --- a/qusal/dotfiles/copy-tmux.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-tmux diff --git a/qusal/dotfiles/copy-vim.sls b/qusal/dotfiles/copy-vim.sls deleted file mode 100644 index c3fd379..0000000 --- a/qusal/dotfiles/copy-vim.sls +++ /dev/null @@ -1,23 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-vim-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/vim/ - - file_mode: '0644' - - dir_mode: '0700' - - user: user - - group: user - -"{{ slsdotpath }}-copy-vim-skel": - file.recurse: - - name: /etc/skel - - source: salt://{{ slsdotpath }}/files/vim/ - - file_mode: '0644' - - dir_mode: '0700' - - user: root - - group: root diff --git a/qusal/dotfiles/copy-vim.top b/qusal/dotfiles/copy-vim.top deleted file mode 100644 index e61271b..0000000 --- a/qusal/dotfiles/copy-vim.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-vim diff --git a/qusal/dotfiles/copy-x11.sls b/qusal/dotfiles/copy-x11.sls deleted file mode 100644 index 041f18b..0000000 --- a/qusal/dotfiles/copy-x11.sls +++ /dev/null @@ -1,27 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -"{{ slsdotpath }}-copy-x11-home": - file.recurse: - - name: /home/user/ - - source: salt://{{ slsdotpath }}/files/x11 - - file_mode: '0755' - - dir_mode: '0755' - - user: user - - group: user - - keep_symlinks: True - - force_symlinks: True - -"{{ slsdotpath }}-copy-x11-skel": - file.recurse: - - name: /etc/skel/ - - source: salt://{{ slsdotpath }}/files/x11 - - file_mode: '0755' - - dir_mode: '0755' - - user: root - - group: root - - keep_symlinks: True - - force_symlinks: True diff --git a/qusal/dotfiles/copy-x11.top b/qusal/dotfiles/copy-x11.top deleted file mode 100644 index bf06c4b..0000000 --- a/qusal/dotfiles/copy-x11.top +++ /dev/null @@ -1,9 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: GPL-3.0-or-later -#} - -base: - '*': - - dotfiles.copy-x11 diff --git a/qusal/dotfiles/files/dom0/The Qubes Project/qubes-qube-manager.conf b/qusal/dotfiles/files/dom0/The Qubes Project/qubes-qube-manager.conf deleted file mode 100644 index 9b159da..0000000 --- a/qusal/dotfiles/files/dom0/The Qubes Project/qubes-qube-manager.conf +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[General] -window_size=@Size(824 500) - -[columns] -Backup=true -Default%20DispVM=true -Disk%20Usage=true -IP=true -Internal=false -Is%20DVM%20Template=false -Label=true -Last%20backup=true -Name=true -NetVM=true -State=true -Template=true -Type=false -Virt%20Mode=false - -[show] -all=true -halted=true -network=true -running=true -standalone=true -templates=true - -[view] -compactview=true -sort_column=3 -sort_order=0 - -# vim: ft=toml diff --git a/qusal/dotfiles/files/git/.config/git/config b/qusal/dotfiles/files/git/.config/git/config deleted file mode 100644 index 32e016a..0000000 --- a/qusal/dotfiles/files/git/.config/git/config +++ /dev/null @@ -1,154 +0,0 @@ -; Global Git Config - -; SPDX-FileCopyrightText: 2010 - 2017 Tim Pope <https://tpo.pe> -; SPDX-FileCopyrightText: 2016 The Qubes OS Project <https://www.qubes-os.org> -; SPDX-FileCopyrightText: 2023 Qusal contributors -; -; SPDX-License-Identifier: GPL-2.0-only -; - -[alias] - ; https://git.wiki.kernel.org/index.php/Aliases - ; https://github.com/schacon/gitscm/tree/master - ; Abbreviations - co = checkout - br = branch - sw = switch - ci = commit - cm = commit - st = status - df = diff - dc = diff --cached - gi = init - gib = init --bare - cu = rev-parse --abbrev-ref --symbolic-full-name @{upstream} - lg = !sh -c 'git log --color \"$@\"|fmt -s -w 79|less -FRSX' _ - lgg = log --graph --pretty='format:%C(yellow)%h%C(reset) %C(magenta)%G?%C(reset) -%C(red)%d%C(reset) %C(reset)%s %C(green)(%cs)%C(reset) %C(blue)%aN%C(reset)' - r = remote - rl = remote -v - cf = config --file "$HOME/.gitconfig.local" - ; Helpers - aliases = "!sh -c 'if test -n \"$1\"; then git config --get alias.$1; else git config --get-regexp \"alias.*\" | colrm 1 6 | sed \"s/[ ]/ = /\"; fi'" - - ; Patch with subject prefix containing repository name and output - ; directory has the child directories the repository and branch name. - fp = "!sh -c '\ - git rev-parse --show-toplevel 2>&1 >/dev/null || return; \ - repo=\"$(basename $(git rev-parse --show-toplevel) | \ - sed s/^qubes-//)\"; \ - outdir=\"$(git config format.outputDirectory)\"; \ - ref=\"$(git symbolic-ref --short HEAD)\"; \ - git format-patch \ - --output-directory \"${outdir%*/}/${repo}/${ref}\" \ - --subject-prefix=\"PATCH ${repo}\" \"${@}\" \ - --diff-algorithm=histogram \ - '" - - last = log -1 HEAD - unstage = reset HEAD -- - undo = reset --soft HEAD^ - changes = diff --name-status -r - diffstat = diff --stat -r - who = shortlog -s -- - ; whois <author name/e-mail> - whois = log -i -1 --pretty='format:%an <%ae>' --author - ; whatis <commit name> - whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short - ; See what commits have been created by the last command, eg: git pull - new = !sh -c 'git log $1@{1}..$1@{0} "$@"' - ; List commits with the same the abbreviated hash. - abbr = "!sh -c 'git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:\"%H %ci %an %s%n\" $commit; done' -" - ; Solve merge conflicts - edit-unmerged = "!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; vim $(f)" - add-unmerged = "!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; git add $(f)" - ; List tips of branches that are not in the first arg. - ; git tips origin/master ^origin/alternate | git oneline - oneline ="!_() { $(test $# -eq 0 && echo xargs -L1) git log --no-walk --decorate --oneline \"$@\"; }; _" - tips = "!_() { t=$(git rev-list --no-merges --max-count=1 \"$@\"); if test -n \"$t\"; then echo $t; _ \"$@\" ^$t; fi; }; _" - ; Submodules. - sub-update-recurse = !sh -c 'git checkout $1 && git submodule update --recursive' - ; Signed tags and commits - stag = "!sh -c '\ - commit_id=\"$(git rev-parse --verify HEAD)\"; \ - tag_name=\"signed_tag_for_$(echo $commit_id | head -c 8)\"; \ - git tag -s \"$tag_name\" -m \"Tag for commit $commit_id\"; \ - echo \"$tag_name\"'" - ptag = !git push $(git config branch.$(git branch --show-current).remote) $(git describe) - vtag = !git verify-tag -v $(git describe) - vhead = !git verify-commit -v $(git rev-parse HEAD) -[blame] - coloring = repeatedLines -[branch] - autoSetupMerge = always -[color] - ui = auto - diff = auto - status = auto - branch = auto - interactive = auto - grep = auto -[commit] - gpgSign = true - verbose = true - template = ~/.config/git/message -[core] - excludesFile = ~/.config/git/ignore - pager = git-pager -[delta] - navigate = true - light = false -[diff] - algorithm = histogram - colorMoved = default -[diff "image"] - textConv = identify -[format] - coverLetter = auto - coverFromDescription = auto - thread = shallow - signOff = true - signatureFile = ~/.signature - outputDirectory = /tmp/patch -[gpg] - program = gpgw - minTrustLevel = fully -[grep] - extendedRegexp = true - lineNumber = true -[init] - defaultbranch = main - templatedir = ~/.config/git/template -[interactive] - diffFilter = delta --color-only -[mailinfo] - scissors = true -[merge] - verifySignatures = true - tool = vimdiff - conflictStyle = diff3 - summary = true -[pull] - ; Rebase does not verify signatures. Does not prevent manual rebase. - rebase = false -[push] - autoSetupRemote = true - default = nothing - followTags = true -[rebase] - autoSquash = true -[sendemail] - annotate = true - multiEdit = true - confirm = always - thread = shallow - chainReplyTo = true - xmailer = false -[tag] - forceSignAnnotated = true - gpgSign = true -[user] - hideTimezone = true -[includeIf "gitdir:~/**/qubes-*/**"] - path = ~/.config/git/config.d/qubes-devel -[include] - path = ~/.gitconfig.local - -; vim: ft=gitconfig diff --git a/qusal/dotfiles/files/git/.config/git/config.d/qubes-devel b/qusal/dotfiles/files/git/.config/git/config.d/qubes-devel deleted file mode 100644 index feecb96..0000000 --- a/qusal/dotfiles/files/git/.config/git/config.d/qubes-devel +++ /dev/null @@ -1,10 +0,0 @@ -; SPDX-FileCopyrightText: 2023 Qusal contributors -; -; SPDX-License-Identifier: GPL-3.0-or-later - -[format] - to = qubes-devel@googlegroups.com -[sendemail] - to = qubes-devel@googlegroups.com - -; vim: ft=gitconfig diff --git a/qusal/dotfiles/files/git/.config/git/ignore b/qusal/dotfiles/files/git/.config/git/ignore deleted file mode 100644 index 19fe1b9..0000000 --- a/qusal/dotfiles/files/git/.config/git/ignore +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Local -*.local -!.local/ -!rc.local - -# Code -*.patch -*.diff - -# Editor -.*.sw? -.*.tmp -*~ -.#* -[#]*# -Session.vim -/tags -/doc/tags - -## Debian build artifacts -**/debhelper-build-stamp -**/debian/files -**/debian/*.debhelper* -debian/*.postinst.debhelper -debian/*.postrm.debhelper -debian/*.preinst.debhelper -debian/*.prerm.debhelper -debian/*.substvars -*-build-deps_*.deb -*-build-deps_*.buildinfo -*-build-deps_*.changes diff --git a/qusal/dotfiles/files/git/.config/git/message b/qusal/dotfiles/files/git/.config/git/message deleted file mode 100644 index 780b832..0000000 --- a/qusal/dotfiles/files/git/.config/git/message +++ /dev/null @@ -1,3 +0,0 @@ - -# Title: 50c, summary, imperative, start uppercase, end without period -# Body: 72c, explain 'what' and 'why' vs. 'how', include task ID diff --git a/qusal/dotfiles/files/git/.config/git/sample/gitconfig.local.sample b/qusal/dotfiles/files/git/.config/git/sample/gitconfig.local.sample deleted file mode 100644 index 14e4743..0000000 --- a/qusal/dotfiles/files/git/.config/git/sample/gitconfig.local.sample +++ /dev/null @@ -1,12 +0,0 @@ -; ~/.gitconfig.local - -; SPDX-FileCopyrightText: 2023 Qusal contributors -; -; SPDX-License-Identifier: GPL-3.0-or-later - -[user] - email = your-mail@your-provider.domain - name = Your Name - signingKey = 0x012345678ABC - -; vim: ft=gitconfig diff --git a/qusal/dotfiles/files/git/.config/git/shell/.git-shell-lib b/qusal/dotfiles/files/git/.config/git/shell/.git-shell-lib deleted file mode 100644 index 08c5b07..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/.git-shell-lib +++ /dev/null @@ -1,28 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## guarantee commands are run from $HOME -cd - -base="src" - -fail_invalid_name(){ - printf '%s\n' "error: invalid $1 name" - exit 1 -} - -test_name(){ - name="$1" - if ! (echo "$name" | grep -q "^[A-Za-z0-9][A-Za-z0-9_.-]\+[A-Za-z0-9]$") - then - fail_invalid_name repository - fi -} - -clean_repo_name(){ - case "${repo-}" in - *.git) repo="";; - *) repo="$repo.git";; - esac -} diff --git a/qusal/dotfiles/files/git/.config/git/shell/description b/qusal/dotfiles/files/git/.config/git/shell/description deleted file mode 100755 index 589ff4f..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/description +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -# shellcheck disable=SC1090 -. ~/git-shell-commands/.git-shell-lib - -usage(){ - printf '%s\n' "usage: ${0##*/} SECTION REPOSITORY" - printf '%s\n' "regex: ^[A-Za-z0-9][A-Za-z0-9_.-]\+[A-Za-z0-9]$" - exit 1 -} - -test -n "${2-}" || usage -section="$2" -test_name "$section" -repo="$2" -test_name "$repo" -clean_repo_name - -# shellcheck disable=SC2154 -cat | cut -c 1-80 | tee "$base/$section/$repo/description" diff --git a/qusal/dotfiles/files/git/.config/git/shell/help b/qusal/dotfiles/files/git/.config/git/shell/help deleted file mode 100755 index 9468a26..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/help +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -ls ~/git-shell-commands diff --git a/qusal/dotfiles/files/git/.config/git/shell/init b/qusal/dotfiles/files/git/.config/git/shell/init deleted file mode 100755 index 08334a6..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/init +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -# shellcheck disable=SC1090 -. ~/git-shell-commands/.git-shell-lib - -usage(){ - printf '%s\n' "usage: ${0##*/} SECTION REPOSITORY [BRANCH]" - printf '%s\n' "regex: ^[A-Za-z0-9][A-Za-z0-9_.-]\+[A-Za-z0-9]$" - exit 1 -} - -test -n "${1-}" || usage -section="$1" -test_name "$section" -repo="$2" -test_name "$repo" -clean_repo_name -branch="" -test -n "${3-}" && branch="$3" - -if test -n "${branch}"; then - test_name "$branch" -fi - -# shellcheck disable=SC2154 -git init \ - --bare \ - ${branch:+--initial-branch $branch} \ - -- "$base/$section/$repo" diff --git a/qusal/dotfiles/files/git/.config/git/shell/list b/qusal/dotfiles/files/git/.config/git/shell/list deleted file mode 100755 index 81ae39a..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/list +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -# shellcheck disable=SC1090 -. ~/git-shell-commands/.git-shell-lib - -# shellcheck disable=SC2154 -if command -v tree >/dev/null; then - tree -L 1 "$base" -else - find "$base" -maxdepth 1 -type d -fi diff --git a/qusal/dotfiles/files/git/.config/git/shell/no-interactive-login b/qusal/dotfiles/files/git/.config/git/shell/no-interactive-login deleted file mode 100755 index d50bda7..0000000 --- a/qusal/dotfiles/files/git/.config/git/shell/no-interactive-login +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -command -v git >/dev/null || exit 1 -printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not" -printf '%s\n' "provide interactive shell access." -printf '%s\n' "You have access to these repositories:" - -for dir in ~/src/*.git; do - test -d "$dir" || continue - test git -C "$dir" rev-parse --is-bare-repository = "true" || continue - printf '%s\t\t' "${dir##*/}" - if grep -q "^Unnamed repository" "$dir"/description; then - printf '\n'; continue - fi - cat "$dir"/description -done -exit 128 diff --git a/qusal/dotfiles/files/git/.config/git/template/config b/qusal/dotfiles/files/git/.config/git/template/config deleted file mode 100644 index d02d7a7..0000000 --- a/qusal/dotfiles/files/git/.config/git/template/config +++ /dev/null @@ -1,17 +0,0 @@ -; SPDX-FileCopyrightText: 2023 Qusal contributors -; -; SPDX-License-Identifier: GPL-3.0-or-later - -[branch "main"] - remote = origin - merge = refs/heads/main - rebase = true -[core] - repositoryFormatVersion = 0 - fileMode = true - bare = false - logAllRefUpdates = true -[init] - defaultBranch = main - -; vim: ft=gitconfig diff --git a/qusal/dotfiles/files/git/.config/git/template/hooks/pre-receive b/qusal/dotfiles/files/git/.config/git/template/hooks/pre-receive deleted file mode 100755 index 075ccf3..0000000 --- a/qusal/dotfiles/files/git/.config/git/template/hooks/pre-receive +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## TODO: unfinished -# shellcheck disable=SC2317 -exit 0 - -set -eu - -command -v git >/dev/null || exit 1 - -exit_code=0 -zero_commit="0000000000000000000000000000000000000000" - -while read -r oldrev newrev ref; do -#read -r oldrev newrev ref - echo "$oldrev $newrev $ref" - test "$newrev" = "$zero_commit" && continue - - if test "$oldrev" = "$zero_commit"; then - objects="$(git rev-list "$newrev")" - else - objects="$(git rev-list "$oldrev..$newrev")" - fi - - for commit in $objects; do - git verify-commit "$commit" >/dev/null 2>&1 && return - - ## WARNING: tag verification is not working as expected. - commit_tag="$(git tag --points-at="$commit")" - if test -z "$commit_tag"; then - echo "Commit couldn't be verified and no tag points to it: $commit" - exit_code=1 - continue - fi - - if git verify-tag "$commit_tag" >/dev/null 2>&1; then - echo "Tag verification succeeded for commit: $commit" - continue - fi - - echo "Commit verification failed: $commit" - exit_code=1 - done - if test "$exit_code" != "0"; then - exit "$exit_code" - fi -done diff --git a/qusal/dotfiles/files/git/.config/git/template/info/exclude b/qusal/dotfiles/files/git/.config/git/template/info/exclude deleted file mode 100644 index c7ee087..0000000 --- a/qusal/dotfiles/files/git/.config/git/template/info/exclude +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -*.local diff --git a/qusal/dotfiles/files/git/.config/tig/config b/qusal/dotfiles/files/git/.config/tig/config deleted file mode 100644 index ad6afe5..0000000 --- a/qusal/dotfiles/files/git/.config/tig/config +++ /dev/null @@ -1,75 +0,0 @@ -# SPDX-FileCopyrightText: 2020 Jona Fonseca <jonas.fonseca@gmail.com> -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Credits: https://github.com/jonas/tig/blob/master/contrib/vim.tigrc - -bind generic h scroll-left -bind generic j move-down -bind generic k move-up -bind generic l scroll-right - -bind generic g none -bind generic gg move-first-line -bind generic gj next -bind generic gk previous -bind generic gp parent -bind generic gP back -bind generic gn view-next - -bind main G move-last-line -bind generic G move-last-line - -bind generic <C-f> move-page-down -bind generic <C-b> move-page-up - -bind generic v none -bind generic vm view-main -bind generic vd view-diff -bind generic vl view-log -bind generic vt view-tree -bind generic vb view-blob -bind generic vx view-blame -bind generic vr view-refs -bind generic vs view-status -bind generic vu view-stage -bind generic vy view-stash -bind generic vg view-grep -bind generic vp view-pager -bind generic vh view-help - -bind generic o none -bind generic oo :toggle sort-order -bind generic os :toggle sort-field -bind generic on :toggle line-number -bind generic od :toggle date -bind generic oa :toggle author -bind generic og :toggle line-graphics -bind generic of :toggle file-name -bind generic op :toggle ignore-space -bind generic oi :toggle id -bind generic ot :toggle commit-title-overflow -bind generic oF :toggle file-filter -bind generic or :toggle commit-title-refs - -bind generic @ none -bind generic @j :/^@@ -bind generic @k :?^@@ -bind generic @- :toggle diff-context -1 -bind generic @+ :toggle diff-context +1 - -bind status u none -bind stage u none -bind generic uu status-update -bind generic ur status-revert -bind generic um status-merge -bind generic ul stage-update-line -# bind generic up stage-update-parte -bind generic us stage-split-chunk - -bind generic c none -bind generic cc !git commit -bind generic ca !?@git commit --amend --no-edit - -bind generic K view-help -bind generic <C-w><C-w> view-next diff --git a/qusal/dotfiles/files/gtk/.config/gtk-2.0/bookmarks b/qusal/dotfiles/files/gtk/.config/gtk-2.0/bookmarks deleted file mode 100644 index 4ba6b95..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-2.0/bookmarks +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later - -file:///home/user/QubesIncoming diff --git a/qusal/dotfiles/files/gtk/.config/gtk-2.0/gtkrc-2.0 b/qusal/dotfiles/files/gtk/.config/gtk-2.0/gtkrc-2.0 deleted file mode 100644 index 54331fe..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-2.0/gtkrc-2.0 +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -gtk-theme-name=Adwaita-Dark -gtk-icon-theme-name=Adwaita -gtk-font-name="Sans 10" -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_TEXT -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=0 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintfull -gtk-xft-rgba=rgb -gtk-cursor-theme-name=Adwaita diff --git a/qusal/dotfiles/files/gtk/.config/gtk-2.0/qubes-incoming-bookmark-created b/qusal/dotfiles/files/gtk/.config/gtk-2.0/qubes-incoming-bookmark-created deleted file mode 100644 index a513909..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-2.0/qubes-incoming-bookmark-created +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later diff --git a/qusal/dotfiles/files/gtk/.config/gtk-3.0/bookmarks b/qusal/dotfiles/files/gtk/.config/gtk-3.0/bookmarks deleted file mode 100644 index 4ba6b95..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-3.0/bookmarks +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later - -file:///home/user/QubesIncoming diff --git a/qusal/dotfiles/files/gtk/.config/gtk-3.0/qubes-incoming-bookmark-created b/qusal/dotfiles/files/gtk/.config/gtk-3.0/qubes-incoming-bookmark-created deleted file mode 100644 index a513909..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-3.0/qubes-incoming-bookmark-created +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later diff --git a/qusal/dotfiles/files/gtk/.config/gtk-3.0/settings.ini b/qusal/dotfiles/files/gtk/.config/gtk-3.0/settings.ini deleted file mode 100644 index 80ff3b1..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-3.0/settings.ini +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[Settings] -gtk-theme-name=Adwaita-Dark -gtk-icon-theme-name=Adwaita -gtk-font-name=Sans 10 -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_TEXT -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=0 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintfull -gtk-xft-rgba=rgb -gtk-cursor-theme-name=Adwaita diff --git a/qusal/dotfiles/files/gtk/.config/gtk-4.0/bookmarks b/qusal/dotfiles/files/gtk/.config/gtk-4.0/bookmarks deleted file mode 100644 index 4ba6b95..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-4.0/bookmarks +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later - -file:///home/user/QubesIncoming diff --git a/qusal/dotfiles/files/gtk/.config/gtk-4.0/settings.ini b/qusal/dotfiles/files/gtk/.config/gtk-4.0/settings.ini deleted file mode 100644 index 80ff3b1..0000000 --- a/qusal/dotfiles/files/gtk/.config/gtk-4.0/settings.ini +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[Settings] -gtk-theme-name=Adwaita-Dark -gtk-icon-theme-name=Adwaita -gtk-font-name=Sans 10 -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_TEXT -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=0 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintfull -gtk-xft-rgba=rgb -gtk-cursor-theme-name=Adwaita diff --git a/qusal/dotfiles/files/net/.config/curl/.curlrc b/qusal/dotfiles/files/net/.config/curl/.curlrc deleted file mode 120000 index 402ec5c..0000000 --- a/qusal/dotfiles/files/net/.config/curl/.curlrc +++ /dev/null @@ -1 +0,0 @@ -curlrc \ No newline at end of file diff --git a/qusal/dotfiles/files/net/.config/curl/curlrc b/qusal/dotfiles/files/net/.config/curl/curlrc deleted file mode 100644 index 1a3b3f4..0000000 --- a/qusal/dotfiles/files/net/.config/curl/curlrc +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -show-error diff --git a/qusal/dotfiles/files/net/.config/urlview/urlview b/qusal/dotfiles/files/net/.config/urlview/urlview deleted file mode 100644 index 1f65147..0000000 --- a/qusal/dotfiles/files/net/.config/urlview/urlview +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -REGEXP \b(((https?|ftp|gopher)|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^] .,;\t\n\r<">\):] diff --git a/qusal/dotfiles/files/net/.config/wget/wgetrc b/qusal/dotfiles/files/net/.config/wget/wgetrc deleted file mode 100644 index c85b464..0000000 --- a/qusal/dotfiles/files/net/.config/wget/wgetrc +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -hsts-file=~/.cache/wget-hsts diff --git a/qusal/dotfiles/files/net/.urlview b/qusal/dotfiles/files/net/.urlview deleted file mode 120000 index 8f575f3..0000000 --- a/qusal/dotfiles/files/net/.urlview +++ /dev/null @@ -1 +0,0 @@ -.config/urlview/urlview \ No newline at end of file diff --git a/qusal/dotfiles/files/net/.w3m/keymap b/qusal/dotfiles/files/net/.w3m/keymap deleted file mode 100644 index 137aa69..0000000 --- a/qusal/dotfiles/files/net/.w3m/keymap +++ /dev/null @@ -1,256 +0,0 @@ -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-only - -## w3m vim-like keymap file -## Credits: https://github.com/sansna/keymap.w3m/blob/master/keymap.w3m - -########## invalidate defaults ########## -keymap K NULL -keymap J NULL -keymap SPC NULL -keymap - NULL -keymap + NULL -keymap C-v NULL -keymap ESC-v NULL -keymap C-f NULL -keymap C-b NULL -keymap C-n NULL -keymap C-p NULL -keymap < NULL -keymap > NULL -keymap . NULL -keymap , NULL -keymap ^ NULL -keymap C-a NULL -keymap W NULL -keymap ^[[6~ NULL -keymap ^[[5~ NULL -keymap g NULL -keymap ^[[1~ NULL -keymap ^[[4~ NULL -keymap ESC-< NULL -keymap ESC-> NULL -keymap [ NULL -keymap ] NULL -keymap ^[[Z NULL -keymap ESC-m NULL -keymap ( NULL -keymap ) NULL -keymap C-j NULL -keymap C-m NULL -keymap ESC-C-j NULL -keymap ESC-C-m NULL -keymap ESC-w NULL -keymap ESC-W NULL -keymap C-s NULL -keymap = NULL -keymap ESC-l NULL -keymap U NULL -keymap V NULL -keymap v NULL -keymap R NULL -keymap ESC-s NULL -keymap : NULL -keymap C-q NULL -keymap T NULL -keymap } NULL -keymap { NULL -keymap ESC-a NULL -keymap ESC-b NULL -keymap c NULL -keymap ESC-: NULL -keymap C-h NULL -keymap q NULL -keymap Q NULL -keymap C-w NULL -keymap C-d NULL -keymap C-u NULL -keymap RIGHT NULL -keymap l NULL -keymap LEFT NULL -keymap h NULL -keymap j NULL -keymap DOWN NULL -keymap k NULL -keymap UP NULL -keymap C-e NULL -keymap C-y NULL -keymap 0 NULL -keymap $ NULL -keymap Z NULL -keymap z NULL -keymap ESC-g NULL -keymap gg NULL -keymap G NULL -keymap w NULL -keymap b NULL -keymap C-n NULL -keymap C-p NULL -keymap ESC-TAB NULL -keymap f NULL -keymap C-o NULL -keymap TAB NULL -keymap C-j NULL -keymap C-] NULL -keymap I NULL -keymap ESC-I NULL -keymap ESC-C-j NULL -keymap y NULL -keymap u NULL -keymap i NULL -keymap gC-g NULL -keymap C-g NULL -keymap ";" NULL -keymap M NULL -keymap ESC-M NULL -keymap F NULL -keymap ESC-u NULL -keymap t NULL -keymap @ NULL -keymap "#" NULL -keymap | NULL -keymap B NULL -keymap L NULL -keymap H NULL -keymap s NULL -keymap gf NULL -keymap S NULL -keymap E NULL -keymap ESC-e NULL -keymap C-r NULL -keymap r NULL -keymap C-l NULL -keymap C-t NULL -keymap d NULL -keymap gt NULL -keymap gT NULL -keymap ESC-t NULL -keymap C-wL NULL -keymap C-wH NULL -keymap a NULL -keymap n NULL -keymap N NULL -keymap / NULL -keymap ? NULL -keymap C-@ NULL -keymap ESC-n NULL -keymap ESC-p NULL -keymap \" NULL -keymap ^[[2~ NULL -keymap ^[[28~ NULL -keymap ^[[E NULL -keymap ^[[L NULL -keymap o NULL -keymap C-k NULL -keymap D NULL -keymap m NULL -keymap ESC-c NULL -keymap ESC-o NULL -keymap ESC-k NULL -keymap \\ NULL -keymap ! NULL -keymap C-z NULL -keymap ZZ NULL -keymap ZQ NULL - - -########## command ########## -keymap :: COMMAND -keymap :H HELP -keymap :O OPTIONS -keymap :d DOWNLOAD_LIST - -########## history navigation ########## -keymap L NEXT -keymap H PREV -keymap :p SELECT_MENU -keymap :h HISTORY - -########## scrolling ########## -keymap C-e UP -keymap C-y DOWN -keymap gg BEGIN -keymap G END -keymap C-f NEXT_PAGE -keymap C-d NEXT_PAGE -keymap d NEXT_PAGE -keymap C-b PREV_PAGE -keymap C-u PREV_PAGE -keymap u PREV_PAGE -keymap zz CENTER_V -########## cursor ########## -#keymap l MOVE_RIGHT -keymap l NEXT_TAB -#keymap h MOVE_LEFT -keymap h PREV_TAB -#keymap j MOVE_DOWN1 -keymap j UP -#keymap k MOVE_UP1 -keymap k DOWN -keymap RIGHT MOVE_RIGHT -keymap LEFT MOVE_LEFT -keymap DOWN MOVE_DOWN1 -keymap UP MOVE_UP1 -keymap 0 LINE_BEGIN -keymap $ LINE_END -keymap w NEXT_WORD -keymap b PREV_WORD -########## cursor history ########## -keymap C-i REDO -keymap C-o UNDO -########## navigation ########## -keymap f MOVE_LIST_MENU -keymap F LIST_MENU -keymap C-n NEXT_LINK -keymap C-p PREV_LINK -keymap :l PEEK_LINK - -# reload -keymap r RELOAD -keymap C-r RELOAD - -# save/load -keymap :w SAVE -keymap :W PRINT -keymap :o GOTO -keymap :e LOAD - -# jump -keymap ESC-C-j SUBMIT -keymap C-] TAB_LINK -keymap C-j GOTO_LINK - -########## info ########## -keymap y PEEK -keymap gC-g INFO -keymap C-g LINE_INFO -keymap gf VIEW - -########## search ########## -keymap / ISEARCH -keymap ? ISEARCH_BACK -keymap n SEARCH_NEXT -keymap N SEARCH_PREV - -########## bookmarks ########## -keymap a ADD_BOOKMARK -keymap :b VIEW_BOOKMARK - -########## tab ########## -keymap x CLOSE_TAB -keymap gh GOTO http://www.google.com/en -keymap gH TAB_GOTO http://www.google.com/en -keymap C-t NEW_TAB -keymap gt NEXT_TAB -keymap gT PREV_TAB -keymap C-wL TAB_RIGHT -keymap C-wH TAB_LEFT -keymap t TAB_GOTO -keymap T TAB_MENU - -########## quit ########## -keymap ZZ EXIT -keymap C-Q EXIT -keymap ZQ QUIT -keymap :q QUIT diff --git a/qusal/dotfiles/files/pgp/.gnupg/gpg.conf b/qusal/dotfiles/files/pgp/.gnupg/gpg.conf deleted file mode 100644 index e6e268e..0000000 --- a/qusal/dotfiles/files/pgp/.gnupg/gpg.conf +++ /dev/null @@ -1,23 +0,0 @@ -## SPDX-FileCopyrightText: 2012 - 2013 Jacob Appelbaum <jacob@torproject.org> -## SPDX-FileCopyrightText: 2012 - 2013 Sukhbir Singh <sukhbir@torproject.org> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: BSD-2-Clause - -## Credits: https://github.com/ioerror/torbirdy/blob/master/gpg.conf - -## Algo -personal-digest-preferences SHA512 -cert-digest-algo SHA512 -default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed - -## Show -display-charset utf-8 -keyid-format long -list-options show-uid-validity -no-comments -verify-options show-uid-validity -with-fingerprint -with-subkey-fingerprint - -## vim: ft=gpg diff --git a/qusal/dotfiles/files/qvm-copy-dotfiles b/qusal/dotfiles/files/qvm-copy-dotfiles deleted file mode 100755 index 626f9b1..0000000 --- a/qusal/dotfiles/files/qvm-copy-dotfiles +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -## -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later -## -## Benefits of this method: -## - faster than salt, no need for a dispvm. -## - preserve permisions, salt-ssh doesnt. -## Disadvantages: -## - files need be copied to dom0 preserving permissions or setting again. -## -## Commands to run: -## sudo ./qvm-copy-dotfiles QUBE -set -eu - -test -n "${1:-}" || { echo "usage: ${0##*/} QUBE"; exit 1; } -test "$(id -u)" = "0" || { echo "Program requires root."; exit 1; } - -vm="$1" -qvm-check "$vm" >/dev/null 2>&1 || { echo "VM doesn't exist: '$vm'"; exit 1; } -test -f ./setup.sh || { echo "File doesn't exist: './setup.sh'"; exit 1; } - -if test "$vm" = "dom0"; then - sh ./dotfiles/setup.sh - sudo -u user mkdir -pv /home/user/.cache - tmpdir="$(sudo -u user mktemp -d /home/user/.cache/XXXXXX)" - trap 'rm -rf -- "$tmpdir"' EXIT INT HUP QUIT ABRT - cp -r ./dotfiles "$tmpdir" - chown -R user:user "$tmpdir" - sudo -u user "$tmpdir/dotfiles/setup.sh" - exit -fi - -qvm-run -q "$vm" -- "rm -rf ~/QubesIncoming/dom0/files" -qvm-copy-to-vm "$vm" ../files -qvm-run -q "$vm" -- "sh ~/QubesIncoming/dom0/files/setup.sh" -qvm-run -q "$vm" -- "rm -rf ~/QubesIncoming/dom0/files" diff --git a/qusal/dotfiles/files/setup.sh b/qusal/dotfiles/files/setup.sh deleted file mode 100755 index 13e8b99..0000000 --- a/qusal/dotfiles/files/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -set -eu - -prg="$0" -if ! test -e "$prg"; then - case "$prg" in - (*/*) exit 1;; - (*) prg=$(command -v -- "$prg") || exit;; - esac -fi -dir="$(cd -P -- "$(dirname -- "$prg")" && pwd -P)" || exit 1 -prg="$dir/$(basename -- "$prg")" || exit 1 -cd -- "$dir" || exit 1 - -usage(){ - printf '%s\n' "Usage: ${0##*/} [-h|--help] DIR [DIR2...]" - printf '%s\n' "Example: ${0##*/} # deploy all" - printf '%s\n' "Example: ${0##*/} sh vim ... # deploy specific dirs" -} - -case "${1-}" in - -h|--help) usage; exit 1;; - ""|--all) args="$(find . -maxdepth 1 -type d)";; - *) args="${*}";; -esac - -for dir in $args; do - case "${dir##*/}" in "."|"..") continue;; esac - dir="${dir%*/}" - test -f "$dir" && continue - if ! test -d "$dir"; then - printf '%s\n' "Directory doesn't exist: '$dir'." >&2 - exit 1 - fi - for file in "$dir"/.*; do - test -e "$file" || continue - case "${file##*/}" in "."|"..") continue;; esac - cp -rv "$file" "$HOME" - done -done diff --git a/qusal/dotfiles/files/sh/.bash_env b/qusal/dotfiles/files/sh/.bash_env deleted file mode 120000 index 0897744..0000000 --- a/qusal/dotfiles/files/sh/.bash_env +++ /dev/null @@ -1 +0,0 @@ -.config/bash/bash_env \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.bash_logout b/qusal/dotfiles/files/sh/.bash_logout deleted file mode 120000 index ae553ad..0000000 --- a/qusal/dotfiles/files/sh/.bash_logout +++ /dev/null @@ -1 +0,0 @@ -.config/bash/bash_logout \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.bash_profile b/qusal/dotfiles/files/sh/.bash_profile deleted file mode 120000 index e03d784..0000000 --- a/qusal/dotfiles/files/sh/.bash_profile +++ /dev/null @@ -1 +0,0 @@ -.config/bash/bash_profile \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.bashrc b/qusal/dotfiles/files/sh/.bashrc deleted file mode 120000 index 6d5541f..0000000 --- a/qusal/dotfiles/files/sh/.bashrc +++ /dev/null @@ -1 +0,0 @@ -.config/bash/bashrc \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.config/bash/bash_env b/qusal/dotfiles/files/sh/.config/bash/bash_env deleted file mode 100644 index 159e87c..0000000 --- a/qusal/dotfiles/files/sh/.config/bash/bash_env +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC1091 - -if test -z "$ENV" && test -n "$PATH"; then - case $- in - *l*) ;; - *) . "$HOME/.bash_profile" >/dev/null ;; - esac -fi diff --git a/qusal/dotfiles/files/sh/.config/bash/bash_logout b/qusal/dotfiles/files/sh/.config/bash/bash_logout deleted file mode 100644 index 3d1b800..0000000 --- a/qusal/dotfiles/files/sh/.config/bash/bash_logout +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -test "0${SHLVL-}" -le 1 && test -z "${SSH_TTY-}" && - test "${TERM-}" = linux && clear diff --git a/qusal/dotfiles/files/sh/.config/bash/bash_profile b/qusal/dotfiles/files/sh/.config/bash/bash_profile deleted file mode 100644 index dc18d17..0000000 --- a/qusal/dotfiles/files/sh/.config/bash/bash_profile +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,1091 - -. "$HOME/.profile" -case $- in *i*) . "$HOME/.bashrc";; esac diff --git a/qusal/dotfiles/files/sh/.config/bash/bashrc b/qusal/dotfiles/files/sh/.config/bash/bashrc deleted file mode 100644 index 99440ca..0000000 --- a/qusal/dotfiles/files/sh/.config/bash/bashrc +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bash - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## {{{ Requirements -## If not running interactively, return. -case $- in - *i*) ;; - *) return;; -esac - -## Source default files. -# shellcheck disable=SC1090,SC1091 -source "$HOME/.profile" -# shellcheck disable=SC1090 -source "$ENV" -## }}} -## {{{ Options -HISTCONTROL=ignoredups -shopt -s autocd -shopt -s direxpand -shopt -s cdspell -shopt -s dirspell -shopt -s histappend -shopt -s checkwinsize -shopt -s extglob -shopt -s globstar -## }}} -## {{{ Alias -alias reload="exec bash" -## }}} -## {{{ Prompt -if test -z "${debian_chroot:-}" && test -r /etc/debian_chroot; then - debian_chroot="$(cat /etc/debian_chroot)" -fi - -_reset_line() { - ## Credit: Can't find the source, posted on StackExchange or alike. - ## Does not work well on Bash 5.0 and older. - test "$(echo "${BASH_VERSION%.*}" | tr -d ".")" -lt 51 && return - - local termios cur_y - ## Ask the terminal for any pending (line buffered) input. - termios=$(stty --save) && stty -icanon && stty "$termios" - ## On pending input, assume it's been echoed and we're not in first column. - ## Otherwise ask the terminal for current column and read it from input. - if read -t 0 || { - IFS='[;' read -s -r -d'R' -p$'\033[6n' _ _ cur_y && [[ $cur_y != 1 ]] - } - then - ## Print line ending char with reversed video and end with newline. - printf '%b' "\033[41m\033[0m\033[7m%\033[m\n\r" - fi -} - -_print_ec(){ - test "${_ec_ps1}" = "0" && return - if test "${color_prompt:-}" = "yes"; then - printf %s"(\001\033[31m\002${_ec_ps1}\001\033[0m\002)" - else - printf '%s' "(${_ec_ps1})" - fi -} - -_save_ec() { _ec_ps1=$?; } -PROMPT_COMMAND=(_save_ec) -newline=$'\n' - -if test "${color_prompt:-}" = "yes"; then - # shellcheck disable=SC2154 - PS1="\$(_reset_line)\[\033[35m\][\[${reset_color}\]${debian_chroot:+($debian_chroot)}\[${usercolor}\]\u@\h \[${dircolor}\]\w\[${reset_color}\]\$(_git_prompt_info)\[\033[35m\]]\[${reset_color}\]${newline-}\$(_print_ec)${ps1_symbol} " -else - PS1="\$(_reset_line)[${debian_chroot:+($debian_chroot)}\u@\h:\w\$(_git_prompt_info)]${newline-}\$(_print_ec)${ps1_symbol} " -fi - -## If this is an xterm set the title to user@host:dir -case "$TERM" in - xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -esac - -## Reset cursor to steady block after command input and before execution. -# shellcheck disable=SC2034 -PS0="\e[2 q\2" - -if ! shopt -oq posix; then - source_readable /usr/share/bash-completion/bash_completion -fi - -unset newline ps1_symbol -## }}} -## {{{ Plugins -if has zoxide; then - eval "$(zoxide init bash)" -fi - -source_readable /usr/share/doc/fzf/examples/key-bindings.bash -source_readable /usr/share/doc/fzf/examples/completion.bash -## }}} -## {{{ End -## Source local bash configuration. -source_readable "$HOME/.bashrc.local" -## }}} diff --git a/qusal/dotfiles/files/sh/.config/bash/inputrc b/qusal/dotfiles/files/sh/.config/bash/inputrc deleted file mode 100644 index a232e7e..0000000 --- a/qusal/dotfiles/files/sh/.config/bash/inputrc +++ /dev/null @@ -1,136 +0,0 @@ -# inputrc - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -$include /etc/inputrc - -## Options -set bell-style none -set show-all-if-ambiguous on -set colored-stats on -set visible-stats on -set mark-symlinked-directories on -set colored-completion-prefix on -set menu-complete-display-prefix on -set skip-completed-text -set editing-mode emacs -set show-mode-in-prompt on - -$if term=linux - set emacs-mode-string "\1\e[?0c\2" - set vi-ins-mode-string "\1\e[?0c\2" - set vi-cmd-mode-string "\1\e[?8c\2" -$else - set emacs-mode-string "\1\e[6 q\2" - set vi-ins-mode-string "\1\e[6 q\2" - set vi-cmd-mode-string "\1\e[2 q\2" -$endif - -## Mode -$if mode=emacs - - set keymap emacs-ctlx - v: vi-editing-mode - Control-v: "\C-xv\e" - Esc: "\C-xv\e" - set keymap emacs - -$else - - set keymap vi-insert - Control-a: beginning-of-line - Control-b: backward-char - Control-d: delete-char - Control-e: end-of-line - Control-f: forward-char - Control-j: accept-line - Control-k: kill-line - Control-l: clear-screen - Control-m: accept-line - Control-n: next-history - Control-p: previous-history - Control-r: reverse-search-history - Control-s: forward-search-history - Control-t: transpose-chars - Control-u: unix-line-discard - Control-v: quoted-insert - Control-w: backward-kill-word - Control-y: yank - Control-[: vi-movement-mode - Control-_: undo - Control-?: backward-delete-char - Space: self-insert - - set keymap vi-command - Control-d: vi-eof-maybe - Control-h: backward-char - Control-j: accept-line - Control-k: kill-line - Control-l: clear-screen - Control-m: accept-line - Control-n: next-history - Control-p: previous-history - Control-q: quoted-insert - Control-r: vi-redo - Control-t: transpose-chars - Control-u: unix-line-discard - Control-v: quoted-insert - Control-w: backward-kill-word - Control-y: yank - Control-u: vi-undo - Control-?: backward-delete-char - Space: forward-char -$endif - -## Application -$if Bash - Control-w: backward-kill-word -$endif - - -## Home -"\e[1~": beginning-of-line -"\e[H": beginning-of-line -"\eOH": beginning-of-line - -## End -"\e[4~": end-of-line -"\e[F": end-of-line -"\eOF": end-of-line - -## Delete -"\e[3~": delete-char -"\e[P": delete-char -"\eOP": delete-char - -## Insert -"\e[2~": quoted-insert -"\e[L": quoted-insert - -## PgUp -"\e[5~": beginning-of-history -"\e[I": beginning-of-history - -## PgDown -"\e[6~": end-of-history -"\e[G": end-of-history - -## Ctrl+RighArrow -"\e[1;5C": forward-word -"\e[5C": forward-word -"\e\e[C": forward-word - -## Ctrl+LeftArrow -"\e[1;5D": backward-word -"\e[5D": backward-word -"\e\e[D": backward-word - -## Terminal -$if term=rxvt - "\e[7~": beginning-of-line - "\e[8~": end-of-line - "\eOc": forward-word - "\eOd": backward-word -$endif diff --git a/qusal/dotfiles/files/sh/.config/dircolors/dircolors b/qusal/dotfiles/files/sh/.config/dircolors/dircolors deleted file mode 100644 index f4f010f..0000000 --- a/qusal/dotfiles/files/sh/.config/dircolors/dircolors +++ /dev/null @@ -1,174 +0,0 @@ -# dircolors - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# Credits: https://github.com/tpope/dotfiles/blob/master/.dir_colors -# vim: set ft=dircolors - -# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the -# slackware version of dircolors) are recognized but ignored. -# Below are TERM entries, which can be a glob patterns, to match -# against the TERM environment variable to determine if it is colorizable. -TERM Eterm -TERM ansi -TERM *color* -TERM con[0-9]*x[0-9]* -TERM cons25 -TERM console -TERM cygwin -TERM dtterm -TERM gnome -TERM hurd -TERM jfbterm -TERM konsole -TERM kterm -TERM linux -TERM linux-c -TERM mlterm -TERM putty -TERM rxvt* -TERM screen* -TERM st -TERM terminator -TERM tmux* -TERM vt100 -TERM xterm* - -# Below are the color init strings for the basic file types. -# One can use codes for 256 or more colors supported by modern terminals. -# The default color codes use the capabilities of an 8 color terminal -# with some additional attributes as per the following codes: -# Attribute codes: -# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed -# Text color codes: -# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white -# Background color codes: -# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white -#NORMAL 00 # no color code at all -#FILE 00 # regular file: use no color at all -#RESET 0 # reset to "normal" color -DIR 01;34 # directory -LINK 01;36 # symbolic link. (If you set this to 'target' instead of a - # numerical value, the color is as for the file pointed to.) -# MULTIHARDLINK 00 # regular file with more than one link -FIFO 33 # pipe -SOCK 01;35 # socket -# DOOR 01;44 # door -BLK 00;35 # block device driver -CHR 01;33 # character device driver -ORPHAN 00;41 # symlink to nonexistent file -MISSING 00;45 # said nonexistent file - -SETUID 37;41 # file that is setuid (u+s) -SETGID 30;43 # file that is setgid (g+s) -#CAPABILITY 30;41 # file with capability -STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) -OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky -STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable -# This is for files with execute permission: -EXEC 01;32 - -# List any file extensions like '.gz' or '.tar' that you would like ls -# to colorize below. Put the extension, a space, and the color init string. -# (and any comments you want to add after a '#') -# If you use DOS-style suffixes, you may want to uncomment the following: -.cmd 00;32 -.exe 00;32 -.com 00;32 -.btm 00;32 -.bat 00;32 -# Or if you want to colorize scripts even if they do not have the -# executable bit actually set. -#.sh 01;32 -#.csh 01;32 - -# archives or compressed (bright red) -.tar 01;31 -.tgz 01;31 -.arc 01;31 -.arj 01;31 -.taz 01;31 -.lha 01;31 -.lz4 01;31 -.lzh 01;31 -.lzma 01;31 -.tlz 01;31 -.txz 01;31 -.tzo 01;31 -.t7z 01;31 -.zip 01;31 -.ZIP 01;31 -.z 01;31 -.Z 01;31 -.dz 01;31 -.gz 01;31 -.lrz 01;31 -.lz 01;31 -.lzo 01;31 -.xz 01;31 -.zst 01;31 -.tzst 01;31 -.bz2 01;31 -.bz 01;31 -.tbz 01;31 -.tbz2 01;31 -.tz 01;31 -.deb 01;31 -.rpm 01;31 -.jar 01;31 -.war 01;31 -.ear 01;31 -.sar 01;31 -.rar 01;31 -.alz 01;31 -.ace 01;31 -.zoo 01;31 -.cpio 01;31 -.7z 01;31 -.rz 01;31 -.cab 01;31 -.wim 01;31 -.swm 01;31 -.dwm 01;31 -.esd 01;31 - -# backup and temporary files -*~ 01;30 -*- 01;30 -.old 01;30 -.OLD 01;30 -.bak 01;30 -.BAK 01;30 -.back 01;30 -.dpkg-old 01;30 -.swp 01;30 -.swo 01;30 -.aux 01;30 -.bbl 01;30 -.glo 01;30 -.gls 01;30 -.ind 01;30 -.idx 01;30 -.blg 01;30 - -# system libraries, etc. -.so 00;33 -.o 00;33 -.a 00;33 -.dll 00;33 -.rbc 00;33 -.pyc 00;33 -.class 00;33 - -# patches -.diff 00;31 -.patch 00;31 - -# misc. -.dpkg-dist 01;37 -*core 01;37 -.lnk 01;36 -.url 01;36 diff --git a/qusal/dotfiles/files/sh/.config/less/lessfilter b/qusal/dotfiles/files/sh/.config/less/lessfilter deleted file mode 100755 index f8fa6b4..0000000 --- a/qusal/dotfiles/files/sh/.config/less/lessfilter +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/tpope/dotfiles/blob/master/.lessfilter - -set -eu - -if test -d "$1"; then - exec ls -lF "$1" -else - case $1 in - *.json) command -v jq >/dev/null && exec jq -C . "$1";; - esac -fi - -exit 1 diff --git a/qusal/dotfiles/files/sh/.config/less/lesskey b/qusal/dotfiles/files/sh/.config/less/lesskey deleted file mode 100644 index 11c0191..0000000 --- a/qusal/dotfiles/files/sh/.config/less/lesskey +++ /dev/null @@ -1,21 +0,0 @@ -## SPDX-FileCopyrightText: 2013 - 2016 Tim Pope <https://tpo.pe> -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/tpope/dotfiles/blob/master/.lesskey -#command -h left-scroll -l right-scroll -i toggle-option i -\b back-screen -^H back-screen -^? back-screen -\\ quit -#line-edit -^A home -^B left -^E end -^F right -^N down -^P up -\ef word-right diff --git a/qusal/dotfiles/files/sh/.config/less/lesskey-old b/qusal/dotfiles/files/sh/.config/less/lesskey-old deleted file mode 100644 index 5e2a428b56e3c28cb19eb43b1ca45f286105a471..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmZSZ)pk!7XUJgC%wf>VWLTfcz`?)_MDh&GF$@x^VhoH7oJ<TXtPEUi49t8Cd;$!- P(rFBAWef}zu6Zc{2b~A@ diff --git a/qusal/dotfiles/files/sh/.config/sh/profile b/qusal/dotfiles/files/sh/.config/sh/profile deleted file mode 100644 index 3365751..0000000 --- a/qusal/dotfiles/files/sh/.config/sh/profile +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Not so invasive because it only assigns a value if it is empty. -: "${HOME:=$(cd ~ && pwd)}" -: "${USER:=$(id -un || printf %s "${HOME##*/}")}" -: "${UID:=$(id -u || awk -F':' -v user="$USER" '/^user:/{print $3}' /etc/passwd)}" -: "${HOSTNAME:=$(hostname)}" -export HOME USER UID HOSTNAME - -## Set XDG_*_HOME variables. -XDG_CONFIG_HOME="$HOME/.config" -XDG_CACHE_HOME="$HOME/.cache" -XDG_DATA_HOME="$HOME/.local/share" -XDG_STATE_HOME="$HOME/.local/state" -export XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_STATE_HOME -mkdir -p "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_DATA_HOME" "$XDG_STATE_HOME" -## Set XDG_*_DIR variables. -eval "$(grep "^[ ]*XDG_[A-Z].*_DIR=" "$XDG_CONFIG_HOME/user-dirs.dirs" | - sed "s/^/export /")" - -## Set directory to be used for coding. -CODEDIR="$HOME/src" -export CODEDIR - -## Set shell configuration directories. -SHDIR="$XDG_CONFIG_HOME/sh" -BASHDIR="$XDG_CONFIG_HOME/bash" -ZDOTDIR="$XDG_CONFIG_HOME/zsh" -export SHDIR BASHDIR ZDOTDIR - -## Set general variables. -PATH="$HOME/bin:$HOME/.local/bin/$HOSTNAME:$HOME/.local/bin" -PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -PATH="$PATH:/usr/local/games:/usr/games" -# INFOPATH="/usr/local/share/info:/usr/local/info:/usr/share/info:/usr/info" -# MANPATH="/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man" -ENV="$SHDIR/shrc" -BASH_ENV="$BASHDIR/bash_env" -TMPDIR="/tmp" -LANG="en_US.UTF-8" -LANGUAGE="${LANG%.*}" -LC_ALL="$LANG" -GNUPGHOME="$HOME/.gnupg" -export PATH INFOPATH MANPATH ENV TMPDIR LANG LANGUAGE LC_ALL GNUPGHOME - -## Set interactive shell variables. -HISTSIZE=10000 -EDITOR="$(has -s vim vim.tiny vi)" -test -n "$EDITOR" && VISUAL="$EDITOR" -TERMINAL="xterm" -BROWSER="chromium" -PAGER="less" -LESS="FRq#10" -GPG_TTY="$(tty)" -BLOCKSIZE="K" -RSYNC_RSH="ssh -ax" -SYSTEMD_PAGER="" -if test -s /rw/config/gpg-split-domain; then - QUBES_GPG_DOMAIN="$(cat /rw/config/gpg-split-domain)" -else - QUBES_GPG_DOMAIN="@default" -fi -export HISTSIZE EDITOR VISUAL TERMINAL BROWSER PAGER LESS GPG_TTY BLOCKSIZE -export RSYNC_RSH SYSTEMD_PAGER QUBES_GPG_DOMAIN - -if has fd; then - FZF_DEFAULT_COMMAND='fd --type=f --hidden --exclude=.git' -elif has fdind; then - FZF_DEFAULT_COMMAND='fdfind --type=f --hidden --exclude=.git' -fi -FZF_DEFAULT_OPTS="--layout=reverse --height 40%" -FZF_TMUX=1 -export FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS FZF_TMUX - -## 'vim.tiny' and 'vi' fails if VIMINIT is set to our vimrc. -if has vim; then - if test -f "$XDG_CONFIG_HOME/vim/vimrc"; then - # shellcheck disable=SC2016,SC2089 - VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | so $MYVIMRC' - # shellcheck disable=SC2090 - export VIMINIT - fi -fi - -## XDG_CONFIG_HOME: user-specific configuration files -GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" -KDEHOME="$XDG_CONFIG_HOME/kde" -#KDEROOTHOME="/root/.config/kde" -CURL_HOME="$XDG_CONFIG_HOME/curl" -WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" -INPUTRC="$BASHDIR/inputrc" -XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" -if has less; then - if test "$(less -V | head -1 | cut -d " " -f2)" -ge 590; then - LESSKEY="$XDG_CONFIG_HOME/less/lesskey" - else - LESSKEY="$XDG_CONFIG_HOME/less/lesskey-old" - fi -fi -export GTK2_RC_FILES KDEHOME KDEROOTHOME CURL_HOME WGETRC INPUTRC XINITRC -export LESSKEY - -## XDG_DATA_HOME: user-specific data files -RUSTUP_HOME="$XDG_DATA_HOME/rustup" -CARGO_HOME="$XDG_DATA_HOME/cargo" -GOPATH="$XDG_DATA_HOME/go" -WORKON_HOME="$XDG_DATA_HOME/virtualenvs" -ELECTRUMDIR="$XDG_DATA_HOME/electrum" -TERMINFO="$XDG_DATA_HOME/terminfo" -export RUSTUP_HOME CARGO_HOME GOPATH WORKON_HOME ELECTRUMDIR TERMINFO - -## XDG_STATE_HOME: user-specific state files, persists application restarts -LESSHISTFILE="$XDG_STATE_HOME/history-less" -HISTFILE="$XDG_STATE_HOME/history-shell" -export LESSHISTFILE HISTFILE - -## XDG_CACHE_HOME: user-specific non-essential data files -GOCACHE="$XDG_CACHE_HOME/go-build" -GOMODCACHE="$XDG_CACHE_HOME/go/mod" -export GOCACHE GOMODCACHE - -## Start agents -if test -z "${SSH_AUTH_SOCK-}" && has ssh-agent; then - eval "$(ssh-agent -s)" >/dev/null -fi - -## Source local profile. -# shellcheck disable=SC1090,SC1091 -! test -r "$HOME/.profile.local" || . "$HOME/.profile.local" diff --git a/qusal/dotfiles/files/sh/.config/sh/shrc b/qusal/dotfiles/files/sh/.config/sh/shrc deleted file mode 100644 index 1adffff..0000000 --- a/qusal/dotfiles/files/sh/.config/sh/shrc +++ /dev/null @@ -1,284 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/tpope/dotfiles/blob/master/.shrc - -## {{{ Requirements -## If not running interactively, return. -case $- in - *i*) ;; - *) return;; -esac - -## Source profile. -# shellcheck disable=SC1091 -. "$HOME/.profile" -## }}} -## {{{ Options -stty -ixon -set -o noclobber -set -o notify -## Vi-mode does not work on Debian Bullseye with Dash 5.11 (2020). -## Debian Boowkworm has Dash >5.11 (2021) with adds libedit to the shell. -## https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561663 -#set -o vi -#stty quit undef -stty werase undef -## }}} -## {{{ Alias -## Standard commands. -test -n "$VISUAL" && alias vi='$VISUAL' -alias du="du -h" -alias df="df -h" -alias cp="cp -i" -alias mv="mv -i" -alias ls="ls -hF --group-directories-first --color=auto" -if has lsblk; then - _lsblk_options="NAME,FSTYPE,LABEL,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT" - alias lsblk='lsblk -o $_lsblk_options' - alias lsblku='lsblk -o $_lsblk_options,UUID,PARTUUID' -fi -if ! grep --color 2>&1 | grep -q "unrecognized option"; then - alias grep="grep --exclude='.*.swp' --exclude='*~' --color=auto" -fi -alias fgrep="grep -F" -alias egrep="grep -E" -alias diff="diff --color=auto" -has dir && alias dir="dir --color=auto" -has vdir && alias vdir="vdir --color=auto" -alias ip="ip -color=auto" -has highlight && alias highlight="highlight --out-format=ansi" -has pygmentize && alias pygmentize="pygmentize -f terminal" - -## Helpers. -alias reload='. $ENV' r="reload" -alias reload-xprofile='. $XDG_CONFIG_HOME/x11/xprofile' rx="reload-xprofile" -## POSIX cd does not allow '--' and other shells breaks when not using it. -alias -- -="cd -" 2>/dev/null || true -test -n "$EDITOR" && alias e='$EDITOR' -test -n "$VISUAL" && alias v='$VISUAL' -alias j="jobs" -alias h="history" -alias l="ls -CF" -alias ll="ls -Fl" -alias la="ls -Fa" -alias lla="ls -Fla" -alias laa='ls -Fd .* 2>/dev/null' -alias llaa='ls -Fdl .* 2>/dev/null' -alias lr='ls -R' -alias lx='ll -BX' -alias lz='ll -rS' -alias lt='ll -rt' -alias lm='la | more' -alias now="date +%a\ %Y-%m-%d\ %T" -alias mkd="mkdir -pv" -mkcd(){ mkd "$1" && cd "$1" || return; } - -## Non-standard programs. -has info && alias info="info --vi-keys" -has htop && alias top="htop" -has yt-dlp && alias yt="yt-dlp --add-metadata -ic" -has fdfind && alias fd="fdfind" -has lynx && alias lynx="lynx -vikeys" -has qubesctl && alias qubesctl="sudo qubesctl --show-output" qctl="qubesctl" -has gpg && alias gpgs="gpg --show-keys" -has gpg2 && alias gpg="gpg2" -if has qubes-gpg-client-wrapper; then - alias qubes-gpg="qubes-gpg-client-wrapper" - alias qgpg="qubes-gpg" -fi -## {{{ Tmux -has tmux && { - alias t="tmux" - alias td="t detach" - alias tls="t list-sessions" tl="tls" - alias tlw="t list-windows" - alias tlp="t list-panes" - alias tcl="clear && t clear-history" # clear buffer cus memory - tcla(){ - ## Clear all the panes of the current session. - for _t_pane in $(tmux list-panes -s -F '#{pane_id}'); do - tmux clear-history -t "$_t_pane" - done - } -} -## }}} -## {{{ Mutt -if has mutt; then - alias m="mutt" - alias mp="mutt -e 'unset signature' -e 'set pgp_autoinline=yes crypt_autosign=yes' -H" -fi -## }}} -## {{{ Git -if has git; then - alias g="git" - alias gcd='cd "$(git rev-parse --show-toplevel)"' - ## Use git aliases with 'g' prefix. - g_alias="$(git config --get-regexp 'alias.*' | sed 's/^alias\.//;s/ .*//')" - for key in $(printf '%s\n' "${g_alias}"); do - # shellcheck disable=SC2139,SC2140 - alias "g$key"="git $key" - done - unset g_alias -fi -## }}} -## }}} -## {{{ Colors -## Colorise "ls" output. -if has dircolors; then - ## Use dircolors if available. - if test -r "$XDG_CONFIG_HOME/dircolors/dircolors"; then - eval "$(dircolors -b "$XDG_CONFIG_HOME/dircolors/dircolors")" - else - eval "$(dircolors -b)" - fi - ## Fix bold on some terminals. - case "$TERM" in - xterm*|screen*) - LS_COLORS="$(echo "$LS_COLORS" | sed -e 's/01;3/00;9/g')" - ;; - esac - export LS_COLORS -else - ## BSD - CLICOLOR=1 CLICOLOR_FORCE=1 LSCOLORS=ExGxFxdxCxfxDxxbadacad ls -hF - export CLICOLOR CLICOLOR_FORCE LSCOLORS -fi - -## Set gcc colors. -GCC_COLORS="error=00;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" -export GCC_COLORS - -## Colors for programs that uses less such as 'man'. -GROFF_NO_SGR=1 -LESS_TERMCAP_mb="$(tput bold; tput setaf 2)" # begin blink -LESS_TERMCAP_md="$(tput bold; tput setaf 6)" # begin bold -LESS_TERMCAP_me="$(tput sgr0)" # reset bold/blink -LESS_TERMCAP_so="$(tput bold; tput setaf 7; tput setab 4)" # begin reverse video -LESS_TERMCAP_se="$(tput rmso; tput sgr0)" # reset reverse video -LESS_TERMCAP_us="$(tput smul; tput bold; tput setaf 2)" # begin underline -LESS_TERMCAP_ue="$(tput rmul; tput sgr0)" # reset underline -LESS_TERMCAP_mr="$(tput rev)" # revert -LESS_TERMCAP_mh="$(tput dim)" # dimerize -export GROFF_NO_SGR -export LESS_TERMCAP_mb LESS_TERMCAP_md LESS_TERMCAP_me -export LESS_TERMCAP_so LESS_TERMCAP_se LESS_TERMCAP_us -export LESS_TERMCAP_ue LESS_TERMCAP_mr LESS_TERMCAP_mh - -## }}} -## {{{ Prompt -## Set ability to color terminal. -color_prompt="" -# shellcheck disable=2034 -case "$TERM" in - iterm|*-truecolor) - export COLORTERM=truecolor; color_prompt=yes - ;; - *-color|*-256color) - color_prompt=yes - ;; - vte*) ;; -esac - -# shellcheck disable=SC3028 -_get_prompt_time(){ - test -n "${SECONDS:-}" || return - # shellcheck disable=SC2154 - _ptime="$((SECONDS-_saved_prompt_time))" - printf "%02d:%02d:%02d" \ - "$((_ptime/3600))" "$(((_ptime%3600)/60))" "$((_ptime%60))" -} - -_git_prompt_info(){ - has git || return - ref="$(git symbolic-ref HEAD 2>/dev/null | cut -d '/' -f3)" - test "${ref-}" || ref="$(git describe --tags --exact-match HEAD 2>/dev/null)" - test "${ref-}" || ref="$(git rev-parse HEAD 2>/dev/null | head -c 7)" - test "${ref-}" || return - # shellcheck disable=2039,3003 - case "$TERM" in - *-256color|xterm-kitty) branchcolor=$'\e[38;5;31m' ;; - *-88color|rxvt-unicode) branchcolor=$'\e[38;5;22m' ;; - *) branchcolor=$'\e[00;94m' ;; - esac - if test -n "${ZSH_VERSION-}"; then - # shellcheck disable=2016 - print -Pn '(%%{$branchcolor%%}%20>...>$ref%<<%%{\e[00m%%})' - else - printf '%s' "($branchcolor$ref$reset_color)" - fi -} - -# shellcheck disable=SC2034 -usercolor="$(printf '%b' "\e[00;93m")" -dircolor="$(printf '%b' "\e[01;34m")" -# shellcheck disable=SC2034 -## Use echotc Co? Only available by default for zsh, not bash. -case "$TERM" in - *-256color|xterm-kitty) - usercolor="$(printf '%b' "\e[38;5;184m")" - dircolor="$(printf '%b' "\e[38;5;27m")" - ;; - *-88color|rxvt-unicode) - usercolor="$(printf '%b' "\e[38;5;56m")" - dircolor="$(printf '%b' "\e[38;5;23m")" - ;; -esac -# shellcheck disable=SC2034 -test "$(id -u)" -eq 0 && usercolor="$(printf '%b' "\e[00;97m")" -# shellcheck disable=SC2034 -reset_color="$(printf '%b' '\e[00m')" - -case "${ZSH_VERSION-}" in - "") ps1_symbol="$";; - *) ps1_symbol="%%";; -esac -test "$(id -u)" = "0" && ps1_symbol="#" - -## Do not colorize this prompt, Sh fails to count the correct number of -## characters on the prompt leading to problems. -PS1="$(id -un)@$(hostname -s)${ps1_symbol} " -## }}} -## {{{ External Functions - -## Source file if it is readable. -## Usage: source_readable FILE -source_readable(){ - for _file in "$@"; do - # shellcheck disable=SC1090 - ! test -r "${_file}" || . "${_file}" - done -} - -_fzf_comprun() { - _fzf_command="$1" - shift - - case "$_fzf_command" in - cd) if has tree; then - fzf --preview 'tree -C {} | head -200' "$@" - else - fzf "$@" - fi - ;; - export|unset) - fzf --preview "eval 'echo \$'{}" "$@" - ;; - ssh) - fzf --preview 'dig {}' "$@" - ;; - *) - fzf --preview 'test -d {} || cat {}' "$@" - ;; - esac -} - -## }}} -## {{{ End -## Source local shell configuration file. -source_readable "$HOME/.shrc.local" -## }}} diff --git a/qusal/dotfiles/files/sh/.config/user-dirs.dirs b/qusal/dotfiles/files/sh/.config/user-dirs.dirs deleted file mode 100644 index 426a08b..0000000 --- a/qusal/dotfiles/files/sh/.config/user-dirs.dirs +++ /dev/null @@ -1,19 +0,0 @@ -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run. -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/" -XDG_DOWNLOAD_DIR="$HOME/" -XDG_TEMPLATES_DIR="$HOME/" -XDG_PUBLICSHARE_DIR="$HOME/" -XDG_DOCUMENTS_DIR="$HOME/" -XDG_MUSIC_DIR="$HOME/" -XDG_PICTURES_DIR="$HOME/" -XDG_VIDEOS_DIR="$HOME/" diff --git a/qusal/dotfiles/files/sh/.config/user-dirs.locale b/qusal/dotfiles/files/sh/.config/user-dirs.locale deleted file mode 100644 index 1ee4843..0000000 --- a/qusal/dotfiles/files/sh/.config/user-dirs.locale +++ /dev/null @@ -1,5 +0,0 @@ -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -en_US diff --git a/qusal/dotfiles/files/sh/.config/zsh/.zlogout b/qusal/dotfiles/files/sh/.config/zsh/.zlogout deleted file mode 120000 index 4a52f7a..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/.zlogout +++ /dev/null @@ -1 +0,0 @@ -zlogout \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.config/zsh/.zprofile b/qusal/dotfiles/files/sh/.config/zsh/.zprofile deleted file mode 120000 index 018fc86..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/.zprofile +++ /dev/null @@ -1 +0,0 @@ -zprofile \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.config/zsh/.zshenv b/qusal/dotfiles/files/sh/.config/zsh/.zshenv deleted file mode 120000 index 65979f5..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/.zshenv +++ /dev/null @@ -1 +0,0 @@ -zshenv \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.config/zsh/.zshrc b/qusal/dotfiles/files/sh/.config/zsh/.zshrc deleted file mode 120000 index c8b42f4..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/.zshrc +++ /dev/null @@ -1 +0,0 @@ -zshrc \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.config/zsh/zlogout b/qusal/dotfiles/files/sh/.config/zsh/zlogout deleted file mode 100644 index e2c2f9f..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/zlogout +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env zsh - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -test "0${SHLVL-}" -le 1 && test -z "${SSH_TTY-}" && - test "${TERM-}" = linux && clear diff --git a/qusal/dotfiles/files/sh/.config/zsh/zprofile b/qusal/dotfiles/files/sh/.config/zsh/zprofile deleted file mode 100644 index f768762..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/zprofile +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env zsh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Zsh does not source /etc/profile as it is not a Bourne based Shell, but -## some distributions such as Qubes, Whonix, Debian, Gentoo ship files to -## /etc/profile.d. - -emulate sh -c "source /etc/profile" -. "$HOME/.profile" diff --git a/qusal/dotfiles/files/sh/.config/zsh/zshenv b/qusal/dotfiles/files/sh/.config/zsh/zshenv deleted file mode 100644 index 0d5f3e2..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/zshenv +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env zsh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -if test -z "$ENV" && test -n "$PATH"; then - case $- in - *l*) ;; - *) . "$HOME/.zprofile" >/dev/null ;; - esac -fi diff --git a/qusal/dotfiles/files/sh/.config/zsh/zshrc b/qusal/dotfiles/files/sh/.config/zsh/zshrc deleted file mode 100644 index 37fdf00..0000000 --- a/qusal/dotfiles/files/sh/.config/zsh/zshrc +++ /dev/null @@ -1,462 +0,0 @@ -#!/usr/bin/env zsh - -## SPDX-FileCopyrightText: 2004 - 2022 Tim Pope <https://tpo.pe> -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/tpope/dotfiles/blob/master/.zshrc - -## {{{ Requirements -## If not running interactively, return. -case $- in - *i*) ;; - *) return;; -esac - -## Source default files. -# shellcheck disable=SC1090 -source "$HOME/.zprofile" -source "$ENV" -## }}} -## {{{ Options -## - Quiet -setopt no_beep -## - Words -setopt interactive_comments -## - History -SAVEHIST="$HISTSIZE" -setopt hist_expire_dups_first # purge dups first -setopt hist_ignore_dups # ignore dups in history list -setopt hist_verify # if command has hist expansion, show it before executing -## - Expansion -setopt auto_cd -setopt no_no_match # if a pattern has no matches print an error -setopt numeric_glob_sort # sort file names numerically when relevant -setopt magic_equal_subst # filename expansion for opt=arg -setopt no_equals # don't interpret =string as a command -## - Prompt -setopt prompt_subst -setopt transient_rprompt -setopt print_exit_value - -set zle_bracketed_paste -autoload -Uz bracketed-paste-magic -zle -N bracketed-paste bracketed-paste-magic -autoload -Uz url-quote-magic -zle -N self-insert url-quote-magic - -pasteinit() { - OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} - zle -N self-insert url-quote-magic -} -pastefinish() { - zle -N self-insert $OLD_SELF_INSERT -} -zstyle :bracketed-paste-magic paste-init pasteinit -zstyle :bracketed-paste-magic paste-finish pastefinish -## }}} -## {{{ Alias -alias reload="exec zsh" -## }}} -## {{{ Prompt -autoload -U colors && colors -[[ "${COLORTERM-}" == (24bit|truecolor) || "${terminfo[colors]}" -eq '16777216' ]] || zmodload zsh/nearcolor - -newline=$'\n' -if test "$color_prompt" = "yes"; then - PS1="%F{magenta}[%{$usercolor%}%n@%M%F{reset_color%} %{$dircolor%}%50<...<%~%<<%F{reset_color%}\$(_git_prompt_info)%F{magenta}]%F{reset_color}${newline-}${ps1_symbol} " - RPS1="%(?..(%{"$'\e[31m'"%}%?%{$reset_color%}%)%<<)" -else - PS1="[%n@%M %~\$(_git_prompt_info)]${newline}${ps1_symbol} " - RPS1="%(?..(%?%)%<<)" -fi - -## Set window title -_set_title() { - case "${1:-}" in - *install*) - hash -r ;; - esac - print -Pn '\e]1;%l@%m${1+*}\a' - print -Pn '\e]2;%n@%m:%~' - if test -n "${1:-}"; then - print -Pnr ' (%24>..>$1%>>)' | tr '\0-\037' '?' - fi - print -Pn " [%l]\a" -} - -case $TERM in - screen*) - precmd() { - _set_title "$@" - if [ "${STY:-}" -o "${TMUX:-}" ]; then - # print -Pn "\e]1;\a\e]1;@%m\a" - print -Pn '\ek@\e\\' - else - print -Pn '\ek@%m\e\\' - fi - } - preexec() { - _set_title "$@" - print -n "\ek" - print -Pnr '%10>..>$1' | tr '\0-\037' '?' - if [ "${STY:-}" -o "${TMUX:-}" ]; then - print -Pn '@\e\\' - else - print -Pn '@%m\e\\' - fi - } - ;; - - xterm*|rxvt*|Eterm*|kterm*|putty*|dtterm*|ansi*|cygwin*) - precmd () { _set_title "$@" } - preexec() { _set_title "$@" } - ;; - - linux*|vt220*) ;; - - *) - PS1="%n@%m:%~%# " - RPS1="%(?..(%?%)%<<)" - ;; -esac - -unset hostcolor hostletter hostcode dircolor usercolor usercode reset_color -unset newline -## }}} -## {{{ Completions - -## Enable completion. -zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache -zstyle ':completion:*' auto-description 'Specify: %d' -zstyle ':completion:*' completer _expand _complete _ignored _approximate -zstyle ':completion:*' expand prefix suffix -zstyle ':completion:*' file-sort name -zstyle ':completion:*' group-name '' -zstyle ':completion:*' ignore-parents parent pwd .. -zstyle ':completion:*' insert-unambiguous true -zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s -zstyle ':completion:*' list-suffixes true -zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' -zstyle ':completion:*' menu select=1 -zstyle ':completion:*' original true -zstyle ':completion:*' preserve-prefix '//[^/]##/' -zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s -zstyle ':completion:*' special-dirs true -zstyle ':completion:*' squeeze-slashes true -zstyle ':completion:*' use-compctl true -zstyle ':completion:*' verbose true -zstyle ':completion:*:*:-command-:*:*' file-patterns \ - '*(#q-*):executables:Executables *(-/):directories:Directories' -zstyle -e ':completion:*:*:-command-:*:*' tag-order ' - reply=(" - executables:Executables:Executables - builtins:Builtins:Builtins - commands:Commands:Commands - aliases:Aliases:Aliases - functions:Functions:Functions - parameters:Variables:Variables - reserved-words:Keywords:Keywords - directories:Directories - " - - )' - -## Completion per utility. -zstyle ':completion:*:sudo::' environ \ - HOME="/root" \ - PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -zstyle ':completion:*:doas::' environ \ - HOME="/root" \ - PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -## Colored completions. -# zstyle ':completion:*' format 'Completing %d' -zstyle ':completion:*:*:*:*:descriptions' format '%B%F{blue}-- %d --%b%f' -zstyle ':completion:*:messages' format ' %B%F{purple} -- %d --%f%b' -zstyle ':completion:*:warnings' format ' %B%F{red}-- no matches found --%f%b' - -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*:*:kill:*' list-colors '=(#b) #([0-9]#)*( *[a-z])*=94=91=93' - -## Load completions. -autoload -Uz compinit -zmodload zsh/complist -mkdir -p $XDG_CACHE_HOME/zsh -compinit -u -d $XDG_CACHE_HOME/zsh/zcompdump -# _comp_options+=(globdots) -if has zoxide; then - eval "$(zoxide init zsh)" -fi -## }}} -## {{{ Plugins -source_readable /usr/share/doc/fzf/examples/key-bindings.zsh -source_readable /usr/share/doc/fzf/examples/completion.zsh - -if test "$color_prompt" = "yes"; then - ## Enable auto-suggestions based on the history - if test -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh; then - ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=30 - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=7,bg=8,underline" - typeset -a ZSH_AUTOSUGGEST_CLEAR_WIDGETS - ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste) - source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh - fi - ## Highlight commands as you type - if test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh; then - ## https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters - ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern regexp) - typeset -A ZSH_HIGHLIGHT_STYLES - ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red' - ZSH_HIGHLIGHT_STYLES[default]='fg=white' - ZSH_HIGHLIGHT_STYLES[alias]='fg=cyan' - ZSH_HIGHLIGHT_STYLES[function]='fg=cyan' - ZSH_HIGHLIGHT_STYLES[builtin]='fg=green' - ZSH_HIGHLIGHT_STYLES[command]='fg=green' - ZSH_HIGHLIGHT_STYLES[precommand]='fg=green' - ZSH_HIGHLIGHT_STYLES[comment]='fg=black,bold' - ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan' - typeset -A ZSH_HIGHLIGHT_REGEXP - ZSH_HIGHLIGHT_REGEXP+=('^sudo' 'fg=magenta') - ZSH_HIGHLIGHT_REGEXP+=('^doas' 'fg=magenta') - source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - fi -fi -## }}} -## {{{ Bindkeys - -## Widgets -## -function bindkey-multi () { - ## Usage: bindkey-multi mode Nmode -- bind nbind terminfoname -- widgetname - local i j widget nomap - local -a maps sequences - - test "$1" = "--" && nomap=1 - - while [[ "$1" != "--" ]]; do - maps+=( "$1" ) - shift - done - shift - - while [[ "$1" != "--" ]]; do - sequences+=( "$1" ) - shift - done - shift - - widget="$1" - test -z "$widget" && return 1 - - if test -n "$nomap"; then - for j in "${sequences[@]}"; do - test "$j" || continue - bindkey -- "$j" "$widget" - done - return 0 - fi - - for i in "${maps[@]}"; do - test "$i" || continue - for j in "${sequences[@]}"; do - test "$j" || continue - bindkey -M "$i" -- "$j" "$widget" - done - done - return 0 -} - -function clear-screen-and-scrollback() { - test -n "${TTY-}" || return - echoti civis >"$TTY" - printf '%b' "\e[H\e[2J" >"$TTY" - zle .reset-prompt - zle -R - printf '%b' "\e[3J" >"$TTY" - echoti cnorm >"$TTY" -} -zle -N clear-screen-and-scrollback - -fg-widget() { - if [[ $#BUFFER -eq 0 ]]; then - if jobs %- >/dev/null 2>&1; then - BUFFER='fg %-' - else - BUFFER='fg' - fi - zle accept-line - else - zle push-input - zle clear-screen - fi -} -zle -N fg-widget - -change-first-word(){ - zle beginning-of-line -N - zle kill-word -} -zle -N change-first-word - -new-screen() { - test -z "$STY" || screen < "$TTY" - test -z "$TMUX" || tmux new-window -} -zle -N new-screen - -zle-keymap-select zle-line-init() { - case $KEYMAP in - vicmd) print -n -- "\e[2 q";; - viins|main) print -n -- "\e[5 q";; - esac - - zle reset-prompt - zle -R -} -zle-line-finish() { - print -n -- "\e[2 q" -} -zle -N zle-line-init -zle -N zle-line-finish -zle -N zle-keymap-select - -set-keymap-vi(){ - export KEYTIMEOUT=1 - bindkey -v -} - -set-keymap-emacs(){ - bindkey -e - bindkey -r "^Q" -} - -## Keymap mode -set-keymap-emacs - -autoload -Uz select-word-style -select-word-style bash - -## Viins -bindkey -M viins "^A" beginning-of-line -bindkey -M viins "^B" backward-char -bindkey -M viins "^D" delete-char-or-list -bindkey -M viins "^E" end-of-line -bindkey -M viins "^F" forward-char -bindkey-multi emacs viins vicmd -- "^G" -- which-command -bindkey -M viins "^J" accept-search -bindkey -M viins "^K" kill-line -bindkey -M viins "^L" clear-screen-and-scrollback -bindkey -M viins "^M" accept-line -bindkey -M viins "^N" down-line-or-history -bindkey -M viins "^P" up-line-or-history -bindkey -M viins "^R" history-incremental-search-backward -bindkey -M viins "^S" history-incremental-search-forward -bindkey -M viins "^T" transpose-chars -bindkey-multi emacs viins -- "^W" -- vi-backward-kill-word -bindkey -M viins "^U" backward-kill-line -bindkey -M emacs "^U" backward-kill-line -bindkey -M viins "^Y" yank -bindkey-multi emacs viins vicmd -- "^Z" -- fg-widget -bindkey -M viins "^_" undo -bindkey -M viins "^@" redo -bindkey -M viins " " magic-space -bindkey -M emacs " " magic-space -bindkey -M emacs "^X^[" vi-cmd-mode -## Viins alt -bindkey -M viins "^[u" undo -bindkey -M viins "^[r" redo -bindkey -M viins "^[m" copy-prev-shell-word - -## Misc -bindkey -M isearch "^J" accept-search 2>/dev/null -bindkey -M menuselect "h" vi-backward-char -bindkey -M menuselect "k" vi-up-line-or-history -bindkey -M menuselect "l" vi-forward-char -bindkey -M menuselect "j" vi-down-line-or-history -bindkey -M menuselect "^C" send-break -bindkey -M menuselect "^J" accept-and-infer-next-history # accept-search -bindkey -M menuselect "^M" accept-line - -## Keys for multiple modes and multiple bindings. -## https://invisible-island.net/xterm/xterm-function-keys.html -## -## Shit+Tab -bindkey-multi viins menuselect -- "\E[Z" "${terminfo[kcbt]}" \ - -- reverse-menu-complete -## Backspace -bindkey-multi viins vicmd menuselect -- "^H" "^?" "${terminfo[kbs]}" \ - -- backward-delete-char -## Home -bindkey-multi viins vicmd -- "\E[1~" "\E[7~" "\E[H" "\EOH" \ - "${terminfo[khome]}" \ - -- beginning-of-line -## Insert -bindkey-multi viins vicmd -- "\E[2~" "\E[L" "${terminfo[kich1]}" \ - -- overwrite-mode -## Delete -bindkey-multi viins vicmd -- "\E[3~" "\E[P" "\EOP" "${terminfo[kdch1]}" \ - -- vi-delete-char -## End -bindkey-multi viins vicmd -- "\E[4~" "\E[8~" "\E[F" "\EOF" \ - "${terminfo[kend]}" \ - -- end-of-line -## PgUp -bindkey-multi viins -- "\E[5~" "\E[I" "${terminfo[kpp]}" \ - -- beginning-of-buffer-or-history -## PgDown -bindkey-multi viins -- "\E[6~" "\E[G" "${terminfo[knp]}" \ - -- end-of-buffer-or-history -## Up arrow -bindkey-multi viins vicmd -- "\E[A" "\EOA" "${terminfo[kcuu1]}" \ - -- up-line-or-history -## Down arrow -bindkey-multi viins vicmd -- "\E[B" "\EOB" "${terminfo[kcud1]}" \ - -- down-line-or-history -## Right arrow -bindkey-multi viins vicmd -- "\E[C" "\EOC" "${terminfo[kcuf1]}" \ - -- forward-char -## Left arrow -bindkey-multi viins vicmd -- "\E[D" "\EOD" "${terminfo[kcub1]}" \ - -- backward-char -## Ctrl-Delete -bindkey-multi viins vicmd -- "\E[3;5~" "\E[3\^" "${terminfo[kDC5]}" \ - -- kill-word -## Ctrl-RightArrow -bindkey-multi viins vicmd -- "\E[1;5C" "\E0c" "${terminfo[kRIT5]}" \ - -- forward-word -## Ctrl-LeftArrow -bindkey-multi viins vicmd -- "\E[1;5D" "\E0d" "${terminfo[kLFT5]}" \ - -- backward-word -## F11 -bindkey-multi viins -- "\E[23~" "${terminfo[kf11]}" -- new-screen - -autoload -Uz edit-command-line -zle -N edit-command-line -bindkey -M emacs "^[e" edit-command-line -bindkey -M emacs "^X^E" edit-command-line -bindkey -M vicmd "^E" edit-command-line - -bindkey -M emacs "\ea" change-first-word -bindkey -M emacs "^XD" describe-key-briefly - -for binding in ${(f)$(bindkey -M emacs|grep '^"\^X')}; do - bindkey -M viins "${(@Qz)binding}" -done -unset binding - -## Make sure the terminal is in application mode, when zle is active. -## Only then are the values from $terminfo valid. -if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then - autoload -Uz add-zle-hook-widget - function zle_application_mode_start { echoti smkx } - function zle_application_mode_stop { echoti rmkx } - add-zle-hook-widget -Uz zle-line-init zle_application_mode_start - add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop -fi -## }}} -## {{{ End -## Source local zsh configuration. -source_readable "$HOME/.zshrc.local" -## }}} diff --git a/qusal/dotfiles/files/sh/.profile b/qusal/dotfiles/files/sh/.profile deleted file mode 120000 index c8f95a8..0000000 --- a/qusal/dotfiles/files/sh/.profile +++ /dev/null @@ -1 +0,0 @@ -.config/sh/profile \ No newline at end of file diff --git a/qusal/dotfiles/files/sh/.zprofile b/qusal/dotfiles/files/sh/.zprofile deleted file mode 120000 index 9975264..0000000 --- a/qusal/dotfiles/files/sh/.zprofile +++ /dev/null @@ -1 +0,0 @@ -.config/zsh/zprofile \ No newline at end of file diff --git a/qusal/dotfiles/files/ssh/.ssh/config b/qusal/dotfiles/files/ssh/.ssh/config deleted file mode 100644 index f915448..0000000 --- a/qusal/dotfiles/files/ssh/.ssh/config +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -Host * - ## Distrust the remote - ForwardX11 no - ForwardX11Trusted no - ForwardAgent no - ## Authentication - UpdateHostKeys ask - PreferredAuthentications publickey,keyboard-interactive,password - HostbasedAuthentication no - StrictHostKeyChecking yes - ## Encryption - HostKeyAlgorithms ssh-ed25519,sk-ssh-ed25519@openssh.com - PubkeyAcceptedAlgorithms ssh-ed25519,sk-ssh-ed25519@openssh.com - KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org - Ciphers aes256-gcm@openssh.com - MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com - -UserKnownHostsFile ~/.ssh/known_hosts.d/%k.host ~/.ssh/known_hosts.d/%h.host -Include ~/.ssh/config.d/*.conf -# vim: ft=sshconfig diff --git a/qusal/dotfiles/files/ssh/.ssh/config.d/.gitignore b/qusal/dotfiles/files/ssh/.ssh/config.d/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/qusal/dotfiles/files/ssh/.ssh/known_hosts.d/.gitignore b/qusal/dotfiles/files/ssh/.ssh/known_hosts.d/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/qusal/dotfiles/files/tmux/.config/tmux/tmux.conf b/qusal/dotfiles/files/tmux/.config/tmux/tmux.conf deleted file mode 100644 index 5653a76..0000000 --- a/qusal/dotfiles/files/tmux/.config/tmux/tmux.conf +++ /dev/null @@ -1,142 +0,0 @@ -## tmux.conf - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -#! {{{ Options -## Usage -set-window-option -g wrap-search off -set-window-option -g aggressive-resize on -set-window-option -g pane-base-index 1 -set-option -g base-index 1 -set-option -g status-keys emacs -set-option -g mode-keys vi -set-option -g mouse on -set-option -g history-limit 10000 -set-option -g repeat-time 2000 -set-option -g escape-time 50 -set-option -g status-position top -set-option -g default-terminal screen-256color -# set-option -g default-terminal tmux-256color # on newer ncurses -set-option -g display-panes-time 2000 -set-option -g display-time 2000 -set-option -g focus-events on -set-option -g status-interval 5 -set-option -g set-titles on - -## Visual -set-option -g display-panes-active-colour 'red' -set-option -g display-panes-colour 'white' -set-option -g message-command-style 'default' -set-option -g message-style 'default' -set-option -g clock-mode-colour 'red' -set-option -g clock-mode-style '24' -set-option -g mode-style 'bg=brightred' -set-option -g pane-active-border-style 'fg=brightcyan' -set-option -g pane-border-style 'default' -set-option -g window-status-activity-style 'fg=brightyellow,bg=black' -set-option -g window-status-current-format ' #I:#W#F ' -set-option -g window-status-current-style 'fg=black,bg=brightred' -set-option -g window-status-format ' #I:#W#F ' -set-option -g window-status-separator '' - -## Status -set-option -g status-interval '1' -set-option -g status-justify 'centre' -set-option -g status-style 'fg=brightcyan,bg=black' -set-option -g status-left '#{?client_prefix,#[bg=brightred]#[fg=black]+#[bg=black] , }#[bg=black]#[fg=brightgreen]#S #[fg=brightyellow]#I #[fg=brightcyan]#P' -set-option -g status-left-length '40' -set-option -g status-left-style 'fg=green,bg=black' -set-option -g status-right '#{tmux_mode_indicator} #[fg=brightcyan]#H #[fg=brightyellow]%H:%M:%S' -set-option -g status-right-length '40' -set-option -g status-right-style 'fg=brightcyan,bg=black' - -## Terminal capabilities and update environment -set-option -g terminal-overrides '*256color:Tc,xterm*:XT:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E[%p1%d q,rxvt-unicode*:XT:sitm@:ritm@' -set-option -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PI +D SSH_CONNECTION WINDOWID XAUTHORITY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP" -set-environment -gu DBUS_SESSION_BUS_ADDRESS - -## }}} -#! {{{ Bindings -## Prefix -set-option -g prefix C-s -unbind-key C-b -bind-key C-s send-prefix -bind-key C-s last-window -## Prompt -unbind-key \; -bind-key \; command-prompt -## Window -bind-key | split-window -h -bind-key - split-window -v -unbind-key '"' -unbind-key % -bind-key C-c new-window -bind-key ` select-window -t 0 -bind-key -r C-p select-window -t :- # equiv: previous-window -bind-key -r C-n select-window -t :+ # equiv: next-window -## Pane -bind-key h select-pane -L -bind-key j select-pane -D -bind-key k select-pane -U -bind-key l select-pane -R -bind-key -r C-h resize-pane -L 5 -bind-key -r C-j resize-pane -D 5 -bind-key -r C-k resize-pane -U 5 -bind-key -r C-l resize-pane -R 5 -bind-key _ resize-pane -Z -bind-key H join-pane -b -h -t ! -bind-key J join-pane -t ! -bind-key @ join-pane -t ! -bind-key K kill-pane -bind-key -r "<" swap-window -d -t -1 -bind-key -r ">" swap-window -d -t +1 -## Copy mode -bind-key Escape copy-mode -unbind-key p -bind-key p paste-buffer -bind-key -T copy-mode-vi 'v' send -X begin-selection -bind-key -T copy-mode-vi 'y' send -X copy-selection -bind-key -T copy-mode-vi 'Space' send -X halfpage-down -bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up -# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b" -# bind p run "xsel -o | tmux load-buffer - ; tmux paste-buffer" -bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null" -bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer" -## Miscellaneous -bind-key C attach-session -t . -c '#{pane_current_path}' \; display-message "Session directory set to #{pane_current_path}" -bind-key E set-option mouse \; display-message "Mouse #{?mouse,on,off}" -bind-key X set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}" -bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"' -bind-key R run-shell '\ -: "${XDG_CONFIG_HOME:=$HOME/.config}"; \ -if test -f "$XDG_CONFIG_HOME/tmux/tmux.conf"; then \ - tmux source "$XDG_CONFIG_HOME/tmux/tmux.conf"; \ - tmux display-message "Reloaded configuration: $XDG_CONFIG_HOME/tmux/tmux.conf"; \ -elif test -f "$HOME/.tmux/tmux.conf"; then \ - tmux source "$HOME/.tmux/tmux.conf"; \ - tmux display-message "Reloaded configuration: $HOME/.tmux/tmux.conf"; \ -elif test -f "$HOME/.tmux.conf"; then \ - tmux source "$HOME/.tmux.conf"; \ - tmux display-message "Reloaded configuration: $HOME/.tmux.conf"; \ -fi' -## }}} - -#! {{{ Plugins -## 'tmux-plugins/tmux-resurrect' -set -g @resurrect-capture-pane-contents 'on' -set -g @resurrect-save 'M-S' -set -g @resurrect-restore 'M-R' -## 'tmux-plugins/tmux-continuum', dep tmux-resurrect -set -g @continuum-restore 'on' -## 'MunifTanjim/tmux-suspend' -set -g @suspend_key 'F12' -## }}} - -#! {{{ End -if-shell 'test -f "$HOME/.tmux.conf.local"' 'tmux source "$HOME/.tmux.conf.local"' -run-shell 'command -v tmux-sorcerer >/dev/null && tmux-sorcerer ~/.config/tmux/plugins ~/src/tmux/plugins' -## }}} - -## vim:set foldmethod=expr foldexpr=getline(v\:lnum)=~'^#!'?'>1'\:'=': diff --git a/qusal/dotfiles/files/vim/.config/vim/after/autoload/pathogen.vim b/qusal/dotfiles/files/vim/.config/vim/after/autoload/pathogen.vim deleted file mode 100644 index 0744105..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/autoload/pathogen.vim +++ /dev/null @@ -1,355 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope <http://tpo.pe/> -" Version: 2.4 -" SPDX-FileCopyrightText: 2022 Tim Pope <https://tpo.pe> -" SPDX-License-Identifier: Vim - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" For management of individually installed plugins in ~/.vim/bundle (or -" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your -" .vimrc is the only other setup necessary. -" -" The API is documented inline below. - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 1 - -" Point of entry for basic default usage. Give a relative path to invoke -" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke -" pathogen#surround(). Curly braces are expanded with pathogen#expand(): -" "bundle/{}" finds all subdirectories inside "bundle" inside all directories -" in the runtime path. -function! pathogen#infect(...) abort - for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}'] - if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]' - call pathogen#surround(path) - elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)' - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#surround(path . '/{}') - elseif path =~# '[{}*]' - call pathogen#interpose(path) - else - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#interpose(path . '/{}') - endif - endfor - call pathogen#cycle_filetype() - if pathogen#is_disabled($MYVIMRC) - return 'finish' - endif - return '' -endfunction - -" Split a path into a list. -function! pathogen#split(path) abort - if type(a:path) == type([]) | return a:path | endif - if empty(a:path) | return [] | endif - let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,') - return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")') -endfunction - -" Convert a list to a path. -function! pathogen#join(...) abort - if type(a:1) == type(1) && a:1 - let i = 1 - let space = ' ' - else - let i = 0 - let space = '' - endif - let path = "" - while i < a:0 - if type(a:000[i]) == type([]) - let list = a:000[i] - let j = 0 - while j < len(list) - let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g') - let path .= ',' . escaped - let j += 1 - endwhile - else - let path .= "," . a:000[i] - endif - let i += 1 - endwhile - return substitute(path,'^,','','') -endfunction - -" Convert a list to a path with escaped spaces for 'path', 'tag', etc. -function! pathogen#legacyjoin(...) abort - return call('pathogen#join',[1] + a:000) -endfunction - -" Turn filetype detection off and back on again if it was already enabled. -function! pathogen#cycle_filetype() abort - if exists('g:did_load_filetypes') - filetype off - filetype on - endif -endfunction - -" Check if a bundle is disabled. A bundle is considered disabled if its -" basename or full name is included in the list g:pathogen_blacklist or the -" comma delimited environment variable $VIMBLACKLIST. -function! pathogen#is_disabled(path) abort - if a:path =~# '\~$' - return 1 - endif - let sep = pathogen#slash() - let blacklist = - \ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) + - \ pathogen#split($VIMBLACKLIST) - if !empty(blacklist) - call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")') - endif - return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1 -endfunction - -" Prepend the given directory to the runtime path and append its corresponding -" after directory. Curly braces are expanded with pathogen#expand(). -function! pathogen#surround(path) abort - let sep = pathogen#slash() - let rtp = pathogen#split(&rtp) - let path = fnamemodify(a:path, ':s?[\\/]\=$??') - let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)') - let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])') - call filter(rtp, 'index(before + after, v:val) == -1') - let &rtp = pathogen#join(before, rtp, after) - return &rtp -endfunction - -" For each directory in the runtime path, add a second entry with the given -" argument appended. Curly braces are expanded with pathogen#expand(). -function! pathogen#interpose(name) abort - let sep = pathogen#slash() - let name = a:name - if has_key(s:done_bundles, name) - return "" - endif - let s:done_bundles[name] = 1 - let list = [] - for dir in pathogen#split(&rtp) - if dir =~# '\<after$' - let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir] - else - let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)') - endif - endfor - let &rtp = pathogen#join(pathogen#uniq(list)) - return 1 -endfunction - -let s:done_bundles = {} - -" Invoke :helptags on all non-$VIM doc directories in runtimepath. -function! pathogen#helptags() abort - let sep = pathogen#slash() - for glob in pathogen#split(&rtp) - for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep') - if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags')) - silent! execute 'helptags' pathogen#fnameescape(dir) - endif - endfor - endfor -endfunction - -command! -bar Helptags :call pathogen#helptags() - -" Execute the given command. This is basically a backdoor for --remote-expr. -function! pathogen#execute(...) abort - for command in a:000 - execute command - endfor - return '' -endfunction - -" Section: Unofficial - -function! pathogen#is_absolute(path) abort - return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]') -endfunction - -" Given a string, returns all possible permutations of comma delimited braced -" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields -" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard -" and globbed. Actual globs are preserved. -function! pathogen#expand(pattern, ...) abort - let after = a:0 ? a:1 : '' - if a:pattern =~# '{[^{}]\+}' - let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1) - let found = map(split(pat, ',', 1), 'pre.v:val.post') - let results = [] - for pattern in found - call extend(results, pathogen#expand(pattern)) - endfor - elseif a:pattern =~# '{}' - let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)') - let post = a:pattern[strlen(pat) : -1] - let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post') - else - let results = [a:pattern] - endif - let vf = pathogen#slash() . 'vimfiles' - call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""') - return filter(results, '!empty(v:val)') -endfunction - -" \ on Windows unless shellslash is set, / everywhere else. -function! pathogen#slash() abort - return !exists("+shellslash") || &shellslash ? '/' : '\' -endfunction - -function! pathogen#separator() abort - return pathogen#slash() -endfunction - -" Convenience wrapper around glob() which returns a list. -function! pathogen#glob(pattern) abort - let files = split(glob(a:pattern),"\n") - return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")') -endfunction - -" Like pathogen#glob(), only limit the results to directories. -function! pathogen#glob_directories(pattern) abort - return filter(pathogen#glob(a:pattern),'isdirectory(v:val)') -endfunction - -" Remove duplicates from a list. -function! pathogen#uniq(list) abort - let i = 0 - let seen = {} - while i < len(a:list) - if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i]) - call remove(a:list,i) - elseif a:list[i] ==# '' - let i += 1 - let empty = 1 - else - let seen[a:list[i]] = 1 - let i += 1 - endif - endwhile - return a:list -endfunction - -" Backport of fnameescape(). -function! pathogen#fnameescape(string) abort - if exists('*fnameescape') - return fnameescape(a:string) - elseif a:string ==# '-' - return '\-' - else - return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') - endif -endfunction - -" Like findfile(), but hardcoded to use the runtimepath. -function! pathogen#runtime_findfile(file,count) abort - let rtp = pathogen#join(1,pathogen#split(&rtp)) - let file = findfile(a:file,rtp,a:count) - if file ==# '' - return '' - else - return fnamemodify(file,':p') - endif -endfunction - -" Section: Deprecated - -function! s:warn(msg) abort - echohl WarningMsg - echomsg a:msg - echohl NONE -endfunction - -" Prepend all subdirectories of path to the rtp, and append all 'after' -" directories in those subdirectories. Deprecated. -function! pathogen#runtime_prepend_subdirectories(path) abort - call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')') - return pathogen#surround(a:path . pathogen#slash() . '{}') -endfunction - -function! pathogen#incubate(...) abort - let name = a:0 ? a:1 : 'bundle/{}' - call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')') - return pathogen#interpose(name) -endfunction - -" Deprecated alias for pathogen#interpose(). -function! pathogen#runtime_append_all_bundles(...) abort - if a:0 - call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')') - else - call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') - endif - return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') -endfunction - -if exists(':Vedit') - finish -endif - -let s:vopen_warning = 0 - -function! s:find(count,cmd,file,lcd) - let rtp = pathogen#join(1,pathogen#split(&runtimepath)) - let file = pathogen#runtime_findfile(a:file,a:count) - if file ==# '' - return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" - endif - if !s:vopen_warning - let s:vopen_warning = 1 - let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' - else - let warning = '' - endif - if a:lcd - let path = file[0:-strlen(a:file)-2] - execute 'lcd `=path`' - return a:cmd.' '.pathogen#fnameescape(a:file) . warning - else - return a:cmd.' '.pathogen#fnameescape(file) . warning - endif -endfunction - -function! s:Findcomplete(A,L,P) - let sep = pathogen#slash() - let cheats = { - \'a': 'autoload', - \'d': 'doc', - \'f': 'ftplugin', - \'i': 'indent', - \'p': 'plugin', - \'s': 'syntax'} - if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) - let request = cheats[a:A[0]].a:A[1:-1] - else - let request = a:A - endif - let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' - let found = {} - for path in pathogen#split(&runtimepath) - let path = expand(path, ':p') - let matches = split(glob(path.sep.pattern),"\n") - call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') - call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') - for match in matches - let found[match] = 1 - endfor - endfor - return sort(keys(found)) -endfunction - -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1) - -" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': diff --git a/qusal/dotfiles/files/vim/.config/vim/after/colors/tango2.vim b/qusal/dotfiles/files/vim/.config/vim/after/colors/tango2.vim deleted file mode 100644 index be745ed..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/colors/tango2.vim +++ /dev/null @@ -1,64 +0,0 @@ -" ============================================================================= -" Name: Tango2 -" Purpose: Another colour scheme using the Tango colour palette -" Maintainer: Pranesh Srinivasan -" Last Modified: Saturday 04 October 2008 02:06:26 AM IST -" SPDX-FileCopyrightText: 2008 Pranesh Srinivasan -" SPDX-License-Identifier: Vim -" ============================================================================= - -" Inspired from some Gnome renditions of the Tango colour scheme. - -" ============================================================================= -" Preamble -" ============================================================================= - -set background=dark - -hi clear - -if exists("syntax-on") -syntax reset -endif - -let colors_name = "tango2" - -" ============================================================================= -" Vim >= 7.0 specific colours -" ============================================================================= - -if version >= 700 -" No support for cursor line yet -" hi CursorLine term=underline cterm=underline guibg=#111133 -" hi CursorColoumn -" hi MatchParen -" hi Pmenu -" hi PmenuSel -endif - -" ============================================================================= -" General colours -" ============================================================================= - -hi Normal guibg=#2E3436 guifg=#eeeeec -hi Cursor gui=none guibg=White guifg=Black - -hi Folded guibg=#4D585B guibg=#d2d2d2 -" No fold column support yet -" hi FoldColumn guifg=Orange guibg=DarkBlue -" ============================================================================= -" Syntax highlighting -" ============================================================================= - -hi Comment gui=italic guifg=#6d7e8a ctermfg=Grey -hi Todo term=bold guifg=#EBC450 -hi Constant guifg=#8ae234 -hi Type guifg=#8AE234 -hi Function gui=bold guifg=#9BCF8D -hi Statement guifg=#729FCF -hi Identifier guifg=#AD7FA8 -hi PreProc guifg=#e9ba6e -hi Special term=underline guifg=#5EAFE5 - -hi Search guibg=#81ABBD -" hi QtClass guifg=Orange ctermfg=LightBlue diff --git a/qusal/dotfiles/files/vim/.config/vim/after/colors/torte.vim b/qusal/dotfiles/files/vim/.config/vim/after/colors/torte.vim deleted file mode 100644 index 8ad281d..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/colors/torte.vim +++ /dev/null @@ -1,52 +0,0 @@ -" Vim color file -" Maintainer: Thorsten Maerz <info@netztorte.de> -" Last Change: 2001 Jul 23 -" grey on black -" optimized for TFT panels -" $Revision: 1.1 $ -" SPDX-FileCopyrightText: 2001 Thorsten Maerz <info@netztorte.de> -" SPDX-License-Identifier: Vim - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -"colorscheme default -let g:colors_name = "torte" - -" hardcoded colors : -" GUI Comment : #80a0ff = Light blue - -" GUI -highlight Normal guifg=Grey80 guibg=Black -highlight Search guifg=Black guibg=Red gui=bold -highlight Visual guifg=Grey25 gui=bold -highlight Cursor guifg=Black guibg=Green gui=bold -highlight Special guifg=Orange -highlight Comment guifg=#80a0ff -highlight StatusLine guifg=blue guibg=white -highlight Statement guifg=Yellow gui=NONE -highlight Type gui=NONE - -" Console -highlight Normal ctermfg=LightGrey ctermbg=Black -highlight Search ctermfg=Black ctermbg=Red cterm=NONE -highlight Visual cterm=reverse -highlight Cursor ctermfg=Black ctermbg=Green cterm=bold -highlight Special ctermfg=Brown -highlight Comment ctermfg=Blue -highlight StatusLine ctermfg=blue ctermbg=white -highlight Statement ctermfg=Yellow cterm=NONE -highlight Type cterm=NONE - -" only for vim 5 -if has("unix") - if v:version<600 - highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE - highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold - highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold - highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE - highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE - endif -endif diff --git a/qusal/dotfiles/files/vim/.config/vim/after/colors/vividchalk.vim b/qusal/dotfiles/files/vim/.config/vim/after/colors/vividchalk.vim deleted file mode 100644 index df92f27..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/colors/vividchalk.vim +++ /dev/null @@ -1,193 +0,0 @@ -" Vim color scheme -" Name: vividchalk.vim -" Author: Tim Pope <vimNOSPAM@tpope.info> -" Version: 2.0 -" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim -" SPDX-FileCopyrightText: 2023 Tim Pope <https://tpo.pe> -" SPDX-License-Identifier: Vim - -" Based on the Vibrank Ink theme for TextMate -" Distributable under the same terms as Vim itself (see :help license) - -if has("gui_running") - set background=dark -endif -hi clear -if exists("syntax_on") - syntax reset -endif - -let colors_name = "vividchalk" - -" First two functions adapted from inkpot.vim - -" map a urxvt cube number to an xterm-256 cube number -fun! s:M(a) - return strpart("0245", a:a, 1) + 0 -endfun - -" map a urxvt colour to an xterm-256 colour -fun! s:X(a) - if &t_Co == 88 - return a:a - else - if a:a == 8 - return 237 - elseif a:a < 16 - return a:a - elseif a:a > 79 - return 232 + (3 * (a:a - 80)) - else - let l:b = a:a - 16 - let l:x = l:b % 4 - let l:y = (l:b / 4) % 4 - let l:z = (l:b / 16) - return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z)) - endif - endif -endfun - -function! E2T(a) - return s:X(a:a) -endfunction - -function! s:choose(mediocre,good) - if &t_Co != 88 && &t_Co != 256 - return a:mediocre - else - return s:X(a:good) - endif -endfunction - -function! s:hifg(group,guifg,first,second,...) - if a:0 && &t_Co == 256 - let ctermfg = a:1 - else - let ctermfg = s:choose(a:first,a:second) - endif - exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg -endfunction - -function! s:hibg(group,guibg,first,second) - let ctermbg = s:choose(a:first,a:second) - exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg -endfunction - -hi link railsMethod PreProc -hi link rubyDefine Keyword -hi link rubySymbol Constant -hi link rubyAccess rubyMethod -hi link rubyAttribute rubyMethod -hi link rubyEval rubyMethod -hi link rubyException rubyMethod -hi link rubyInclude rubyMethod -hi link rubyStringDelimiter rubyString -hi link rubyRegexp Regexp -hi link rubyRegexpDelimiter rubyRegexp -"hi link rubyConstant Variable -"hi link rubyGlobalVariable Variable -"hi link rubyClassVariable Variable -"hi link rubyInstanceVariable Variable -hi link javascriptRegexpString Regexp -hi link javascriptNumber Number -hi link javascriptNull Constant -highlight link diffAdded String -highlight link diffRemoved Statement -highlight link diffLine PreProc -highlight link diffSubname Comment - -call s:hifg("Normal","#EEEEEE","White",87) -if &background == "light" || has("gui_running") - hi Normal guibg=Black ctermbg=Black -else - hi Normal guibg=Black ctermbg=NONE -endif -highlight StatusLine guifg=Black guibg=#aabbee gui=bold ctermfg=232 ctermbg=15 cterm=bold -highlight StatusLineNC guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey cterm=none -"if &t_Co == 256 - "highlight StatusLine ctermbg=117 -"else - "highlight StatusLine ctermbg=43 -"endif - -highlight Ignore ctermfg=Black -highlight WildMenu guifg=Black guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold -highlight Cursor guifg=Black guibg=White ctermfg=Black ctermbg=White -highlight CursorLine guibg=#333333 guifg=NONE -highlight CursorColumn guibg=#333333 guifg=NONE -highlight NonText guifg=#404040 ctermfg=8 -highlight SpecialKey guifg=#404040 ctermfg=8 -highlight Directory none -high link Directory Identifier -highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE -highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none -call s:hibg("Search" ,"#555555","DarkBlue",81) -highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black -highlight MoreMsg guifg=#00AA00 ctermfg=Green -highlight LineNr guifg=#DDEEFF ctermfg=White -call s:hibg("LineNr" ,"#222222","DarkBlue",80) -highlight Question none -high link Question MoreMsg -highlight Title guifg=Magenta ctermfg=Magenta -highlight VisualNOS gui=none cterm=none -call s:hibg("Visual" ,"#555577","LightBlue",83) -call s:hibg("VisualNOS" ,"#444444","DarkBlue",81) -call s:hibg("MatchParen","#1100AA","DarkBlue",18) -highlight WarningMsg guifg=Red ctermfg=Red -highlight Error ctermbg=DarkRed -highlight SpellBad ctermbg=DarkRed -" FIXME: Comments -highlight SpellRare ctermbg=DarkMagenta -highlight SpellCap ctermbg=DarkBlue -highlight SpellLocal ctermbg=DarkCyan - -call s:hibg("Folded" ,"#110077","DarkBlue",17) -call s:hifg("Folded" ,"#aaddee","LightCyan",63) -highlight FoldColumn none -high link FoldColumn Folded -highlight DiffAdd ctermbg=4 guibg=DarkBlue -highlight DiffChange ctermbg=5 guibg=DarkMagenta -highlight DiffDelete ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan -highlight DiffText ctermbg=DarkRed -highlight DiffText cterm=bold ctermbg=9 gui=bold guibg=Red - -highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold -highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold -call s:hibg("Pmenu" ,"#000099","Blue",18) -call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39) -highlight PmenuSbar guibg=Grey ctermbg=Grey -highlight PmenuThumb guibg=White ctermbg=White -highlight TabLine gui=underline cterm=underline -call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85) -call s:hibg("TabLine" ,"#333333","DarkGrey",80) -highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black -highlight TabLineFill gui=underline cterm=underline -call s:hifg("TabLineFill","#bbbbbb","LightGrey",85) -call s:hibg("TabLineFill","#808080","Grey",83) - -hi Type gui=none -hi Statement gui=none -if !has("gui_mac") - " Mac GUI degrades italics to ugly underlining. - hi Comment gui=italic - hi railsUserClass gui=italic - hi railsUserMethod gui=italic -endif -hi Identifier cterm=none -" Commented numbers at the end are *old* 256 color values -"highlight PreProc guifg=#EDF8F9 -call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92 -" 26 instead? -call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30 -call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190 -call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82 -call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220 -call s:hifg("Statement" ,"#FF6600","Brown",68) " 202 -call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213 -call s:hifg("railsUserMethod","#AACCFF","LightCyan",27) -call s:hifg("Type" ,"#AAAA77","Grey",57) " 101 -call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101 -call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7 -call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74 -call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191 -"highlight railsMethod guifg=#EE1122 ctermfg=1 diff --git a/qusal/dotfiles/files/vim/.config/vim/after/ftdetect/.gitignore b/qusal/dotfiles/files/vim/.config/vim/after/ftdetect/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/qusal/dotfiles/files/vim/.config/vim/after/ftplugin/markdown.vim b/qusal/dotfiles/files/vim/.config/vim/after/ftplugin/markdown.vim deleted file mode 100644 index 5ae43a3..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/ftplugin/markdown.vim +++ /dev/null @@ -1,36 +0,0 @@ -" Author: Maxim Kim -" Credits: https://vi.stackexchange.com/a/21689 -" SPDX-FileCopyrightText: 2021 Maxim Kim -" SPDX-License-Identifier: Vim - -function! MarkdownFold() - let line = getline(v:lnum) - - " Regular headers - let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=') - if depth > 0 - " check syntax, it should be markdownH1-6 - let syncode = synstack(v:lnum, 1) - if len(syncode) > 0 && synIDattr(syncode[0], 'name') =~ 'markdownH[1-6]' - return ">" . depth - endif - endif - - " Setext style headings - let prevline = getline(v:lnum - 1) - let nextline = getline(v:lnum + 1) - if (line =~ '^.\+$') && (nextline =~ '^=\+$') && (prevline =~ '^\s*$') - return ">1" - endif - - if (line =~ '^.\+$') && (nextline =~ '^-\+$') && (prevline =~ '^\s*$') - return ">2" - endif - - " frontmatter - if (v:lnum == 1) && (line =~ '^----*$') - return ">1" - endif - - return "=" -endfunction diff --git a/qusal/dotfiles/files/vim/.config/vim/after/indent/.gitignore b/qusal/dotfiles/files/vim/.config/vim/after/indent/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/qusal/dotfiles/files/vim/.config/vim/after/macros/less.vim b/qusal/dotfiles/files/vim/.config/vim/after/macros/less.vim deleted file mode 100644 index 70d91da..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/macros/less.vim +++ /dev/null @@ -1,4 +0,0 @@ -" SPDX-FileCopyrightText: 2023 Tim Pope <https://tpo.pe> -" SPDX-License-Identifier: Vim -set cmdheight=1 -set laststatus=0 diff --git a/qusal/dotfiles/files/vim/.config/vim/after/plugin/cool.vim b/qusal/dotfiles/files/vim/.config/vim/after/plugin/cool.vim deleted file mode 100644 index 7326065..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/plugin/cool.vim +++ /dev/null @@ -1,130 +0,0 @@ -" vim-cool - Disable hlsearch when you are done searching. -" Maintainer: romainl <romainlafourcade@gmail.com> -" Version: 0.0.2 -" License: Vim -" Location: plugin/cool.vim -" Website: https://github.com/romainl/vim-cool -" SPDX-FileCopyrightText: 2023 romainl <romainlafourcade@gmail.com> -" SPDX-License-Identifier: Vim - -if exists("g:loaded_cool") || v:version < 704 || &compatible - finish -endif -let g:loaded_cool = 1 - -let s:save_cpo = &cpo -set cpo&vim - -augroup Cool - autocmd! -augroup END - -if exists('##OptionSet') - if !exists('*execute') - autocmd Cool OptionSet highlight let <SID>saveh = &highlight - endif - " toggle coolness when hlsearch is toggled - autocmd Cool OptionSet hlsearch call <SID>PlayItCool(v:option_old, v:option_new) -endif - -function! s:StartHL() - if !v:hlsearch || mode() isnot 'n' - return - endif - let g:cool_is_searching = 1 - let [pos, rpos] = [winsaveview(), getpos('.')] - silent! exe "keepjumps go".(line2byte('.')+col('.')-(v:searchforward ? 2 : 0)) - try - silent keepjumps norm! n - if getpos('.') != rpos - throw 0 - endif - catch /^\%(0$\|Vim\%(\w\|:Interrupt$\)\@!\)/ - call <SID>StopHL() - return - finally - call winrestview(pos) - endtry - if !get(g:,'cool_total_matches') || !exists('*reltimestr') - return - endif - exe "silent! norm! :let g:cool_char=nr2char(screenchar(screenrow(),1))\<cr>" - let cool_char = remove(g:,'cool_char') - if cool_char !~ '[/?]' - return - endif - let [f, ws, now, noOf] = [0, &wrapscan, reltime(), [0,0]] - set nowrapscan - try - while f < 2 - if reltimestr(reltime(now))[:-6] =~ '[1-9]' - " time >= 100ms - return - endif - let noOf[v:searchforward ? f : !f] += 1 - try - silent exe "keepjumps norm! ".(f ? 'n' : 'N') - catch /^Vim[^)]\+):E38[45]\D/ - call setpos('.',rpos) - let f += 1 - endtry - endwhile - finally - call winrestview(pos) - let &wrapscan = ws - endtry - redraw|echo cool_char.@/ 'match' noOf[0] 'of' noOf[0] + noOf[1] - 1 -endfunction - -function! s:StopHL() - if !v:hlsearch || mode() isnot 'n' || &buftype == 'terminal' - return - else - let g:cool_is_searching = 0 - silent call feedkeys("\<Plug>(StopHL)", 'm') - endif -endfunction - -if !exists('*execute') - let s:saveh = &highlight - " toggle highlighting, a workaround for :nohlsearch in autocmds - function! s:AuNohlsearch() - noautocmd set highlight+=l:- - autocmd Cool Insertleave * - \ noautocmd let &highlight = s:saveh | autocmd! Cool InsertLeave * - return '' - endfunction -endif - -function! s:PlayItCool(old, new) - if a:old == 0 && a:new == 1 - " nohls --> hls - " set up coolness - noremap <silent> <Plug>(StopHL) :<C-U>nohlsearch<cr> - if !exists('*execute') - noremap! <expr> <Plug>(StopHL) <SID>AuNohlsearch() - else - noremap! <expr> <Plug>(StopHL) execute('nohlsearch')[-1] - endif - - autocmd Cool CursorMoved * call <SID>StartHL() - autocmd Cool InsertEnter * call <SID>StopHL() - elseif a:old == 1 && a:new == 0 - " hls --> nohls - " tear down coolness - nunmap <Plug>(StopHL) - unmap! <expr> <Plug>(StopHL) - - autocmd! Cool CursorMoved - autocmd! Cool InsertEnter - else - " nohls --> nohls - " do nothing - return - endif -endfunction - -" play it cool -call <SID>PlayItCool(0, &hlsearch) - -let &cpo = s:save_cpo diff --git a/qusal/dotfiles/files/vim/.config/vim/after/plugin/lastplace.vim b/qusal/dotfiles/files/vim/.config/vim/after/plugin/lastplace.vim deleted file mode 100644 index 4a03e2d..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/plugin/lastplace.vim +++ /dev/null @@ -1,51 +0,0 @@ -" ============================================================================ -" File: vim-lastplace.vim -" Description: Reopen files where you left off. Configurable. -" Author: Greg Dietsche <vim@gregd.org> -" Licence: MIT -" Website: http://www.gregd.org/ -" Version: 3.0.0 -" SPDX-FileCopyrightText: 2023 Greg Dietsche <vim@gregd.org> -" SPDX-License-Identifier: Vim -" ============================================================================ - -if exists("b:loaded_lastplace_plugin") || &cp - finish -endif -let b:loaded_lastplace_plugin = 1 - -scriptencoding utf-8 - -if !exists('g:lastplace_ignore') - let g:lastplace_ignore = "gitcommit,gitrebase,svn,hgcommit" -endif - -fu! s:lastplace() - if index(split(g:lastplace_ignore, ","), &filetype) == -1 - if line("'\"") > 0 && line("'\"") <= line("$") - if line("$") - line("'\"") > ((line("w$") - line("w0")) / 2) - 1 - "if we're not at the bottom of the file, center the - "cursor on the screen after we make the jump - execute "normal! g`\"zz" - else - "otherwise, show as much context as we can by jumping - "to the end of the file and then to the mark. If we - "pressed zz here, there would be blank lines at the - "bottom of the screen. We intentionally leave the - "last line blank by pressing <c-e> so the user has a - "clue that they are near the end of the file. - " execute "normal! \G`\"\<c-e>" - execute "normal! \G`\"" - endif - endif - if foldclosed(".") != -1 - "if we're in a fold, make the current line visible - execute "normal! zv" - endif - endif -endf - -augroup lastplace_plugin - autocmd! - autocmd BufReadPost * call s:lastplace() -augroup END diff --git a/qusal/dotfiles/files/vim/.config/vim/after/plugin/update-time.vim b/qusal/dotfiles/files/vim/.config/vim/after/plugin/update-time.vim deleted file mode 100644 index 8d9d984..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/after/plugin/update-time.vim +++ /dev/null @@ -1,82 +0,0 @@ -" File: update-time.vim -" Author: QianChenglong <qianchenglong2012@gmail.com> -" Create Time: 2013-12-04 19:36:21 CST -" Last Change: 2023 Oct 21 -" Description: Automatic update Last Change time -" SPDX-FileCopyrightText: 2013 QianChenglong <qianchenglong2012@gmail.com> -" SPDX-License-Identifier: Vim - -if exists("g:loaded_update_time") - finish -endif -let g:loaded_update_time = 1 - -let s:save_cpo = &cpo -set cpo&vim - -if !exists('g:update_time_time_stamp_leader') - let s:time_stamp_leader = 'Last Change: ' -else - let s:time_stamp_leader = g:update_time_time_stamp_leader -endif - -if !exists('g:update_time_time_format') - let s:time_format = '%Y-%m-%d %H:%M:%S %Z' -else - let s:time_format = g:update_time_time_format -endif - -if !exists("g:update_time_begin_line") - let s:begin_line = 0 -else - let s:begin_line = g:update_time_begin_line -endif - -if !exists('g:update_time_end_line') - let s:end_line = 10 -else - let s:end_line = g:update_time_end_line -endif - -if !exists('g:update_time_enable') - let s:update_time_enable = 1 -else - let s:update_time_enable = g:update_time_enable -endif -"}}} -" SECTION: Funtions"{{{ -fun Update_time_update() - if ! &modifiable - return - endif - if ! s:update_time_enable - return - endif - let bufmodified = getbufvar('%', '&mod') - if ! bufmodified - return - endif - let pos = line('.').' | normal! '.virtcol('.').'|' - if pos == 1 - return - endif - exe s:begin_line - let line_num = search(s:time_stamp_leader, '', s:end_line) - if line_num > 0 - let line = getline(line_num) - let line = substitute(line, s:time_stamp_leader . '\zs.*', ' ' . strftime(s:time_format), '') - call setline(line_num, line) - endif - exe pos -endf - -fun Update_time_toggle() - let s:update_time_enable = !s:update_time_enable -endf - -com! -nargs=0 UpdateTimeToggle silent call Update_time_toggle() - -autocmd BufWritePre * silent call Update_time_update() - -let &cpo = s:save_cpo -unlet s:save_cpo diff --git a/qusal/dotfiles/files/vim/.config/vim/after/syntax/.gitignore b/qusal/dotfiles/files/vim/.config/vim/after/syntax/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftdetect/jinja.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftdetect/jinja.vim deleted file mode 100644 index 7ebeb10..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftdetect/jinja.vim +++ /dev/null @@ -1,22 +0,0 @@ -" Credits: https://github.com/lepture/vim-jinja/blob/master/ftdetect/jinja.vim -" SPDX-FileCopyrightText: 2020 Lepture <https://github.com/lepture> -" SPDX-License-Identifier: Vim - -" Figure out which type of hilighting to use for html. -function! s:SelectHTML() - let n = 1 - while n < 50 && n <= line("$") - " check for jinja - if getline(n) =~ '{{.*}}\|{%-\?\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\>' - setfiletype jinja.html - return - endif - let n = n + 1 - endwhile -endfunction - -autocmd BufNewFile,BufRead *.{html,htm,nunjucks,nunjs,njk} - \ call s:SelectHTML() - -autocmd BufNewFile,BufRead *.{jinja,jinja2,j2,tera} - \ setfiletype jinja diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftplugin/jinja.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftplugin/jinja.vim deleted file mode 100644 index 8b46fce..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/ftplugin/jinja.vim +++ /dev/null @@ -1,22 +0,0 @@ -" Credits: https://github.com/Glench/Vim-Jinja2-Syntax/blob/master/ftplugin/jinja.vim -" SPDX-FileCopyrightText: 2020 Glench <https://github.com/Glench> -" SPDX-License-Identifier: Vim - -if exists('b:did_ftplugin') - finish -endif - -" Setup matchit. -if exists('loaded_matchit') - let b:match_ignorecase = 1 - let b:match_skip = 's:Comment' - " From ftplugin/html.vim, plus block tag matching. - " With block tags the following is optional: - " - "+": disable the lstrip_blocks (only at start) - " - "-": the whitespaces before or after that block will be removed - let b:match_words = '<:>,' . - \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . - \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . - \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' . - \ '{%[-+]\? *\%(end\)\@!\(\w\+\)\>.\{-}%}:{%-\? *end\1\>.\{-}%}' -endif diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/syntax/jinja.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/syntax/jinja.vim deleted file mode 100644 index effee1e..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-jinja/syntax/jinja.vim +++ /dev/null @@ -1,126 +0,0 @@ -" Vim syntax file -" Language: Jinja template -" Maintainer: Armin Ronacher <armin.ronacher@active-4.com> -" Last Change: 2023 Oct 21 -" Version: 1.1 -" Credits: https://github.com/Glench/Vim-Jinja2-Syntax/blob/master/syntax/jinja.vim -" SPDX-FileCopyrightText: 2020 Armin Ronacher <armin.ronacher@active-4.com> -" SPDX-License-Identifier: Vim - -if exists("b:current_syntax") - finish -endif - -if !exists('g:jinja_syntax_html') - let g:jinja_syntax_html=1 -endif - -if !exists("main_syntax") - let main_syntax = 'jinja' -endif - -" Pull in the HTML syntax. -if g:jinja_syntax_html - let ext = expand('%:e') - if ext !~ 'htm\|nunj|jinja\|j2' && - \ findfile(ext . '.vim', $VIMRUNTIME . '/syntax') != '' - execute 'runtime! syntax/' . ext . '.vim' - else - runtime! syntax/html.vim - endif - unlet b:current_syntax -endif - -syn case match -syn sync minlines=10 - -" Jinja template built-in tags and parameters (without filter, macro, is and -" raw, they have special treatment) -syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import - -syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter -syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction -syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName - -" Variable Names -syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs - -" Filters -syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter -syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/ - -" Jinja template constants -syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/ -syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/ -syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/ - -" Operators -syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/ -syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/ -syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute -syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/ - -" Jinja template tag and variable blocks -syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%[-+]\?/ end=/[-+]\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment - -syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,yamlComment,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment - -" Jinja template 'raw' tag -syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment - -" Mark illegal characters within tag and variables blocks -syn match jinjaTagError contained "#}\|{{\|[^%]}}\|[&#]" -syn match jinjaVarError contained "#}\|{%\|%}\|[<>!&#%]" - -" Block start keywords. A bit tricker. We only highlight at the start of a -" tag block and only if the name is not followed by a comma or equals sign -" which usually means that we have to deal with an assignment. -syn match jinjaStatement containedin=jinjaTagBlock contained /\({%[-+]\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/ - -" and context modifiers -syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/ - -" Keywords to highlight within comments -syn keyword jinjaTodo contained TODO FIXME XXX -syn cluster jinjaBlocks add=jinjaTagBlock,jinjaVarBlock,jinjaCommentBlock - -" Jinja comments -syn region jinjaComment display oneline matchgroup=jinjaCommentDelim containedin=@jinjaCommentDelim start='\%\(^\|\s\)#' end='$' -syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString contains=jinjaComment keepend extend - -" Define the default highlighting. -hi def link jinjaPunctuation jinjaOperator -hi def link jinjaAttribute jinjaVariable -hi def link jinjaFunction jinjaFilter - -hi def link jinjaTagDelim jinjaTagBlock -hi def link jinjaVarDelim jinjaVarBlock -hi def link jinjaCommentDelim jinjaComment -hi def link jinjaCommentBlock jinjaComment -hi def link jinjaCommentLine jinjaComment -hi def link jinjaRawDelim jinja - -hi def link jinjaSpecial Special -hi def link jinjaOperator Normal -hi def link jinjaRaw Normal -hi def link jinjaTagBlock PreProc -hi def link jinjaVarBlock PreProc -hi def link jinjaStatement Statement -hi def link jinjaFilter Function -hi def link jinjaBlockName Function -hi def link jinjaVariable Identifier -hi def link jinjaString Constant -hi def link jinjaNumber Constant -hi def link jinjaComment Comment - -let b:current_syntax = "jinja" - -if main_syntax ==# 'jinja' - unlet main_syntax -endif diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftdetect/salt.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftdetect/salt.vim deleted file mode 100644 index 8ec50cd..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftdetect/salt.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Credits: https://github.com/vmware-archive/salt-vim/blob/master/ftdetect/sls.vim -" SPDX-FileCopyrightText: 2020 Seth House <seth@eseth.com> -" SPDX-License-Identifier: Vim - -function! DetectSalt() - if !did_filetype() - if match(getline(1), '^#!py') > -1 - setfiletype python - else - setfiletype salt - endif - endif -endfunction - -autocmd BufNewFile,BufRead *.{sls,top},Saltfile,/etc/salt/* - \ call DetectSalt() diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftplugin/salt.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftplugin/salt.vim deleted file mode 100644 index bbec2e2..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/ftplugin/salt.vim +++ /dev/null @@ -1,29 +0,0 @@ -" Vim filetype plugin file -" Language: YAML (YAML Ain't Markup Language) -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive) -" Last Change: 2023 Oct 21 -" SPDX-FileCopyrightText: 2020 Nikolai Weibull <now@bitwi.se> -" SPDX-License-Identifier: Vim - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl tw< com< cms< et< fo<" - -" https://salt-lint.readthedocs.io/en/latest/rules/formatting/#204 -setlocal textwidth=160 -setlocal comments=:# commentstring=#\ %s expandtab -setlocal formatoptions-=t formatoptions+=croql - -if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0 - let b:undo_ftplugin ..= " sw< ts< sts<" - setlocal shiftwidth=2 tabstop=2 softtabstop=2 -endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/indent/salt.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/indent/salt.vim deleted file mode 100644 index e0c2250..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/indent/salt.vim +++ /dev/null @@ -1,158 +0,0 @@ -" Vim indent file -" Language: YAML -" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com> -" Last Update: Lukas Reineke -" Last Change: 2021 Jan 19 -" SPDX-FileCopyrightText: 2021 Nikolai Pavlov <zyx.vim@gmail.com> -" SPDX-License-Identifier: Vim - -" Only load this indent file when no other was loaded. -if exists('b:did_indent') - finish -endif - -let b:did_indent = 1 - -setlocal indentexpr=GetYAMLIndent(v:lnum) -setlocal indentkeys=!^F,o,O,0#,0},0],<:>,0- -setlocal nosmartindent - -let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<' - -" Only define the function once. -if exists('*GetYAMLIndent') - finish -endif - -let s:save_cpo = &cpo -set cpo&vim - -function s:FindPrevLessIndentedLine(lnum, ...) - let prevlnum = prevnonblank(a:lnum-1) - let curindent = a:0 ? a:1 : indent(a:lnum) - while prevlnum - \&& indent(prevlnum) >= curindent - \&& getline(prevlnum) !~# '^\s*#' - let prevlnum = prevnonblank(prevlnum-1) - endwhile - return prevlnum -endfunction - -function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) - let plilnum = s:FindPrevLessIndentedLine(a:lnum, indent(a:lnum)+1) - while plilnum && getline(plilnum) !~# a:regex - let plilnum = s:FindPrevLessIndentedLine(plilnum) - endwhile - return plilnum -endfunction - -let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''. - \ '|\"%([^"\\]|\\.)*\"'. - \ '|%(%(\:\ )@!.)*)\:%(\ |$)' -let s:liststartregex='\v^\s*%(\-%(\ |$))' - -let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)' -let s:c_ns_anchor_name = s:c_ns_anchor_char.'+' -let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name - -let s:ns_word_char = '\v[[:alnum:]_\-]' -let s:ns_tag_char = '\v%('.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' -let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!' -let s:c_secondary_tag_handle = '\v\!\!' -let s:c_primary_tag_handle = '\v\!' -let s:c_tag_handle = '\v%('.s:c_named_tag_handle. - \ '|'.s:c_secondary_tag_handle. - \ '|'.s:c_primary_tag_handle.')' -let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+' -let s:c_non_specific_tag = '\v\!' -let s:ns_uri_char = '\v%('.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' -let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>' -let s:c_ns_tag_property = '\v'.s:c_verbatim_tag. - \ '\v|'.s:c_ns_shorthand_tag. - \ '\v|'.s:c_non_specific_tag - -let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?' - -function GetYAMLIndent(lnum) - if a:lnum == 1 || !prevnonblank(a:lnum-1) - return 0 - endif - - let prevlnum = prevnonblank(a:lnum-1) - let previndent = indent(prevlnum) - - let line = getline(a:lnum) - if line =~# '^\s*#' && getline(a:lnum-1) =~# '^\s*#' - " Comment blocks should have identical indent - return previndent - elseif line =~# '^\s*[\]}]' - " Lines containing only closing braces should have previous indent - return indent(s:FindPrevLessIndentedLine(a:lnum)) - endif - - " Ignore comment lines when calculating indent - while getline(prevlnum) =~# '^\s*#' - let prevlnum = prevnonblank(prevlnum-1) - if !prevlnum - return previndent - endif - endwhile - - let prevline = getline(prevlnum) - let previndent = indent(prevlnum) - - " Any examples below assume that shiftwidth=2 - if prevline =~# '\v[{[:]$|[:-]\ [|>][+\-]?%(\s+\#.*|\s*)$' - " Mapping key: - " nested mapping: ... - " - " - { - " key: [ - " list value - " ] - " } - " - " - |- - " Block scalar without indentation indicator - return previndent+shiftwidth() - elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$' - " - |+2 - " block scalar with indentation indicator - "#^^ indent+2, not indent+shiftwidth - return previndent + str2nr(matchstr(prevline, - \'\v([:-]\ [|>])@<=[+\-]?\d+%([+\-]?%(\s+\#.*|\s*)$)@=')) - elseif prevline =~# '\v\"%([^"\\]|\\.)*\\$' - " "Multiline string \ - " with escaped end" - let qidx = match(prevline, '\v\"%([^"\\]|\\.)*\\') - return virtcol([prevlnum, qidx+1]) - elseif line =~# s:liststartregex - " List line should have indent equal to previous list line unless it was - " caught by one of the previous rules - return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum, - \ s:liststartregex)) - elseif line =~# s:mapkeyregex - " Same for line containing mapping key - let prevmapline = s:FindPrevLEIndentedLineMatchingRegex(a:lnum, - \ s:mapkeyregex) - if getline(prevmapline) =~# '^\s*- ' - return indent(prevmapline) + 2 - else - return indent(prevmapline) - endif - elseif prevline =~# '^\s*- ' - " - List with - " multiline scalar - return previndent+2 - elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property. - \ '\v|'.s:c_ns_anchor_property. - \ '\v|'.s:block_scalar_header. - \ '\v)%(\s+|\s*%(\#.*)?$))*' - " Mapping with: value - " that is multiline scalar - return previndent+shiftwidth() - endif - return previndent -endfunction - -let &cpo = s:save_cpo diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/syntax/salt.vim b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/syntax/salt.vim deleted file mode 100644 index 288994b..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/syntax/salt.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Vim syntax file -" Language: Salt States template -" Maintainer: Seth House <seth@eseth.com> -" Last Change: 2023 Oct 21 -" Credits: https://github.com/vmware-archive/salt-vim/blob/master/syntax/sls.vim -" SPDX-FileCopyrightText: 2020 Seth House <seth@eseth.com> -" SPDX-License-Identifier: Vim - -if exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'yaml' -endif - -if exists('b:current_syntax') - let s:current_syntax=b:current_syntax - unlet b:current_syntax -endif - -runtime! syntax/yaml.vim -unlet b:current_syntax - -let s:jinja_path = findfile("syntax/jinja.vim", &rtp, 1) -if s:jinja_path != "" - runtime! syntax/jinja.vim - unlet b:current_syntax -else - runtime! syntax/django.vim - unlet b:current_syntax -endif - -if exists('b:current_syntax') - let s:current_syntax=b:current_syntax - unlet b:current_syntax -endif - -" TODO: fix yamlBlockMappingKey not working with {{ jinja_variable }} -" Example key that fails: key {{ variable }}: -" Get its value: syn list yamlBlockMappingKey -" syn match yamlBlockMappingKey /\%#=1\s*\zs\%([^\-?:,[\]{}#&*!|>'"%@`\n\r\uFEFF \t]\|[?:\-]\%([^\n\r\uFEFF \t]\)\@=\)\%([^\n\r\uFEFF \t]#\|:[^\n\r\uFEFF \t]\|[^\n\r\uFEFF \t:#]\)*\%(\s\+\%([^\-?:,[\]{}#&*!|>'"%@`\n\r\uFEFF \t]\|[?:\-]\%([^\n\r\uFEFF \t]\)\@=\)\%([^\n\r\uFEFF \t]#\|:[^\n\r\uFEFF \t]\|[^\n\r\uFEFF \t:#]\)*\)*\ze\s*:\%(\s\|$\)/ contained nextgroup=yamlKeyValueDelimiter - -" TODO: improve: keyword is not great when the key contains it: include-ab: -syn keyword saltInclude include extend containedin=yamlBlockMappingKey nextgroup=yamlKeyValueDelimiter contained - -syn keyword saltSpecialArgs name names check_cmd listen listen_in onchanges onchanges_in onfail onfail_in onlyif prereq prereq_in require require_in unless use use_in watch watch_in containedin=yamlBlockMappingKey nextgroup=yamlKeyValueDelimiter contained - -syn keyword saltErrors requires requires_in watches watches_in includes extends containedin=yamlBlockMappingKey contained - -hi def link saltInclude Include -hi def link saltSpecialArgs Special -hi def link saltErrors Error - -let b:current_syntax = "salt" diff --git a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/test/file.sls b/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/test/file.sls deleted file mode 100644 index 3ec2629..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/bundle/vim-salt/test/file.sls +++ /dev/null @@ -1,28 +0,0 @@ -{# -SPDX-FileCopyrightText: 2023 Qusal contributors - -SPDX-License-Identifier: Vim -#} - -{%- import "path/to/file.jinja" as tpl -%} - -include: - - test.file - -this-is-not-include: - - name: include should not be highlighted - -test-{{ tpl }}-test: - module.here: - - name: the jinja variable in the directive does not allow the rest of the key to be highlighted - -directive here: - module.here: - - require: - - sls: test.file - - name: tpl-test - - prefs: - - netvm: "" - - vpus: 1 - - memory: 400 - - autostart: False diff --git a/qusal/dotfiles/files/vim/.config/vim/vimrc b/qusal/dotfiles/files/vim/.config/vim/vimrc deleted file mode 100644 index 55d6e2d..0000000 --- a/qusal/dotfiles/files/vim/.config/vim/vimrc +++ /dev/null @@ -1,737 +0,0 @@ -" SPDX-FileCopyrightText: 2004 - 2023 Tim Pope <https://tpo.pe> -" SPDX-FileCopyrightText: 2023 Qusal contributors -" -" SPDX-License-Identifier: Vim -" -" Credits: https://github.com/tpope/dotfiles/blob/master/.vimrc - -" Section: Bootstrap - - -if v:version < 600 | finish | endif - -" Useful for when this configuration is in non-standard locations. -if empty($MYVIMRC) | let $MYVIMRC = expand('<sfile>:p') | endif - -if !get(v:, 'vim_did_enter', !has('vim_starting')) - if empty($CODE_HOME) - let $CODE_HOME = expand('$HOME/src') - endif - if empty($XDG_CONFIG_HOME) - let $XDG_CONFIG_HOME = expand('$HOME/.config') - endif - if empty($XDG_DATA_HOME) - let $XDG_DATA_HOME = expand('$HOME/.local/share') - endif - if empty($XDG_CACHE_HOME) - let $XDG_CACHE_HOME = expand('$HOME/.cache') - endif - if empty($XDG_STATE_HOME) - let $XDG_STATE_HOME = expand('$HOME/.local/state') - endif - filetype off - set runtimepath^=$XDG_CONFIG_HOME/vim - set runtimepath+=$XDG_CONFIG_HOME/vim/after - let g:netrw_home = $XDG_DATA_HOME . "/vim" - if has('packages') - let &packpath = &runtimepath - else - let s:rtp = [] - for s:dir in split(&runtimepath, ',') - if $VIMRUNTIME ==# s:dir - call add(s:rtp, s:dir) - elseif s:dir =~# 'after$' - call extend(s:rtp, [s:dir[0:-6] . 'pack/*/start/*/after', s:dir]) - else - call extend(s:rtp, [s:dir, s:dir . '/pack/*/start/*']) - endif - endfor - let &runtimepath = join(s:rtp, ',') - unlet! s:rtp s:dir - endif -endif - -if $VIM_BARE - setglobal noloadplugins - finish -endif - -setglobal nocompatible -setglobal pastetoggle=<F2> - -" Fix Vim on XTerm to avoid raw-terminal-mode -let &t_TI="" -let &t_TE="" - -filetype plugin indent on -" vint: -ProhibitAutocmdWithNoGroup -exe 'augroup my' -autocmd! - - -" Section: Moving around, searching, patterns, and tags - -setglobal startofline -setglobal shortmess-=S -setglobal cpoptions+=J -if has('vim_starting') - setglobal noignorecase -endif -setglobal smartcase -setglobal incsearch -setglobal hlsearch -setglobal tags=./tags; -setglobal include= -setglobal path=.,, - -autocmd FileType c,cpp setlocal path+=/usr/include include& -autocmd FileType sh,zsh,csh,tcsh - \ setlocal include=^\\s*\\%(\\.\\\|source\\)\\s | - \ let &l:path = $PATH . ',.' -autocmd FileType lua - \ if expand('%:p') =~# '/awesome/' | - \ let &l:path = expand('~/.config/awesome') . ',/etc/xdg/awesome,/usr/share/awesome/lib,' . &l:path | - \ endif -autocmd FileType ruby setlocal tags-=./tags; - - -" Section: Displaying text - -if has('vim_starting') && exists('+breakindent') - setglobal breakindent showbreak=\ + -endif -setglobal modelineexpr -setglobal display=lastline -setglobal scrolloff=1 -setglobal sidescrolloff=5 -setglobal lazyredraw -if (&termencoding ==# 'utf-8' || &encoding ==# 'utf-8') && v:version >= 700 - let &g:listchars = "tab:\u21e5\u00b7,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u00b7" - let &g:fillchars = "vert:\u250b,fold:\u00b7" -else - setglobal listchars=tab:>\ ,trail:-,extends:>,precedes:< -endif - - -" Section: Windows - -setglobal laststatus=2 -setglobal showtabline=2 - -if empty(&g:statusline) - setglobal statusline=[%n]\ %<%.99f - setglobal statusline+=\ %y%h%w%m%r - if exists('*FugitiveStatusline') - setglobal statusline+=%{FugitiveStatusline()} - endif - setglobal statusline+=%=%-14.(%l,%c%V%) - setglobal statusline+=\ %P -endif - -setglobal titlestring=%{v:progname}\ %{tolower(empty(v:servername)?'':'--servername\ '.v:servername.'\ ')}%{fnamemodify(getcwd(),':~')}%{exists('$SSH_TTY')?'\ <'.hostname().'>':''} -setglobal iconstring=%{tolower(empty(v:servername)?v:progname\ :\ v:servername)}%{exists('$SSH_TTY')?'@'.hostname():''} - -if has('vim_starting') - setglobal nohidden -endif - -autocmd SourcePre */macros/less.vim setglobal laststatus=0 showtabline=0 - - -" Section: GUI - -setglobal printoptions=paper:letter -setglobal mousemodel=popup -if $TERM =~# '^screen' - if exists('+ttymouse') && &ttymouse ==# '' - setglobal ttymouse=sgr - endif -endif - -if !has('gui_running') && empty($DISPLAY) || !has('gui') - " Mouse in insert mode puts some weird characters to the file. - setglobal mouse=nv -else - setglobal mouse=nvi -endif -if exists('+macmeta') - setglobal macmeta -endif -setglobal winaltkeys=no - -function! s:font() - if has('mac') - return 'Monaco:h14' - else - return 'Monospace 14' - endif -endfunction - -autocmd VimEnter * if !has('gui_running') | set noicon background=dark | endif -autocmd GUIEnter * set background=light icon guioptions-=T guioptions-=m guioptions-=e guioptions-=r guioptions-=L -autocmd GUIEnter * silent! colorscheme vividchalk -autocmd GUIEnter * let &g:guifont = substitute(&g:guifont, '^$', s:font(), '') -autocmd FocusLost * let s:confirm = &confirm | setglobal noconfirm | silent! wall | let &confirm = s:confirm - - -" Section: Messages and info - -setglobal confirm -setglobal showcmd -setglobal belloff=all - - -" Section: Editing text and indent - -setglobal backspace=2 -setglobal complete-=i " Searching includes can be slow -setglobal completeopt=menuone,noselect -setglobal formatoptions= -if v:version + has('patch541') >= 704 - setglobal formatoptions+=j -endif -setglobal dictionary+=/usr/share/dict/words -setglobal infercase -setglobal showmatch -setglobal virtualedit=block - -setglobal shiftround -setglobal smarttab -if has('vim_starting') - let mapleader="\\" - set autoindent - set smartindent - set smarttab - set expandtab - set splitbelow splitright - set tabstop=8 softtabstop=0 - if exists('*shiftwidth') - set shiftwidth=0 softtabstop=-1 - endif - set omnifunc=syntaxcomplete#Complete - set completefunc=syntaxcomplete#Complete -endif - - -" Section: Folding and Comments - -if has('vim_starting') - if has('folding') - set foldmethod=marker - set foldopen+=jump - endif - set commentstring=#\ %s -endif - -autocmd FileType sh,zsh,csh,tcsh,python,desktop setlocal commentstring=##\ %s -autocmd FileType sql setlocal commentstring=--\ %s -autocmd FileType xdefaults setlocal commentstring=!%s -autocmd FileType git,gitcommit setlocal foldmethod=syntax foldlevel=1 - - -" Section: Maps - -setglobal timeoutlen=1200 -setglobal ttimeoutlen=50 - -inoremap <Esc> <Esc>`^ -inoremap <C-[> <Esc>`^ -inoremap <C-C> <Esc>`^ - -noremap Q gq -noremap <silent> <space> :exe "normal i".nr2char(getchar())<CR> - -vnoremap . :normal .<CR> -vnoremap > >gv -vnoremap < <gv - -vnoremap <leader>ge !gpgw -aser -vnoremap <leader>gs !gpgw -a --clear-sign<CR> -vnoremap <leader>gd !gpgw -d<CR> - -nnoremap <leader>r "hyiw:%s/<C-R>h//g<left><left> -nnoremap <leader>s "hyiw/<C-R>h -vnoremap <leader>r "hy:%s/<C-R>h//g<left><left> -vnoremap <leader>s "hy/<C-R>h - -function! ReplayLastMacro() - try - normal @@ - catch /E748/ - normal @q - endtry -endfunction -nnoremap <leader>m :call ReplayLastMacro()<CR> -vnoremap <leader>m norm :call ReplayLastMacro()<CR> - -cnoremap W!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! - -inoremap <silent> <Up> <Esc><Up> -inoremap <silent> <Down> <Esc><Down> - -" Shortcut split navigation -nnoremap <C-h> <C-w>h -nnoremap <C-j> <C-w>j -nnoremap <C-k> <C-w>k -nnoremap <C-l> <C-w>l -nnoremap <C-J> <C-w>w -nnoremap <C-K> <C-w>W - -nnoremap <leader>o :setlocal spell!<CR> -nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr> -nnoremap <leader>l :bnext<cr> -nnoremap <leader>h :bprevious<cr> -nnoremap <leader>tn :tabnew<cr> -nnoremap <leader>to :tabonly<cr> -nnoremap <leader>tc :tabclose<cr> -nnoremap <leader>tm :tabmove -nnoremap <leader>t<leader> :tabnext<cr> -" Let 'tl' toggle between this and the last accessed tab. -let g:lasttab = 1 -nnoremap <leader>tl :exe "tabnext ".g:lasttab<CR> -autocmd TabLeave * let g:lasttab = tabpagenr() -" Opens a new tab with the current buffer's path. -nnoremap <leader>te :tabedit <C-r>=escape(expand("%:p:h"), " ")<cr>/ - -nnoremap <silent> <C-w>z :wincmd z<Bar>cclose<Bar>lclose<CR> -nnoremap <silent> <C-w>Q :tabclose<CR> -nnoremap <silent> <C-w>, :if exists(':Wcd')<Bar>exe 'Wcd'<Bar>elseif exists(':Lcd')<Bar>exe 'Lcd'<Bar>elseif exists(':Glcd')<Bar>exe 'Glcd'<Bar>else<Bar>lcd %:h<Bar>endif<CR> -nmap cd <C-w>, - -" Paste last thing yanked -nnoremap ,p "0p -nnoremap ,P "0P -" Interaction (cut/copy/paste) from system clibpboard. -vnoremap <S-Del> "+x -vnoremap <C-Insert> "+y -noremap <script> <S-Insert> "+gP -noremap! <script> <S-Insert> <C-R><C-R>+ - -nnoremap <Space>r :source $MYVIMRC<Bar>filetype detect<Bar>doau VimEnter<CR> - -let s:toggle_hide_all = 0 -function! ToggleHideAll() - if s:toggle_hide_all == 0 - let s:toggle_hide_all = 1 - set noshowmode - set noruler - set laststatus=0 - set showtabline=0 - set noshowcmd - set signcolumn=no - else - let s:toggle_hide_all = 0 - set showmode - set ruler - set laststatus=2 - set showtabline=2 - set showcmd - set signcolumn=auto - endif -endfunction -nnoremap <leader>H :call ToggleHideAll()<CR> - - -" Section: Reading and writing files - -" Remove trailing whitespace and newline at the end of file before save. -let g:trim_whitespace_exclude_filetype = - \ ['diff', 'patch', 'mail', 'gitsendemail', 'gitcommit', 'gitrebase'] -function! TrimWhitespace() - if !exists('g:trim_whitespace_exclude_filetype') - let g:trim_whitespace_exclude_filetype = [] - endif - for ft in g:trim_whitespace_exclude_filetype - if &l:filetype ==# ft - return - endif - endfor - let currPos = getpos(".") - %s/\s\+$//e - %s/\n\+\%$//e - call cursor(currPos[1], currPos[2]) -endfunction -autocmd BufWritePre * call TrimWhitespace() - -setglobal autoread -setglobal autowrite -if has('multi_byte') - let &g:fileencodings = substitute(&fileencodings, 'latin1', 'cp1252', '') -endif -setglobal fileformats=unix,dos,mac -setglobal swapfile -setglobal backup - -if exists('##CursorHold') - autocmd CursorHold,BufWritePost,BufReadPost,BufLeave * - \ if !$VIMSWAP && isdirectory(expand('<amatch>:h')) | let &swapfile = &modified | endif -endif - -if has('vim_starting') && exists('+undofile') - set undofile -endif - -if v:version >= 700 - setglobal viminfo=!,'20,<50,s10,h - if !has('nvim') - setglobal viminfofile=$XDG_CACHE_HOME/vim/viminfo - endif -endif - -if exists('+undodir') && !has('nvim-0.5') - let s:cache_home = substitute($XDG_CACHE_HOME, '/$', '', '') . '/vim/' - let &undodir = s:cache_home . 'undo//' - let &directory = s:cache_home . 'swap//' - let &backupdir = s:cache_home . 'backup//' - let &viewdir = s:cache_home . 'view//' - if !isdirectory(&undodir) | call mkdir(&undodir, 'p') | endif - if !isdirectory(&directory) | call mkdir(&directory, 'p') | endif - if !isdirectory(&backupdir) | call mkdir(&backupdir, 'p') | endif - if !isdirectory(&viewdir) | call mkdir(&viewdir, 'p') | endif -endif - - -" Section: Command line editing - -setglobal history=1000 -setglobal wildmenu -setglobal wildmode=longest:full,full -setglobal wildignore+=tags,.*.un~,*.pyc - -cnoremap <C-O> <Up> -cnoremap <C-R><C-L> <C-R>=substitute(getline('.'), '^\s*', '', '')<CR> - -" usage: :call Exec('ls') -" paste from register: "ep -function! Exec(command) - redir @e - silent exec a:command - redir END -endfunction - -" Section: External commands - -setglobal grepformat=%f:%l:%c:%m,%f:%l:%m,%f:%l%m,%f\ \ %l%m -if executable('rg') - setglobal grepprg=rg\ -s\ --vimgrep -elseif executable('ag') - setglobal grepprg=ag\ -s\ --vimgrep -elseif has('unix') - setglobal grepprg=grep\ -rn\ $*\ /dev/null -endif - -" Dirty method to automatically set compiler, as Vim doesn't. -autocmd FileType * try | execute "compiler ".&filetype | catch /./ | endtry - -autocmd BufReadPost * - \ if getline(1) =~# '^#!' | - \ let b:dispatch = - \ matchstr(getline(1), '#!\%(/usr/bin/env \+\)\=\zs.*') . ' %:S' | - \ let b:start = '-wait=always ' . b:dispatch | - \ endif -autocmd BufReadPost ~/.xbindkeys* let b:dispatch = '-dir=~ pkill -f "xbindkeys -X $DISPLAY"; xbindkeys -X $DISPLAY' -autocmd BufReadPost ~/.Xkbmap let b:dispatch = 'setxkbmap `cat %`' -autocmd BufReadPost {.,}{X,x}{resources,defaults} let b:dispatch = 'xrdb ' . $XRDBOPT . ' -override %' -" autocmd BufWritePost {.,}{X,x}{resources,defaults} silent! !xrdb -override % -autocmd BufReadPost /etc/init.d/* let b:dispatch = 'service %:t restart' -autocmd BufReadPost /etc/init/*.conf let b:dispatch = 'service %:t:r restart' -autocmd BufReadPost /etc/udev/* let b:dispatch = 'service udev restart' -autocmd BufReadPost ~/.config/awesome/* - \ let b:current_compiler = 'awesome' | - \ setlocal makeprg=awesome\ -k - \ efm=%-G%.\ Configuration\ file\ syntax\ OK.,%f:%l:%m,%+G%.%# -autocmd FileType eruby,html,haml command! -buffer -range=% Haml - \ exe '<line1>,<line2>!html2haml --erb --html-attributes' - \ (indent(<line1>) ? '|sed -e "s/^/'.matchstr(getline(<line1>), '^\s*').'/"' : '') | setf haml - -autocmd FileType vader let b:dispatch = ':Vader' -autocmd FileType tmux let b:dispatch = 'tmux source %:p:S' -autocmd FileType cucumber call extend(b:, {'dispatch': 'cucumber %:S'}, 'keep') -autocmd FileType haskell let b:dispatch = 'ghc %:S' -autocmd FileType java let b:dispatch = 'javac %:S' -autocmd FileType perl let b:dispatch = 'perl -Wc %:S' -autocmd FileType ruby - \ if !exists('b:start') | - \ let b:start = executable('pry') ? 'pry -r %:p:S' : 'irb -r %:p:S' | - \ endif | - \ if expand('%') =~# '_test\.rb$' | - \ let b:dispatch = 'testrb %' | - \ elseif expand('%') =~# '_spec\.rb$' | - \ let b:dispatch = get(b:, 'dispatch', 'rspec %:s/$/\=exists("l#") ? ":".l# : ""/') | - \ elseif join(getline(max([line('$')-8,1]), '$'), "\n") =~# '\$0\>' | - \ let b:dispatch = 'ruby %' | - \ elseif !exists('b:dispatch') | - \ let b:dispatch = 'ruby -wc %' | - \ endif -autocmd FileType tex let b:dispatch = 'latex -interaction=nonstopmode %' -autocmd VimLeave *.tex !texclear % - -function! s:open(...) abort - if executable('xdg-open') - let cmd = 'xdg-open' - else - let cmd = 'open' - endif - if !empty(v:servername) && !has('win32') - let cmd = 'env VISUAL="vim --servername '.v:servername.'" '.cmd - endif - let args = a:0 ? copy(a:000) : [get(b:, 'url', '%:p')] - if type(args[0]) == type(function('tr')) - let args[0] = call(args[0], [{}], {}) - endif - call map(args, 'shellescape(expand(v:val))') - return 'echo ' . string(system(cmd . ' ' . join(args, ' '))[0:-2]) -endfunction -command! -nargs=* -complete=file O :exe s:open(<f-args>) - - -" Section: Filetype settings - -" autocmd FileType * -" \ if !empty(globpath(&rtp, "/autoload/" . &filetype . "complete.vim")) | -" \ execute "setlocal completefunc=" . &filetype . "complete#Complete" | -" \ endif -autocmd FileType * setlocal nolinebreak -autocmd FileType gitconfig setlocal shiftwidth=8 tabstop=8 softtabstop=8 -autocmd FileType python setlocal textwidth=79 shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab autoindent -autocmd FileType sh,zsh,csh,tcsh - \ setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab -autocmd FileType sh,zsh,csh,tcsh,perl,python,ruby,tcl - \ setlocal formatoptions-=t formatoptions+=roqn | - \ if !&textwidth | setlocal textwidth=78 | endif -autocmd FileType help - \ setlocal autoindent formatoptions+=2n formatoptions-=ro -autocmd FileType markdown,text - \ setlocal textwidth=78 linebreak keywordprg=dict foldlevel=1 -autocmd FileType tex setlocal formatoptions+=l -autocmd FileType vim setlocal keywordprg=:help | - \ if &foldmethod !=# 'diff' | setlocal foldmethod=expr foldlevel=1 | - \ endif | setlocal foldexpr=getline(v:lnum)=~'^\"\ Section:'?'>1':'=' - -autocmd BufRead,BufNewFile .{yamllint,salt-lint} setlocal filetype=yaml -autocmd BufRead,BufNewFile .qubesbuilder,/etc/qubes/backup/*.conf - \ setlocal filetype=yaml -autocmd BufRead,BufNewFile qmemman.conf setlocal filetype=toml -autocmd BufRead,BufNewFile {.,}{X,x}{resources,defaults} - \ setlocal filetype=xdefaults -autocmd BufRead,BufNewFile *.{ms,me,mom,man} setlocal filetype=groff -autocmd BufRead,BufNewFile *.{ronn,1,2,3,4,5,6,7,8,9} - \ setlocal nomodeline tabstop=8 textwidth=72 formatoptions+=tln formatoptions-=croq formatlistpat+=\\\|^\\s*[-*+]\\s\\+ -autocmd BufRead,BufNewFile *.{automount,mount,path,service,socket,target,timer} setlocal filetype=systemd -autocmd BufRead,BufNewFile *named.conf* setlocal filetype=named -autocmd BufWritePre,FileWritePre **/spell/*.ascii.add :silent mkspell! -ascii % -autocmd BufWritePre,FileWritePre /etc/* if &ft == 'dns' | - \ exe "normal msHmt" | - \ exe "gl/^\\s*\\d\\+\\s*;\\s*Serial$/normal ^\<C-A>" | - \ exe "normal g`tztg`s" | - \ endif - - -" Section: Highlighting - -if has('spell') - if has('vim_starting') - call mkdir($CODE_HOME."/vim/after/spell", 'p', 0700) - set spell - set spelllang=en_us - set spellfile=$CODE_HOME/vim/after/spell/en.utf-8.add - endif - let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' - autocmd FileType gitcommit,markdown,vimwiki,mail,text setlocal spell - autocmd FileType help if &buftype ==# 'help' | setlocal nospell | endif -endif - -if $TERM !~? 'linux' && &t_Co == 8 - setglobal t_Co=16 -endif - -if (&t_Co > 2 || has('gui_running')) && has('syntax') - if !exists('syntax_on') && !exists('syntax_manual') - exe 'augroup END' - syntax on - exe 'augroup my' - endif - if has('vim_starting') - set list - if !exists('g:colors_name') - colorscheme vividchalk - endif - endif - - autocmd Syntax sh syn sync minlines=500 - autocmd Syntax css syn sync minlines=50 - " Fix syntax highlighting - " autocmd BufEnter * syntax sync fromstart -endif - -" Highlight textwdith+1. -let g:tw_hi_till_end = 0 -let g:tw_hi_exclude_filetype = [ - \ 'help', 'qrexecpolicy', 'qrexecpolicyservice', 'qrexecconfig' - \ ] -function! TextwidthHighlight() - if !exists('g:tw_hi_exclude_filetype') - let g:tw_hi_exclude_filetype = [] - endif - if !exists('g:tw_hi_till_end') - let g:tw_hi_till_end = 0 - endif - for ft in g:tw_hi_exclude_filetype - if &filetype ==# ft - return - endif - endfor - if exists('b:tw_match') - try | call matchdelete(b:tw_match) | catch | endtry - unlet b:tw_match - endif - if &textwidth == 0 | return | endif - if g:tw_hi_till_end == 1 - let b:tw_match = matchadd('ColorColumn', '.\{' . (&textwidth+1) . '\}\zs.\+', 100) - else - let b:tw_match = matchadd('ColorColumn', '\%' . (&textwidth+1) . 'v', 100) - endif -endfunction -autocmd BufEnter,BufWritePre,OptionSet,ColorScheme * call TextwidthHighlight() - -" Turns off highlighting on the bits of code that are changed, so the line -" that is changed is highlighted but the actual text that has changed stands -" out on the line and is readable. -if &diff - highlight! link DiffText MatchParen -endif - - -" Section: Plugin settings - -let g:is_posix = 1 -let g:sh_fold_enabled = has('folding') -let g:sh_noisk = 1 -let g:bash_is_sh = 1 -let g:sql_type_default = 'pgsql' -let g:omni_sql_no_default_maps = 1 -let g:yaml_recommended_style = 1 - -let g:update_time_time_format = '%Y %b %d' -let g:prosession_dir = $XDG_DATA_HOME . "/vim/session" -" Only works if not arguments are provided to vim: e.g.: \vim -let g:prosession_on_startup = 1 -let g:EditorConfig_exclude_patterns = ['fugitive://.*'] -let g:ragtag_global_maps = 1 - -" vim-markdown-toc deletes text if the file is folded, use manual updates -let g:vmt_auto_update_on_save = 0 -let g:vmt_dont_insert_fence = 1 - -let b:surround_{char2nr('e')} = "\r\n}" -let g:surround_{char2nr('-')} = "<% \r %>" -let g:surround_{char2nr('=')} = "<%= \r %>" -let g:surround_{char2nr('8')} = "/* \r */" -let g:surround_{char2nr('s')} = " \r" -let g:surround_{char2nr('^')} = "/^\r$/" -let g:surround_indent = 1 - -let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/](\.(git|hg|svn)|\_site)$', - \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$', - \ } - -let g:vimwiki_global_ext = 0 -let g:vimwiki_list = [{ - \ 'path': '~/src/vimwiki/', 'syntax': 'default', 'ext': 'wiki' - \ }] - -function! s:SetSyntax() - let g:markdown_folding = 1 - let g:markdown_fenced_languages = [] - let g:markdown_fenced_languages_wanted = [ - \ 'python', 'py=python', 'ruby', 'html', 'javascript', 'css', - \ 'sh', 'bash=sh', 'systemd', 'vim', 'yaml', - \ 'sshconfig', 'sshdconfig', - \ 'qrexecpolicy', 'qrexecpolicyservice', 'qrexecconfig', - \ ] - for g:markdown_try in g:markdown_fenced_languages_wanted - let g:syn_hi_find = g:markdown_try - if g:markdown_try =~ '\S\+=\S\+' - let g:syn_hi_find = split(g:markdown_try, '=')[1] - endif - if !empty(globpath(&runtimepath, 'syntax/' . g:syn_hi_find . '.vim')) - call add(g:markdown_fenced_languages, g:markdown_try) - endif - endfor - unlet g:markdown_try g:syn_hi_find - - let g:rst_syntax_code_list = { - \ 'cpp': ['cpp', 'c++'], - \ 'java': ['java'], - \ 'php': ['php'], - \ 'python': ['python'], - \ 'perl': ['perl'], - \ 'rust': ['rust'], - \ 'sh': ['sh'], - \ 'vim': ['vim'], - \ 'yaml': ['yaml'], - \ 'qrexecpolicy': ['qrexecpolicy'], - \ 'qrexecpolicyservice': ['qrexecpolicyservice'], - \ 'qrexecconfig': ['qrexecconfig'], - \ } -endfunction -" Necessary to apply syntax from plugins. -autocmd FileType markdown,vimwiki,rst call s:SetSyntax() - -let g:limelight_conceal_ctermfg='Gray' -function! s:goyo_enter() - if exists(':Limelight') - Limelight - endif -endfunction -function! s:goyo_leave() - if exists(':Limelight') - Limelight! - endif -endfunction -autocmd! User GoyoEnter nested call <SID>goyo_enter() -autocmd! User GoyoLeave nested call <SID>goyo_leave() - - -" Section: Plugins - -call mkdir($XDG_CONFIG_HOME.'/vim/bundle', 'p', 0700) -call mkdir($XDG_CONFIG_HOME.'/vim/after/autoload', 'p', 0700) - -runtime autoload/pathogen.vim -if exists('*pathogen#infect') - execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}') - execute pathogen#helptags() -endif - -if has('*after_object#enable') - autocmd VimEnter * - \ call after_object#enable([']', '['], '=', ':', '-', '#', ' ') -endif - - -" Section: Misc - -setglobal sessionoptions-=buffers sessionoptions-=curdir sessionoptions+=sesdir,globals -" From sensible.vim -" Saving options in session and view files causes more problems than it -" solves, so disable it. -setglobal sessionoptions-=options -setglobal viewoptions-=options -autocmd VimEnter * nested - \ if !argc() && empty(v:this_session) && filereadable('Session.vim') && !&modified | - \ source Session.vim | - \ endif - - -" Section: End - -let $MYVIMRCLOCAL = expand('$HOME/.vimrc.local') -if filereadable($MYVIMRCLOCAL) - source $MYVIMRCLOCAL -endif - -exe 'augroup END' - -" vim:set et sw=2 foldmethod=expr diff --git a/qusal/dotfiles/files/x11/.Xresources b/qusal/dotfiles/files/x11/.Xresources deleted file mode 120000 index ba3174a..0000000 --- a/qusal/dotfiles/files/x11/.Xresources +++ /dev/null @@ -1 +0,0 @@ -.config/x11/xresources \ No newline at end of file diff --git a/qusal/dotfiles/files/x11/.config/x11/xinitrc b/qusal/dotfiles/files/x11/.config/x11/xinitrc deleted file mode 100755 index 3252385..0000000 --- a/qusal/dotfiles/files/x11/.config/x11/xinitrc +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC1091 -test -r "$HOME/.profile" && . "$HOME/.profile" -. "${XDG_CONFIG_HOME:=$HOME/.config}/x11/xprofile" diff --git a/qusal/dotfiles/files/x11/.config/x11/xprofile b/qusal/dotfiles/files/x11/.config/x11/xprofile deleted file mode 100755 index 273d52a..0000000 --- a/qusal/dotfiles/files/x11/.config/x11/xprofile +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC1091 -## Sourced by display manager, xinit and startx. - -## Load requirements. -test -r "$HOME/.profile" && . "$HOME/.profile" -: "${XDG_CONFIG_HOME:=$HOME/.config}" - -## Load resources. -if command -v xrdb >/dev/null; then - xrdb "$XDG_CONFIG_HOME/x11/xresources" -fi - -## If running normal OS or Qubes: Dom0, apply settings. -if ! command -v qubesdb-read >/dev/null || test "$(hostname)" = "dom0"; then - ## Decrease key repeat delay to X ms. - ## Increase key repeat rate to Y per second. - xset r rate 275 60 - - ## Give Caps Lock a better use. - ## ctrl:swapcaps seems better than caps:swapescape because ctrl is - ## difficult to reach and escape can be done wit 'caps+['. - setxkbmap -keycodes "evdev+aliases(qwerty)" -model pc105 -layout us \ - -variant ,qwerty -option "" -option "grp:win_space_toggle,ctrl:nocaps" - - #qvm-prefs dom0 keyboard_layout "us+dvorak+grp:win_space_toggle,ctrl:nocaps" -fi - -## Autostart desktop applications if the WM does not. -desktop_autostart(){ - if test -e "${TMPDIR:-/tmp}/touch-desktop-autostart"; then - return 0 - fi - - touch "${TMPDIR:-/tmp}/touch-desktop-autostart" - autostart_etc="${XDG_CONFIG_DIRS-/etc/xdg}/autostart" - autostart_home="${XDG_CONFIG_HOME-$HOME/.config}/autostart" - - for f in "$autostart_etc"/*.desktop "$autostart_home"/*.desktop; do - test -r "$f" || continue - # shellcheck disable=SC2091 - autostart_exec="$(awk -F '=' '/^Exec=/{print $2}' "$f")" - command -v "${autostart_exec%% *}" >/dev/null || continue - ${autostart_exec} & - done -} - -## Source local profile. -if test -r "$HOME/.xprofile.local"; then - . "$HOME/.xprofile.local" -fi - -: "${wm_list:="dwm"}" -for wm in $wm_list; do - command -v "$wm" >/dev/null || break - if test "$wm" = "dwm" && command -v xsetroot >/dev/null; then - desktop_autostart - while true; do - xsetroot -name "$(display-statusbar)" - sleep 60 - done & - fi - # shellcheck disable=SC2093 - $wm & - wm_pid="$!" -done - -test -z "$wm_pid" || wait "$wm_pid" diff --git a/qusal/dotfiles/files/x11/.config/x11/xresources b/qusal/dotfiles/files/x11/.config/x11/xresources deleted file mode 100644 index f760580..0000000 --- a/qusal/dotfiles/files/x11/.config/x11/xresources +++ /dev/null @@ -1,316 +0,0 @@ -! ~/.Xresources - -! SPDX-FileCopyrightText: 2004 - 2016 Tim Pope <https://tpo.pe> -! SPDX-FileCopyrightText: 2023 Qusal contributors -! -! SPDX-License-Identifier: GPL-3.0-or-later - -! Credits: https://github.com/tpope/dotfiles/blob/master/.Xresources -! vim:set foldmethod=expr foldexpr=getline(v\:lnum)=~'^!##'?'>1'\:'=': - -*international: true -*customization: -color - -!## TERMINAL COMMON -#ifndef FIXED -#if WIDTH > 1800 -#define FIXED -misc-fixed-medium-r-normal--20-*-*-*-c-* -#elif WIDTH > 1450 -#define FIXED -misc-fixed-medium-r-normal--18-*-*-*-c-* -#elif WIDTH > 1150 -#define FIXED -misc-fixed-medium-r-normal--14-*-*-*-c-* -#else -#define FIXED -misc-fixed-medium-r-semicondensed--13-*-*-*-c-* -#endif -#endif - -! http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html -! https://en.wikipedia.org/wiki/X11_color_names -! https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg -! RGB to HEX https://unix.stackexchange.com/a/269085 -! https://misc.flogisoft.com/bash/tip_colors_and_formatting -! https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux -! https://unix.stackexchange.com/questions/124407/what-color-codes-can-i-use-in-my-bash-ps1-prompt - -! name dark light -! black 0 8 -! red 1 9 -! green 2 10 -! yellow 3 11 -! blue 4 12 -! purple 5 13 -! cyan 6 14 -! white 7 15 - -! Tpope colors -*color0: #000000 -*color1: #aa0000 -*color2: #00aa00 -*color3: #aa5522 -*color4: #0000ee -*color5: #aa00aa -*color6: #00aaaa -*color7: #aaaaaa -*color8: #555555 -*color9: #ff4444 -*color10: #44ff44 -*color11: #ffff00 -*color12: #5c5cff -*color13: #ff00ff -*color14: #00ffff -*color15: #ffffff -*colorBD: #ffffff - -! *.cursorColor: #ffffff - -! *color0: #000000 -! *color1: #aa0000 -! *color2: #00aa00 -! *color3: #aa5522 -! *color4: #0000ee -! *color5: #aa00aa -! *color6: #00aaaa -! *color7: #aaaaaa -! *color8: #555555 -! *color9: #ff4444 -! *color10: #44ff44 -! *color11: #ffff00 -! *color12: #5c5cff -! *color13: #ff00ff -! *color14: #00ffff -! *color15: #ffffff -! *colorBD: #ffffff - -! ! Black / Grey -! *.color0: #000000 -! ! *.color8: #808080 -! *.color8: #767676 - -! ! Red / Bright Red -! *.color1: #800000 -! *.color9: #FF0000 - -! ! Green + Bright Green -! ! *.color2: #008000 -! *.color2: #00af00 -! *.color10: #00ff00 - -! ! Yellow (Orange) + Bright Yellow (Yellow) -! *.color3: #808000 -! *.color11: #ffff00 - -! ! Blue + Bright Blue -! *.color4: #000080 -! *.color12: #0000ff - -! ! Magenta (Purple) + Bright Magenta -! ! *.color5: #800080 -! *.color5: #af00d7 -! *.color13: #0000ff - -! ! Cyan (Aqua) + Bright Cyan -! ! *.color6: #800080 -! *.color6: #008b8b -! ! *.color14: #ff00ff -! *.color14: #00d7ff - -! ! Light Grey (Selection) + White (Current Line) -! *.color7: #c0c0c0 -! *.color15: #ffffff - -!## [U]XTERM -*.selectToClipboard: true -*.VT100saveLines: 4096 -*.wideChars: true -*.locale: true -*.utf8: 1 -*.VT100Graphics: true -*.background: black -*.VT100.background: black -*.foreground: white -*.VT100.foreground: white -*.termName: xterm-256color -*.ttyModes: start ^- stop ^- -*.boldMode: false -*.allowBoldFonts: false -*.VT100.geometry: 80x24 -*.VT100.scaleHeight: 1.1 -! For some reason, '*scrollBar' was not working on Fedora. -XTerm*.scrollBar: false -UXTerm*.scrollBar: false -*.colorBDMode: true -*.visualBell: false -*.eightBitInput: false -*.modifyCursorKeys: 2 -*.trimSelection: true -*.CharClass: 33:48,37-38:48,45-47:48,58:48,61:48,63-64:48,126:48,161-255:48 -*.activeIcon: true -*.VT100.translations: #override \ - Ctrl<Key>comma: scroll-forw(1,page-1) \n\ - Ctrl<Key>period: scroll-back(1,page-1) \n\ - Ctrl<Key>9: smaller-vt-font() \n\ - Ctrl<Key>0: larger-vt-font() \n\ - Ctrl<Key>1: set-render-font(toggle) -*.VT100.metaSendsEscape: true - -#ifdef FIXED -*.VT100.font: FIXED-iso8859-1 -*.font: FIXED-iso8859-1 -*.boldFont: FIXED-iso8859-1 -*.utf8Fonts.font: FIXED-iso10646-1 -*.utf8Fonts.boldFont: FIXED-iso10646-1 -#else -*.VT100.font: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso8859-1 -*.font: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso8859-1 -*.boldFont: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso10646-1 -*.utf8Fonts.boldFont: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso10646-1 -#endif -#if WIDTH >= 1920 -*.renderFont: true -#endif -*.fontMenu.fontdefault.Label: Default -*.fontMenu.font1.Label: Tiny -*.font1: -misc-fixed-medium-r-normal--6-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font1: -misc-fixed-medium-r-normal--6-*-*-*-c-*-iso10646-1 -*.fontMenu.font2.Label: Small -*.font2: -misc-fixed-medium-r-normal--8-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font2: -misc-fixed-medium-r-normal--8-*-*-*-c-*-iso10646-1 -*.fontMenu.font3.Label: Semicondensed -*.font3: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font3: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-*-iso10646-1 -*.fontMenu.font4.Label: Medium -*.font4: -misc-fixed-medium-r-normal--14-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font4: -misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1 -*.fontMenu.font5.Label: Large -*.font5: -misc-fixed-medium-r-normal--18-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font5: -misc-fixed-medium-r-normal--18-*-*-*-c-*-iso10646-1 -*.fontMenu.font6.Label: Huge -*.font6: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso8859-1 -*.utf8Fonts.font6: -misc-fixed-medium-r-normal--20-*-*-*-c-*-iso10646-1 -*.faceName: MONOSPACE:MEDIUM -#ifdef MONOSIZE -*.faceSize: MONOSIZE -#else -*.faceSize: 12 -#endif -*.faceSize1: 10 -*.faceSize2: 12 -*.faceSize3: 14 -*.faceSize4: 17 -*.faceSize5: 21 -*.faceSize6: 24 - -!## [U]RXVT -Rxvt*visualBell: true -URxvt.urgentOnBell: true -URxvt.termName: rxvt-256color - -Rxvt*scrollBar: false -URxvt.thickness: 4 -URxvt.scrollBar_floating: true -URxvt.scrollstyle: plain - -Rxvt*background: #000000 -Rxvt*foreground: #aaaaaa -URxvt.underlineColor: #777777 -URxvt.boldFont: -URxvt.italicFont: -URxvt.boldItalicFont: - -#ifdef MONOSIZE -URxvt.font: xft:MONOSPACE-MONOSIZE:MEDIUM -#elif WIDTH < 1920 -URxvt.font: FIXED-iso10646-1 -#else -URxvt.font: xft:MONOSPACE-14:MEDIUM -#endif - -URxvt.keysym.M-C-1: command:\033]710;-misc-fixed-medium-r-normal--6-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-2: command:\033]710;-misc-fixed-medium-r-normal--8-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-3: command:\033]710;-misc-fixed-medium-r-semicondensed--13-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-4: command:\033]710;-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-5: command:\033]710;-misc-fixed-medium-r-normal--18-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-6: command:\033]710;-misc-fixed-medium-r-normal--20-*-*-*-c-*-iso10646-1\007 -URxvt.keysym.M-C-7: command:\033]710;xft:MONOSPACE-10:MEDIUM\007 -URxvt.keysym.M-C-8: command:\033]710;xft:MONOSPACE-12:MEDIUM\007 -URxvt.keysym.M-C-9: command:\033]710;xft:MONOSPACE-14:MEDIUM\007 -URxvt.keysym.M-C-0: command:\033]710;xft:MONOSPACE-17:MEDIUM\007 -URxvt.keysym.M-C-minus: command:\033]710;xft:MONOSPACE-21:MEDIUM\007 -URxvt.keysym.M-C-equal: command:\033]710;xft:MONOSPACE-24:MEDIUM\007 - -URxvt.keysym.C-9: perl:font-size:decrease -URxvt.keysym.C-0: perl:font-size:increase -URxvt.keysym.S-C-underscore: perl:font-size:decrease -URxvt.keysym.S-C-plus: perl:font-size:increase - -URxvt.keysym.C-1: perl:matcher -URxvt.keysym.C-grave: perl:matcher:list -URxvt.keysym.C-comma: command:\033]720;12\007 -URxvt.keysym.C-period: command:\033]721;12\007 - -URxvt.keysym.KP_Up: string:\033[A -URxvt.keysym.KP_Down: string:\033[B -URxvt.keysym.KP_Right: string:\033[C -URxvt.keysym.KP_Left: string:\033[D -URxvt.keysym.KP_Begin: string:\033[E -URxvt.keysym.KP_Insert: string:\033[2~ -URxvt.keysym.KP_Delete: string:\033[3~ -URxvt.keysym.KP_Next: string:\033[5~ -URxvt.keysym.KP_Prior: string:\033[6~ -URxvt.keysym.KP_Home: string:\033[7~ -URxvt.keysym.KP_End: string:\033[8~ -URxvt.keysym.KP_Enter: string:\015 -URxvt.keysym.KP_Add: string:+ -URxvt.keysym.KP_Subtract: string:- -URxvt.keysym.KP_Multiply: string:* -URxvt.keysym.KP_Divide: string:/ - -URxvt.iso14755_52: false -URxvt.perl-ext: default,searchable-scrollback<C-S-question>,matcher,selection-pastebin,remote-clipboard,selection-autotransform -URxvt.perl-eval: push @{ $urxvt::TERM->{selection_popup_hook} }, \n\ - sub { /\\n/ ? ("join lines with spaces" => sub { s{^\\s+}{}mg; s/ \*\\n/ /g; s{ $}{}; }) : () }, \n\ - sub { /./ ? ("string quote" => sub { s([\\\\\\042$@]|#[{])(\\\\$&)g; s{\\n}{\\\\n}g; s{\\t}{\\\\t}g; s{\\r}{\\\\r}g; s{[\\000-\\037]}{sprintf("%03o",ord($&))}eg; $_ = qq("$_"); }) : () }, \n\ - sub { /\\n\\[?\\d\\d(\\d\\d-|:)\\d\\d/ ? ("quote for irc" => sub { s{^\\[?[\\d:_-]+\\]? +}{}; s/\\s*\\n\\[?[\\d:_-]{5,}\\]? +/ || /g; s/^\\s+/ /mg; s/( ?) \*\\n( ?)/($1||$2)/eg; s{ $}{}; }) : () }; -URxvt.selection-autotransform.0: if(/\\n\\[?\\d\\d(\\d\\d-|:)\\d\\d/) { s{^\\[?[\\d:_-]+\\]? +}{}; s/\\s*\\n\\[?[\\d:_-]{5,}\\]? +/ || /g; s/^\\s+/ /mg; s/( ?) \*\\n( ?)/($1||$2)/eg; s{ $}{}; }; -URxvt.selection-autotransform.1: if(/^irb.*?> /) { s{^irb.*?[>*]\\s*}{}mg; s/\\n=>/ #=>/mg; s{\\n$}{};} -URxvt.selection-autotransform.2: if(m{^[ab]/}) { s{^[ab]/}{}g; } -URxvt.selection-autotransform.3: s/^([^:\\s]*):(\\d+)(:|:in)?$/+$2 $1/g; - -!## XFT -Xft.antialias: 1 -Xft.hinting: 1 -Xft.rgba: rgb -Xft.hintsyle: hintslight -Xft.lcdfilter: lcddefault -Xft.dpi: 96 - -!## XDVI -XDvi.editor: vim -g --remote +%l %f -XDvi.wwwBrowser: xdg-open -XDvi.shrinkFactor: 7 -XDvi.expert: true -XDvi.Margin: 1in -XDvi.paper: us -XDvi.mainTranslations: #override \ - <Btn1Down>: do-href()magnifier(*1)\n\ - <Btn2Down>: do-href-newwindow()source-special()\n\ - <Btn3Down>: magnifier(*3)\n -Fig.inches: true - -!## XMESSAGE -Xmessage.defaultButton: okay - -!## XSCREENSAVER -XScreenSaver.dpmsEnabled: true -XScreenSaver.splash: false -XScreenSaver.ignoreUninstalledPrograms: true -XScreenSaver.loadURL: xdg-open '%s' -XScreensaver.captureStderr: false -XScreensaver.overlayStderr: false - -!## XCOLORSEL -Xcolorsel*displayFormat: #rrggbb - -!## ROFI -rofi.font: MONOSPACE bold 14 diff --git a/qusal/dotfiles/files/x11/.config/x11/xsession b/qusal/dotfiles/files/x11/.config/x11/xsession deleted file mode 100755 index 3252385..0000000 --- a/qusal/dotfiles/files/x11/.config/x11/xsession +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC1091 -test -r "$HOME/.profile" && . "$HOME/.profile" -. "${XDG_CONFIG_HOME:=$HOME/.config}/x11/xprofile" diff --git a/qusal/dotfiles/files/x11/.config/x11/xsessionrc b/qusal/dotfiles/files/x11/.config/x11/xsessionrc deleted file mode 100755 index b2ec69f..0000000 --- a/qusal/dotfiles/files/x11/.config/x11/xsessionrc +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -# shellcheck disable=SC1090,SC1091 -test -r "$HOME/.profile" && . "$HOME/.profile" -. "${XDG_CONFIG_HOME:=$HOME/.config}/x11/xsession" diff --git a/qusal/dotfiles/files/x11/.xsession b/qusal/dotfiles/files/x11/.xsession deleted file mode 120000 index 4ab1cdb..0000000 --- a/qusal/dotfiles/files/x11/.xsession +++ /dev/null @@ -1 +0,0 @@ -.config/x11/xsession \ No newline at end of file diff --git a/qusal/dotfiles/files/x11/.xsessionrc b/qusal/dotfiles/files/x11/.xsessionrc deleted file mode 120000 index d189940..0000000 --- a/qusal/dotfiles/files/x11/.xsessionrc +++ /dev/null @@ -1 +0,0 @@ -.config/x11/xsessionrc \ No newline at end of file diff --git a/qusal/fedora-minimal/create.sls b/qusal/fedora-minimal/create.sls index 2307747..e669266 100644 --- a/qusal/fedora-minimal/create.sls +++ b/qusal/fedora-minimal/create.sls @@ -9,24 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ template.template_clean }}": - qvm.vm: - - name: {{ template.template_clean }} - - require: - - sls: {{ template.template_clean }}.clone - - present: - - label: black - - prefs: - - label: black - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - include_in_backups: False - - features: - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - "dvm-{{ fedora.fedora_minimal_template }}-absent": qvm.absent: - names: @@ -34,24 +16,46 @@ include: - fedora-minimal-dvm - {{ fedora.fedora_minimal_template }}-dvm -"dvm-{{ fedora.fedora_clean_minimal_template }}": - qvm.vm: - - name: dvm-fedora-minimal - - require: - - sls: templates.fedora-minimal.clone - - present: - - template: {{ fedora.fedora_minimal_template }} - - label: red - - prefs: - - template: {{ fedora.fedora_minimal_template }} - - label: red - - memory: 300 - - maxmem: 400 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- template: {{ fedora.fedora_minimal_template }} +- label: red +prefs: +- template: {{ fedora.fedora_minimal_template }} +- label: red +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/fedora/create.sls b/qusal/fedora/create.sls index 7bf350f..853184f 100644 --- a/qusal/fedora/create.sls +++ b/qusal/fedora/create.sls @@ -9,24 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ template.template_clean }}": - qvm.vm: - - name: {{ template.template_clean }} - - require: - - sls: {{ template.template_clean }}.clone - - present: - - label: black - - prefs: - - label: black - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - include_in_backups: False - - features: - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - "dvm-{{ template.template }}-absent": qvm.absent: - names: @@ -34,24 +16,46 @@ include: - fedora-dvm - {{ template.template }}-dvm -"dvm-{{ template.template_clean }}": - qvm.vm: - - name: dvm-{{ template.template_clean }} - - require: - - sls: {{ template.template_clean }}.clone - - present: - - template: {{ fedora.fedora_template }} - - label: red - - prefs: - - template: {{ fedora.fedora_template }} - - label: red - - memory: 300 - - maxmem: 400 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- template: {{ fedora.fedora_template }} +- label: red +prefs: +- template: {{ fedora.fedora_template }} +- label: red +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/media/create.sls b/qusal/media/create.sls index 71b415c..5c48a5c 100644 --- a/qusal/media/create.sls +++ b/qusal/media/create.sls @@ -10,72 +10,84 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: {{ template.template }} - - label: purple - - prefs: - - template: {{ template.template }} - - label: purple - - netvm: "" - - vcpus: 2 - - memory: 300 - - maxmem: 800 - - autostart: False - - include_in_backups: True - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: {{ template.template }} +- label: yellow +prefs: +- template: {{ template.template }} +- label: yellow +- netvm: "" +- vcpus: 2 +- memory: 300 +- maxmem: 800 +- autostart: False +- include_in_backups: True +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: purple - - prefs: - - template: tpl-{{ slsdotpath }} - - label: purple - - netvm: "" - - memory: 300 - - maxmem: 800 - - vcpus: 2 - - template_for_dispvms: True - - include_in_backups: False - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: yellow +prefs: +- template: tpl-{{ slsdotpath }} +- label: yellow +- netvm: "" +- memory: 300 +- maxmem: 800 +- vcpus: 2 +- template_for_dispvms: True +- include_in_backups: False +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} -"disp-{{ slsdotpath }}": - qvm.vm: - - name: disp-{{ slsdotpath }} - - present: - - template: dvm-{{ slsdotpath }} - - label: purple - - class: DispVM - - prefs: - - template: dvm-{{ slsdotpath }} - - label: purple - - vcpus: 2 - - netvm: "" - - memory: 300 - - maxmem: 800 - - autostart: False - - include_in_backups: False - - features: - - appemenus-dispvm: True - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy - - enable: - - service.shutdownle +{% load_yaml as defaults -%} +name: disp-{{ slsdotpath }} +force: True +require: +- qvm: dvm-{{ slsdotpath }} +present: +- template: dvm-{{ slsdotpath }} +- label: yellow +- class: DispVM +prefs: +- template: dvm-{{ slsdotpath }} +- label: yellow +- vcpus: 2 +- netvm: "" +- memory: 300 +- maxmem: 800 +- autostart: False +- include_in_backups: False +features: +- appemenus-dispvm: True +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +- enable: + - service.shutdownle +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-extend-private-volume": cmd.run: diff --git a/qusal/mgmt/create.sls b/qusal/mgmt/create.sls index f19a65f..874b61c 100644 --- a/qusal/mgmt/create.sls +++ b/qusal/mgmt/create.sls @@ -7,24 +7,28 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: black - - prefs: - - template: tpl-{{ slsdotpath }} - - label: black - - netvm: "" - - dispvm-allowed: True - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - autostart: False - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - internal +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: black +prefs: +- template: tpl-{{ slsdotpath }} +- label: black +- netvm: "" +- dispvm-allowed: True +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- autostart: False +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm + - internal +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/mutt/README.md b/qusal/mutt/README.md index f30525b..da923e8 100644 --- a/qusal/mutt/README.md +++ b/qusal/mutt/README.md @@ -48,3 +48,6 @@ You can define aliases in `~/.muttrc-aliases.local`. If you want to override any option, put the settings in `~/.muttrc.local`, as this is the last file to be sourced. + +If you want to have your e-mail signature (not PGP) at the end of every mail +you send, place it in `~/.signature`. diff --git a/qusal/mutt/configure.sls b/qusal/mutt/configure.sls index 8a36a1b..59c2367 100644 --- a/qusal/mutt/configure.sls +++ b/qusal/mutt/configure.sls @@ -9,15 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - dotfiles.copy-x11 - dotfiles.copy-sh - -"{{ slsdotpath }}-home-muttrc": - file.recurse: - - name: /home/user/.config/mutt - - source: salt://{{ slsdotpath }}/files/mutt - - file_mode: '0644' - - dir_mode: '0755' - - user: user - - group: user - - makedirs: True + - dotfiles.copy-mutt {% endif -%} diff --git a/qusal/mutt/create.sls b/qusal/mutt/create.sls index a122177..c10c929 100644 --- a/qusal/mutt/create.sls +++ b/qusal/mutt/create.sls @@ -7,29 +7,37 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - name: tpl-{{ slsdotpath }} - - features: - - set: - - menu-items: "mutt.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "mutt.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +features: +- set: + - menu-items: "mutt.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "mutt.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: yellow - - prefs: - - template: tpl-{{ slsdotpath }} - - label: yellow - - vpus: 1 - - memory: 200 - - maxmem: 350 - - autostart: False - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: yellow +prefs: +- template: tpl-{{ slsdotpath }} +- label: yellow +- vpus: 1 +- memory: 200 +- maxmem: 350 +- autostart: False +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/mutt/files/mutt/conf.d/bindings.muttrc b/qusal/mutt/files/mutt/conf.d/bindings.muttrc deleted file mode 100644 index 938bdf5..0000000 --- a/qusal/mutt/files/mutt/conf.d/bindings.muttrc +++ /dev/null @@ -1,86 +0,0 @@ -# SPDX-FileCopyrightText: 2019-2023 Luke Smith <luke@lukesmith.xyz> -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc - -bind index,pager i noop -bind index,pager g noop -bind index \Cf noop -bind index,pager M noop -bind index,pager C noop - -## General Vi rebindings -bind index gg first-entry -bind index j next-entry -bind index k previous-entry -bind attach <return> view-mailcap -bind attach l view-mailcap -bind editor <space> noop -bind index G last-entry -bind pager,attach h exit -bind pager j next-line -bind pager k previous-line -bind pager l view-attachments -bind index D delete-message -bind index U undelete-message -bind index L limit -bind index h noop -bind index l display-message -bind index,query <space> tag-entry -#bind browser h goto-parent -macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder" -#bind index,pager H view-raw-message # neomutt only -bind browser l select-entry -bind browser gg top-page -bind browser G bottom-page -bind pager gg top -bind pager G bottom -bind index,pager,browser d half-down -bind index,pager,browser u half-up -bind index,pager S sync-mailbox -bind index,pager R group-reply -bind index,pager W group-chat-reply -bind index \031 previous-undeleted # Mouse wheel -bind index \005 next-undeleted # Mouse wheel -bind pager \031 previous-line # Mouse wheel -bind pager \005 next-line # Mouse wheel -bind editor <Tab> complete-query - -macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox" -macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox" -macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox" -macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts" -macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts" -macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts" -macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" -macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" -macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" -macro index,pager gt "<change-folder>=Trash<enter>" "go to trash" -macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" -macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" -macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" -macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" -macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" -macro index,pager ga "<change-folder>=Archive<enter>" "go to archive" -macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive" -macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" - -## NotMuch -## https://man.archlinux.org/man/notmuch-mutt.1.en#INTEGRATION_WITH_MUTT -macro index <F8> \ -"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\ -<shell-escape>notmuch-mutt -r --prompt search<enter>\ -<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\ -<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \ - "notmuch: search mail" - -macro index <F9> \ -"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\ -<pipe-message>/usr/bin/notmuch-mutt -r thread<enter> \ -<change-folder-readonly>/home/user/.cache/notmuch/mutt/results<enter> \ -<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \ - "notmuch: reconstruct thread" - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/conf.d/colors.muttrc b/qusal/mutt/files/mutt/conf.d/colors.muttrc deleted file mode 100644 index 5db709e..0000000 --- a/qusal/mutt/files/mutt/conf.d/colors.muttrc +++ /dev/null @@ -1,116 +0,0 @@ -# SPDX-FileCopyrightText: 2019-2023 Luke Smith <luke@lukesmith.xyz> -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc - -color body green default "\`[^\`]*\`" # Green text between ` and ` -color body brightblue default "^# \.*" # Headings as bold blue -color body brightcyan default "^## \.*" # Subheadings as bold cyan -color body brightgreen default "^### \.*" # Subsubheadings as bold green -color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow -color body brightcyan default "[;:][-o][)/(|]" # emoticons -color body brightcyan default "[;:][)(|]" # emoticons -color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? -color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? -color body red default "(BAD signature)" -color body cyan default "(Good signature)" -color body brightblack default "^gpg: Good signature .*" -color body brightyellow default "^gpg: " -color body brightyellow red "^gpg: BAD signature from.*" -mono body bold "^gpg: Good signature" -mono body bold "^gpg: BAD signature from.*" - -## /usr/share/doc/mutt/examples/colors.angdraug -## This color scheme aims to highlight as much useful information as -## possible without spoiling user's visual experience by irritating -## contrasts. Optimized for dark or transparent background. -## --Dmitry Borodaenko <angdraug@mail.ru> - -## Override defaults, make transparency work -color normal white default -color attachment green default -color hdrdefault cyan default -color indicator black cyan -color markers brightred default -color quoted green default -color status brightwhite blue -color tilde brightblue default -color tree red default - -## Paint different quote levels -color quoted green default -color quoted1 cyan default -color quoted2 yellow default -color quoted3 red default - -color body brightblue default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # email -color body brightblue default "(http|ftp)://[\-\.\,/+=&%~_:?\#a-zA-Z0-9]+" # URL -color body brightgreen default "(^| |[-.[:alnum:]]+:+)~?\(/[-_.'[:alnum:]]+\)+/?" # Unix file path -color body brightgreen default "(^| +)[[:alpha:]]:[-_.[:alnum:]\]+" # DOS file path -color body brightmagenta default "(^|[ '\"]+)\\$[[:alpha:]][-_[:alpha:]]+" # variable -color body brightred default "(^| )[*_]+[-&[:alnum:]]+[*_]( |$)" # bold/underline -color body yellow default "(^| )[;:8ö][-^o]?[)>(|/\\]+" # smiley -color body red default "[!?]{3,}" # exclamation -color body green default "^ *[-+*o] +" # list item - -## Date formats -color body cyan default "[0-9]{1,2}:[0-9]{2}(:[0-9]{2})?( ?(AM|PM|am|pm))?( +[+-][0-9]{4})?" -color body cyan default "(\(19|20\)?[0-9]{2}/[01]?[0-9]/[0123]?[0-9]|[0123]?[0-9][/.][01]?[0-9][/.]\(19|20\)?[0-9]{2})(( at)? +[0-9]{1,2}:[0-9]{2}(:[0-9]{2})?( ?(AM|PM|am|pm))?( +[+-][0-9]{4})?)?" -color body cyan default "((Sun(day)?|Mon(day)?|Tue(sday)?|Wed(nesday)?|Thu(sday)?|Fri(day)?|Sat(urday)?),? +)?(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|June?|July?|Aug(ust)?|Sep(ember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?)[ .]+[0-9]{1,2}(st|nd|rd|th)?,?( +(19|20)[0-9]{2}(,?( at)? [0-9]{1,2}:[0-9]{2}(:[0-9]{2})?( ?(AM|PM|am|pm))?( +[+-][0-9]{4})?)?)?" -color body cyan default "((Sun(day)?|Mon(day)?|Tue(sday)?|Wed(nesday)?|Thu(sday)?|Fri(day)?|Sat(urday)?),? +)?[0-9]{1,2}(st|nd|rd|th)?[ .]+(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|June?|July?|Aug(ust)?|Sep(ember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?),?( +(19|20)?[0-9]{2})?(( at)? [0-9]{1,2}:[0-9]{2}(:[0-9]{2})?( ?(AM|PM|am|pm))?( +[+-][0-9]{4})?)?" - -color header brightgreen default ^From: -color header brightcyan default ^To: -color header brightcyan default ^Reply-To: -color header brightcyan default ^Cc: -color header brightblue default ^Subject: - -color header brightcyan default "^newsgroups: " -color header yellow default "^Delivered-To: " -color header green default "^sender: " -color header green default "^organi[sz]ation: " -color header green default "x-editor: " -color header green default "(x-mailer|user-agent): " -color header green default "X-Operating-System: " -color header green default "X-MimeOLE: " -color header green default "X-Accept-Language: " -color header red default "^message:" -color header red default "^in-reply-to: " -color header red default "^references: " -color header cyan default "^followup-to: " -color header cyan default "^mail-followup-to: " -color header cyan default "^reply-to: " -color header magenta default "MIME-Version: " -color header magenta default "Content-Type: " -color header magenta default "Content-Transfer-Encoding: " -color header magenta default "Content-Disposition: " -color header magenta default "Content-Encoding: " -color header magenta default "Content-Language: " - -## Personal colors -color index brightwhite default '~A' # all -color index red default '~D' # deleted -color index brightred default '~F' # flagged -color index green default '~N' # new -color index yellow default '~T' # tagged -color index green default '~U' # unread -color index blue default '~V' # crypt verified - -## Threads -#color index brightyellow default "~h 'References: +<.+>'" -#color index yellow default "~h 'References: +<.+> +<.+>'" -#color index brightred default "~h 'References: +<.+> +<.+> +<.+>'" -#color index red default "~h 'References: +<.+> +<.+> +<.+> +<.+>'" -#color index blue default "~h 'References: +<.+> +<.+> +<.+> +<.+> +<.+>'" -#color index green default "~h 'References: +<.+> +<.+> +<.+> +<.+> +<.+> +<.+>'" - -## spam -color index magenta default "\(Resent-\)?Message-Id: <>" -color index magenta default "\(Resent-\)?Message-Id: '<.* .*>'" -color index magenta default "\(Resent-\)?Message-Id: localhost" -color index magenta default "! \(Resent-\)?Message-Id: @" -color index magenta default '~C Undisclosed.*Recipients' - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/conf.d/lists.muttrc b/qusal/mutt/files/mutt/conf.d/lists.muttrc deleted file mode 100644 index 53bcf15..0000000 --- a/qusal/mutt/files/mutt/conf.d/lists.muttrc +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: 2019 The Qubes OS Project <https://www.qubes-os.org> -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## Lists -lists .*@googlegroups\\.com -subscribe qubes-(announce|devel)@googlegroups\\.com -fcc-save-hook qubes-annount@googlegroups\\.com =list/qubes-announce/ -fcc-save-hook qubes-devel@googlegroups\\.com =list/qubes-devel/ - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/conf.d/mailbox.muttrc b/qusal/mutt/files/mutt/conf.d/mailbox.muttrc deleted file mode 100644 index 20a50b9..0000000 --- a/qusal/mutt/files/mutt/conf.d/mailbox.muttrc +++ /dev/null @@ -1,51 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## Misc -set mbox_type = Maildir -set quit = ask-yes -set sleep_time = 0 -set wait_key = no -set nobeep -set sort_alias = alias -set followup_to = yes -set honor_followup_to = yes - -## Reading -set mark_old = no -set date_format = "%y-%m-%d %T" -set index_format = "%4C %Z %D %-8.8n %-12.12L (%4l) %s" -set sort = "reverse-threads" -set sort_aux = "last-date-received" -set content_type = "text/plain" -set charset = "utf-8" -set pager_index_lines = 10 -set my_editor = "vim -c 'setf mail' " -set editor = "$my_editor " - -## Composing -set fast_reply = yes -set edit_headers = yes -set copy = yes -set send_charset = "us-ascii:utf-8" -set abort_nosubject = ask-yes -set sig_dashes = yes -set signature = "~/.signature" -set alias_file = "~/.muttrc-aliases.local" -set fcc_attach -set reverse_name -set include -set mime_forward = no -set forward_format = "Fwd: %s" -set forward_quote - -## Cache -set mbox = "~/.cache/mutt/archived" -set record = "~/.cache/mutt/sent" -set postponed = "~/.cache/mutt/postponed" -set header_cache = "~/.cache/mutt/headers" -set message_cachedir = "~/.cache/mutt/messages" -set certificate_file = "~/.cache/mutt/certificates" - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/conf.d/pgp.muttrc b/qusal/mutt/files/mutt/conf.d/pgp.muttrc deleted file mode 100644 index 6661da0..0000000 --- a/qusal/mutt/files/mutt/conf.d/pgp.muttrc +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: 2020 The Qubes OS Project <https://www.qubes-os.org> -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## Credits: https://github.com/Qubes-Community/Contents/blob/master/docs/configuration/mutt.md - -## Hooks -send-hook "~A" "set pgp_autoinline=no" -send-hook "~t @invisiblethingslab\\.com" "set pgp_autoinline=yes crypt_autoencrypt=yes" -send-hook "~t @googlegroups\\.com" "set pgp_autoinline=yes crypt_autoencrypt=no" -send-hook "~t $from" "set pgp_autoinline=yes" - -## General Encryption and Signature -set crypt_autopgp = yes # Use PGP for encryption -set crypt_autoencrypt = no # Encryption is user preference -set crypt_autosign = yes # Sign all messages -set crypt_replyencrypt = yes # Encrypt replies to encrypted messages -set crypt_replysignencrypted = yes # Sign replies to encrypted messages -set crypt_verify_sig = yes # Verify the opened message signature -set crypt_use_gpgme = no # GPGME interferes with split-gpg - -## PGP -set pgp_autoinline = no # Inline is user preference -set pgp_use_gpg_agent = yes # Avoid prompting for a passphrase -set pgp_timeout = 600 # Seconds to linger passphrase in mememory -set pgp_good_sign = "^\\[GNUPG:\\] GOODSIG" -set pgp_list_pubring_command = "qubes-gpg-client-wrapper --no-verbose --batch --quiet --with-colons --list-keys %r" -set pgp_list_secring_command = "qubes-gpg-client-wrapper --no-verbose --batch --quiet --with-colons --list-secret-keys %r" -set pgp_decode_command = "qubes-gpg-client-wrapper -d --status-fd=2 --batch %f" -set pgp_decrypt_command = "$pgp_decode_command" -set pgp_verify_command = "qubes-gpg-client-wrapper --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" -set pgp_sign_command = "qubes-gpg-client-wrapper --batch --armor --detach-sign --textmode %?a?-u %a? %f" -set pgp_clearsign_command = "qubes-gpg-client-wrapper --batch --armor --textmode --clearsign %?a?-u %a? %f" -set pgp_encrypt_only_command = "/usr/lib/mutt/pgpewrap qubes-gpg-client-wrapper --batch --textmode --armor --always-trust %?a?--encrypt-to %a? --encrypt -- -r %r -- %f | sed -e '2iCharset: UTF-8'" -set pgp_encrypt_sign_command = "/usr/lib/mutt/pgpewrap qubes-gpg-client-wrapper --batch --textmode --armor --always-trust %?a?--encrypt-to %a? --encrypt --sign %?a?-u %a? -- -r %r -- %f | sed -e '2iCharset: UTF-8'" -set pgp_import_command = "qubes-gpg-import-key %f; gpg --no-verbose --import %f" -set pgp_export_command = "qubes-gpg-client-wrapper --no-verbose --export --armor %r" -set pgp_verify_key_command = "gpg --no-verbose --batch --fingerprint --check-sigs %r" - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/conf.d/server.muttrc b/qusal/mutt/files/mutt/conf.d/server.muttrc deleted file mode 100644 index b42b719..0000000 --- a/qusal/mutt/files/mutt/conf.d/server.muttrc +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Qusal contributors -# -# SPDX-License-Identifier: GPL-3.0-or-later - -## IMAP -set folder = "imaps://imap.$my_server" -set spoolfile = "+INBOX" -set imap_user = "$my_user" -set imap_pass = "$my_pass" -set imap_check_subscribed -set mail_check = 120 - -## POP3 -set pop_host = "pops://pop.$my_server" -set pop_user = "$my_user" -set pop_pass = "$my_pass" -set pop_checkinterval = 120 -set pop_delete = ask-no -set pop_last = yes - -## SMTP -set smtp_url = "smtps://$my_user@smtp.$my_server" -## GMail duplicates sent mails if the 'record' option is set. -#set record = "+Sent" -unset record -set smtp_pass = "$my_pass" -set realname = "$my_name" -set from = "$my_user@$my_server" -set use_from = yes -set ssl_starttls = yes -set ssl_force_tls = yes - -## Alias -alias me $realname <$from> - -## vim: ft=muttrc diff --git a/qusal/mutt/files/mutt/muttrc b/qusal/mutt/files/mutt/muttrc deleted file mode 100644 index 21854e4..0000000 --- a/qusal/mutt/files/mutt/muttrc +++ /dev/null @@ -1,16 +0,0 @@ -## SPDX-FileCopyrightText: 2023 Qusal contributors -## -## SPDX-License-Identifier: GPL-3.0-or-later - -## Source configuration -cd ~/.config/mutt -source ~/.muttrc-credentials.local -source conf.d/server.muttrc -source conf.d/mailbox.muttrc -source conf.d/pgp.muttrc -source conf.d/bindings.muttrc -source conf.d/colors.muttrc -source conf.d/lists.muttrc -source ~/.muttrc-aliases.local -source ~/.muttrc.local -## vim: ft=muttrc diff --git a/qusal/mutt/install.sls b/qusal/mutt/install.sls index 53e16cf..dab5a5c 100644 --- a/qusal/mutt/install.sls +++ b/qusal/mutt/install.sls @@ -9,6 +9,7 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - dotfiles.copy-x11 - dotfiles.copy-sh + - dotfiles.copy-mutt "{{ slsdotpath }}-updated": pkg.uptodate: @@ -50,14 +51,4 @@ include: - libauthen-sasl-perl - libio-socket-ssl-perl -"{{ slsdotpath }}-skel-muttrc": - file.recurse: - - name: /etc/skel/.config/mutt - - source: salt://{{ slsdotpath }}/files/mutt - - file_mode: '0644' - - dir_mode: '0755' - - user: root - - group: root - - makedirs: True - {% endif -%} diff --git a/qusal/qubes-builder/create.sls b/qusal/qubes-builder/create.sls index ffcd9ff..f858c0c 100644 --- a/qusal/qubes-builder/create.sls +++ b/qusal/qubes-builder/create.sls @@ -7,49 +7,55 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - vpus: 2 - - memory: 400 - - maxmem: 2000 - - autostart: False - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- vpus: 2 +- memory: 400 +- maxmem: 2000 +- autostart: False +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - label: gray - - memory: 800 - - maxmem: 8000 - - vcpus: 4 - - default_dispvm: dvm-{{ slsdotpath }} - - features: - # - enable: - # - service.split-gpg2-client - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- label: gray +- memory: 800 +- maxmem: 8000 +- vcpus: 4 +- default_dispvm: dvm-{{ slsdotpath }} +features: +# - enable: +# - service.split-gpg2-client +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-extend-private-volume": cmd.run: @@ -59,7 +65,7 @@ include: "dvm-{{ slsdotpath }}-extend-private-volume": cmd.run: - - name: qvm-volume extend dvm-{{ slsdotpath }}:private 40Gi + - name: qvm-volume extend dvm-{{ slsdotpath }}:private 30Gi - require: - qvm: dvm-{{ slsdotpath }} diff --git a/qusal/qubes-builder/files/rpc/qubesbuilder.FileCopyIn b/qusal/qubes-builder/files/rpc/qubesbuilder.FileCopyIn index 62347a4..6c43e2d 100755 --- a/qusal/qubes-builder/files/rpc/qubesbuilder.FileCopyIn +++ b/qusal/qubes-builder/files/rpc/qubesbuilder.FileCopyIn @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/usr/bin/bash # SPDX-FileCopyrightText: 2022 - 2023 The Qubes OS Project <https://www.qubes-os.org> # @@ -7,5 +7,5 @@ set -e sudo bash -c "mkdir -p /builder/incoming && chown -R user:user /builder" - -exec /usr/lib/qubes/qfile-unpacker "$(id -u user)" "/builder/incoming" +id="$(id -u user)" +exec /usr/lib/qubes/qfile-unpacker "${id}" "/builder/incoming" diff --git a/qusal/reader/create.sls b/qusal/reader/create.sls index a1d7df5..26790ba 100644 --- a/qusal/reader/create.sls +++ b/qusal/reader/create.sls @@ -8,41 +8,45 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: tpl-{{ slsdotpath }} - - prefs: - - memory: 300 - - maxmem: 2000 - - features: - - set: - - default-menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop libreoffice-base.desktop libreoffice-calc.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-math.desktop libreoffice-startcenter.desktop libreoffice-writer.desktop org.gnome.Evince.desktop qubes-open-file-manager.desktop" - - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop libreoffice-base.desktop libreoffice-calc.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-math.desktop libreoffice-startcenter.desktop libreoffice-writer.desktop org.gnome.Evince.desktop qubes-open-file-manager.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +prefs: +- memory: 300 +- maxmem: 2000 +features: +- set: + - default-menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop libreoffice-base.desktop libreoffice-calc.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-math.desktop libreoffice-startcenter.desktop libreoffice-writer.desktop org.gnome.Evince.desktop qubes-open-file-manager.desktop" + - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop libreoffice-base.desktop libreoffice-calc.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-math.desktop libreoffice-startcenter.desktop libreoffice-writer.desktop org.gnome.Evince.desktop qubes-open-file-manager.desktop" +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - qvm: tpl-{{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - netvm: "" - - memory: 400 - - maxmem: 700 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- qvm: tpl-{{ slsdotpath }} +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- netvm: "" +- memory: 400 +- maxmem: 700 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-set-default_dispvm": cmd.run: diff --git a/qusal/remmina/create.sls b/qusal/remmina/create.sls index 6335274..2057c9c 100644 --- a/qusal/remmina/create.sls +++ b/qusal/remmina/create.sls @@ -7,56 +7,62 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - name: tpl-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - features: - - set: - - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +features: +- set: + - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: orange - - prefs: - - template: tpl-{{ slsdotpath }} - - label: orange - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: orange +prefs: +- template: tpl-{{ slsdotpath }} +- label: orange +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: orange - - prefs: - - template: tpl-{{ slsdotpath }} - - label: orange - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - include_in_backups: False - - features: - - disable: - - service.cups - - service.cups-browsed - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: orange +prefs: +- template: tpl-{{ slsdotpath }} +- label: orange +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- disable: + - service.cups + - service.cups-browsed +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop org.remmina.Remmina.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/signal/create.sls b/qusal/signal/create.sls index 537f666..2393ed0 100644 --- a/qusal/signal/create.sls +++ b/qusal/signal/create.sls @@ -8,37 +8,42 @@ include: - .clone - .firewall -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: yellow - - prefs: - - template: tpl-{{ slsdotpath }} - - label: yellow - - vpus: 1 - - memory: 400 - - maxmem: 600 - - autostart: False - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +features: +- set: + - menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} -"set-tpl-{{ slsdotpath }}-appmenus": - qvm.features: - - name: tpl-{{ slsdotpath }} - - set: - - menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" - -"set-{{ slsdotpath }}-appmenus": - qvm.features: - - name: {{ slsdotpath }} - - set: - - menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: yellow +prefs: +- template: tpl-{{ slsdotpath }} +- label: yellow +- vpus: 1 +- memory: 400 +- maxmem: 600 +- autostart: False +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +- set: + - menu-items: "signal-desktop.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} {% from 'utils/macros/sync-appmenus.sls' import sync_appmenus with context -%} {{ sync_appmenus('tpl-' ~ sls_path) }} diff --git a/qusal/ssh/create.sls b/qusal/ssh/create.sls index 6ca7247..e4a032b 100644 --- a/qusal/ssh/create.sls +++ b/qusal/ssh/create.sls @@ -7,45 +7,51 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - vpus: 1 - - memory: 400 - - maxmem: 500 - - autostart: False - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- vpus: 1 +- memory: 400 +- maxmem: 500 +- autostart: False +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - vpus: 1 - - memory: 400 - - maxmem: 500 - - autostart: False - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - appmenus-dispvm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- vpus: 1 +- memory: 400 +- maxmem: 500 +- autostart: False +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/ssh/install.sls b/qusal/ssh/install.sls index aa88252..499c11b 100644 --- a/qusal/ssh/install.sls +++ b/qusal/ssh/install.sls @@ -7,8 +7,6 @@ SPDX-License-Identifier: GPL-3.0-or-later {% if grains['nodename'] != 'dom0' -%} include: - - dotfiles.copy-x11 - - dotfiles.copy-ssh - sys-ssh-agent.install-client {% endif -%} diff --git a/qusal/sys-cacher/create.sls b/qusal/sys-cacher/create.sls index cb0cbae..df53a2e 100644 --- a/qusal/sys-cacher/create.sls +++ b/qusal/sys-cacher/create.sls @@ -7,29 +7,31 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - label: gray - - memory: 300 - - maxmem: 600 - - vcpus: 1 - - provides-network: true - - features: - - enable: - - servicevm - - service.shutdown-idle - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- label: gray +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- provides-network: true +features: +- enable: + - servicevm + - service.shutdown-idle +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} {% from 'utils/macros/policy.sls' import policy_set with context -%} {{ policy_set(sls_path, '75') }} diff --git a/qusal/sys-firewall/create.sls b/qusal/sys-firewall/create.sls index c9e59a6..2f54fda 100644 --- a/qusal/sys-firewall/create.sls +++ b/qusal/sys-firewall/create.sls @@ -15,77 +15,83 @@ include: {% set netvm = default_netvm %} {% endif -%} -"{{ slsdotpath }}": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: orange - - prefs: - - template: tpl-{{ slsdotpath }} - - label: orange - - memory: 300 - - maxmem: 400 - - netvm: {{ netvm }} - - vcpus: 1 - - provides-network: True - - include_in_backups: False - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: orange +prefs: +- template: tpl-{{ slsdotpath }} +- label: orange +- memory: 300 +- maxmem: 400 +- netvm: {{ netvm }} +- vcpus: 1 +- provides-network: True +- include_in_backups: False +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: orange - - prefs: - - template: tpl-{{ slsdotpath }} - - label: orange - - netvm: {{ netvm }} - - memory: 300 - - maxmem: 400 - - vcpus: 1 - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - servicevm - - disable: - - appmenus-dispvm - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: orange +prefs: +- template: tpl-{{ slsdotpath }} +- label: orange +- netvm: {{ netvm }} +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - servicevm +- disable: + - appmenus-dispvm + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} -"disp-{{ slsdotpath }}": - qvm.vm: - - require: - - qvm: dvm-{{ slsdotpath }} - - name: disp-{{ slsdotpath }} - - present: - - template: dvm-{{ slsdotpath }} - - label: orange - - class: DispVM - - prefs: - - template: dvm-{{ slsdotpath }} - - label: orange - - netvm: {{ netvm }} - - memory: 300 - - maxmem: 400 - - vcpus: 1 - - provides-network: True - - autostart: False - - include_in_backups: False - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: disp-{{ slsdotpath }} +force: True +require: +- qvm: dvm-{{ slsdotpath }} +present: +- template: dvm-{{ slsdotpath }} +- label: orange +- class: DispVM +prefs: +- template: dvm-{{ slsdotpath }} +- label: orange +- netvm: {{ netvm }} +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- provides-network: True +- autostart: False +- include_in_backups: False +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/sys-git/README.md b/qusal/sys-git/README.md index aba51b8..7a23f4d 100644 --- a/qusal/sys-git/README.md +++ b/qusal/sys-git/README.md @@ -68,8 +68,9 @@ _Default policy_: `any qube` can `ask` via the `@default` target if you allow it to `Fetch` from, `Push` to and `Init` on `sys-git`. __Recommended usage__: -- __Init__: Simply usability, if you don't like this action, - use the deny rule instead and create the directory manually. + +- __Init__: Argument useful when allowing a qube to always create a + repository on the server. - __Fetch__: Fetch can be allowed by less trusted qubes. - __Push__: Push should only be made by trusted qubes. diff --git a/qusal/sys-git/create.sls b/qusal/sys-git/create.sls index ba1bf09..d31f67c 100644 --- a/qusal/sys-git/create.sls +++ b/qusal/sys-git/create.sls @@ -7,27 +7,32 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - label: gray - - netvm: "" - - vcpus: 1 - - memory: 200 - - maxmem: 300 - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- label: gray +- netvm: "" +- vcpus: 1 +- memory: 200 +- maxmem: 300 +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +# tags: +# - add: +# - split-gpg2-client +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-resize-private-volume": cmd.run: diff --git a/qusal/sys-git/files/client/git-core/git-init-qrexec b/qusal/sys-git/files/client/git-core/git-init-qrexec index fe1728c..a95a261 100755 --- a/qusal/sys-git/files/client/git-core/git-init-qrexec +++ b/qusal/sys-git/files/client/git-core/git-init-qrexec @@ -7,24 +7,47 @@ set -eu usage(){ - echo "usage: ${helper} [<QUBE>]" - echo "example: ${helper} @default" + echo "Usage: ${helper} [<qube>] [<repository>]" + echo "Note: qube defaults to '@default' and repository to the current repository" exit 1 } +is_git_repo(){ + if ! git rev-parse --show-toplevel >/dev/null 2>&1; then + echo "Error: Either run from inside a git repository or provide it as an argument" >&2 + usage + fi +} + helper="${0##*/git-}" case "${1-}" in -h|--?help) usage;; - *) qube="${1:-"@default"}";; + "") qube="@default";; + *) qube="${1}";; +esac +case "${2-}" in + "") is_git_repo; repo="$(basename "$(git rev-parse --show-toplevel)")";; + *) repo="${2}";; esac -if ! git rev-parse --show-toplevel >/dev/null 2>&1; then - echo "This command must be run from inside a git repository." >&2 - usage +rpc="GitInit" +vendor="qusal" +default_qube="sys-git" +rpc_cmd="${vendor}.${rpc}+${repo}" + +if command -v qrexec-client-vm >/dev/null; then + exec qrexec-client-vm -- "${qube}" "${rpc_cmd}" +elif command -v qrexec-client >/dev/null; then + qubes_version="$(awk -F '=' '/^VERSION_ID=/{print $2}' /etc/os-release)" + if test "$(echo "${qubes_version}" | tr -d ".")" -le 41; then + if test "${qube}" = "@default"; then + qube="${default_qube}" + fi + else + policy="$(qrexec-policy --assume-yes-for-ask dom0 "${qube}" "${rpc_cmd}")" + qube="$(echo "${policy}" | awk -F '=' '/^target=/{print $2}')" + fi + exec qrexec-client -d "${qube}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0" +else + die "Qrexec programs not found: qrexec-client-vm, qrexec-client" fi - -repo="$(basename "$(git rev-parse --show-toplevel)")" -rpc=GitInit - -## TODO: Support Dom0 client -exec qrexec-client-vm -- "${qube}" "qusal.${rpc}+${repo}" diff --git a/qusal/sys-git/files/client/git-core/git-remote-qrexec b/qusal/sys-git/files/client/git-core/git-remote-qrexec index f61e40b..8563219 100755 --- a/qusal/sys-git/files/client/git-core/git-remote-qrexec +++ b/qusal/sys-git/files/client/git-core/git-remote-qrexec @@ -12,12 +12,12 @@ set -eu usage(){ - echo "usage: ${helper} <remote> [${scheme}://<authority>/<path>]" >&2 + echo "Usage: ${helper} <remote> [${scheme}://<authority>/<path>]" >&2 } die(){ usage - echo "error: ${1}" >&2 + echo "Error: ${1}" >&2 exit 1 } diff --git a/qusal/sys-git/files/client/git-core/git-remote-qrexec-connect b/qusal/sys-git/files/client/git-core/git-remote-qrexec-connect index 1427e6e..2afb569 100755 --- a/qusal/sys-git/files/client/git-core/git-remote-qrexec-connect +++ b/qusal/sys-git/files/client/git-core/git-remote-qrexec-connect @@ -7,13 +7,28 @@ ## Should be called by git-remote-qrexec. set -eu -die(){ - echo "error: ${1}" >&2 +usage(){ + echo "Usage: ${helper} git-upload-pack|git-receive-pack <qube>/<path>" + echo "Note: ${helper} is supposed to be called by ${parent_helper}" exit 1 } -arg="${1?}" -url="${2?}" +die(){ + echo "Error: ${1}" >&2 + exit 1 +} + +helper="${0##*/git-}" +parent_helper="${helper%-*}" + +case "${1-}" in + -h|--?help|"") usage;; + *) arg="${1}";; +esac +case "${2-}" in + "") usage;; + *) url="${2}";; +esac case "${arg}" in git-upload-pack) rpc=GitFetch;; @@ -24,14 +39,24 @@ esac qube="$(echo "${url}" | cut -d "/" -f1)" repo="$(echo "${url}" | cut -d "/" -f2-)" +test -n "${repo}" || die "Repository name can't be empty" +vendor="qusal" +default_qube="sys-git" +rpc_cmd="${vendor}.${rpc}+${repo}" -if ! command -v -- qrexec-client-vm >/dev/null; then - die "Command not found: 'qrexec-client-vm'" +if command -v qrexec-client-vm >/dev/null; then + exec qrexec-client-vm -- "${qube}" "${rpc_cmd}" +elif command -v qrexec-client >/dev/null; then + qubes_version="$(awk -F '=' '/^VERSION_ID=/{print $2}' /etc/os-release)" + if test "$(echo "${qubes_version}" | tr -d ".")" -le 41; then + if test "${qube}" = "@default"; then + qube="${default_qube}" + fi + else + policy="$(qrexec-policy --assume-yes-for-ask dom0 "${qube}" "${rpc_cmd}")" + qube="$(echo "${policy}" | awk -F '=' '/^target=/{print $2}')" + fi + exec qrexec-client -d "${qube}" -- "DEFAULT:QUBESRPC ${rpc_cmd} dom0" +else + die "Qrexec programs not found: qrexec-client-vm, qrexec-client" fi - -if test -z "${repo}"; then - die "Repository definition can't be empty" -fi - -## TODO: Support Dom0 client -exec qrexec-client-vm -- "${qube}" "qusal.${rpc}+${repo}" diff --git a/qusal/sys-git/install-client.sls b/qusal/sys-git/install-client.sls index 89dd367..ead1072 100644 --- a/qusal/sys-git/install-client.sls +++ b/qusal/sys-git/install-client.sls @@ -6,7 +6,9 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - dotfiles.copy-git + - dotfiles.copy-sh - dotfiles.copy-x11 + - sys-pgp.install-client "{{ slsdotpath }}-updated": pkg.uptodate: @@ -20,10 +22,13 @@ include: - pkgs: - git +{% set git_exec_path = salt['cmd.shell']('git --exec-path') -%} "{{ slsdotpath }}-install-client-git-core-dir": file.recurse: + - require: + - pkg: {{ slsdotpath }}-installed - source: salt://{{ slsdotpath }}/files/client/git-core - - name: /usr/lib/git-core + - name: {{ git_exec_path }} - file_mode: '0755' - dir_mode: '0755' - user: root diff --git a/qusal/sys-git/install.sls b/qusal/sys-git/install.sls index ec4e04d..6871799 100644 --- a/qusal/sys-git/install.sls +++ b/qusal/sys-git/install.sls @@ -8,7 +8,9 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - dotfiles.copy-git + - dotfiles.copy-sh - dotfiles.copy-x11 + - sys-pgp.install-client "{{ slsdotpath }}-updated": pkg.uptodate: diff --git a/qusal/sys-net/create.sls b/qusal/sys-net/create.sls index 8a95db8..b11dcff 100644 --- a/qusal/sys-net/create.sls +++ b/qusal/sys-net/create.sls @@ -9,93 +9,99 @@ include: {% set net_pcidevs = salt['grains.get']('pci_net_devs', []) -%} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - netvm: "" - - memory: 0 - - maxmem: 400 - - vcpus: 1 - - virt_mode: hvm - - autostart: False - - provides-network: True - # - pcidevs: [ '03:00.0', '00:19.0' ] - - pcidevs: {{ net_pcidevs|yaml }} - - pci_strictreset: False - - include_in_backups: False - - features: - - enable: - - servicevm - - service.qubes-updates-proxy - - service.clocksync - - disable: - - service.cups - - service.cups-browsed - - service.meminfo-writer +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- netvm: "" +- memory: 0 +- maxmem: 400 +- vcpus: 1 +- virt_mode: hvm +- autostart: False +- provides-network: True +# - pcidevs: [ '03:00.0', '00:19.0' ] +- pcidevs: {{ net_pcidevs|yaml }} +- pci_strictreset: False +- include_in_backups: False +features: +- enable: + - servicevm + - service.qubes-updates-proxy + - service.clocksync +- disable: + - service.cups + - service.cups-browsed + - service.meminfo-writer +{%- endload %} +{{ load(defaults) }} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - netvm: "" - - memory: 0 - - maxmem: 400 - - vcpus: 1 - - virt_mode: hvm - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - servicevm - - service.qubes-updates-proxy - - service.clocksync - - disable: - - appmenus-dispvm - - service.cups - - service.cups-browsed - - service.meminfo-writer +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- netvm: "" +- memory: 0 +- maxmem: 400 +- vcpus: 1 +- virt_mode: hvm +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - servicevm + - service.qubes-updates-proxy + - service.clocksync +- disable: + - appmenus-dispvm + - service.cups + - service.cups-browsed + - service.meminfo-writer +{%- endload %} +{{ load(defaults) }} -"disp-{{ slsdotpath }}": - qvm.vm: - - name: disp-{{ slsdotpath }} - - require: - - qvm: dvm-{{ slsdotpath }} - - present: - - template: dvm-{{ slsdotpath }} - - label: red - - class: DispVM - - prefs: - - template: dvm-{{ slsdotpath }} - - label: red - - netvm: "" - - autostart: False - - provides-network: True - # - pcidevs: [ '03:00.0', '00:19.0' ] - - pcidevs: {{ net_pcidevs|yaml }} - - pci_strictreset: False - - include_in_backups: False - - features: - - enable: - - servicevm - - service.qubes-updates-proxy - - service.clocksync - - disable: - - appmenus-dispvm - - service.cups - - service.cups-browsed - - service.meminfo-writer +{% load_yaml as defaults -%} +name: disp-{{ slsdotpath }} +force: True +require: +- qvm: dvm-{{ slsdotpath }} +present: +- template: dvm-{{ slsdotpath }} +- label: red +- class: DispVM +prefs: +- template: dvm-{{ slsdotpath }} +- label: red +- netvm: "" +- autostart: False +- provides-network: True +# - pcidevs: [ '03:00.0', '00:19.0' ] +- pcidevs: {{ net_pcidevs|yaml }} +- pci_strictreset: False +- include_in_backups: False +features: +- enable: + - servicevm + - service.qubes-updates-proxy + - service.clocksync +- disable: + - appmenus-dispvm + - service.cups + - service.cups-browsed + - service.meminfo-writer +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/sys-net/prefs-disp.sls b/qusal/sys-net/prefs-disp.sls index 2bc67ba..9abbd98 100644 --- a/qusal/sys-net/prefs-disp.sls +++ b/qusal/sys-net/prefs-disp.sls @@ -8,7 +8,7 @@ include: - .create {% set default_netvm = salt['cmd.shell']('qubes-prefs default_netvm') -%} -"disp-{{ slsdotpath }}-set-{{ default_netvm }}-netvm": +"default_netvm-netvm-disp-{{ slsdotpath }}": qvm.vm: - require: - qvm: disp-{{ slsdotpath }} @@ -16,7 +16,7 @@ include: - prefs: - netvm: disp-{{ slsdotpath }} -"disp-{{ slsdotpath }}-clockvm": +"clockvm-disp-{{ slsdotpath }}": cmd.run: - require: - qvm: disp-{{ slsdotpath }} diff --git a/qusal/sys-net/prefs.sls b/qusal/sys-net/prefs.sls index da0a6d2..40e7bbc 100644 --- a/qusal/sys-net/prefs.sls +++ b/qusal/sys-net/prefs.sls @@ -8,7 +8,7 @@ include: - .create {% set default_netvm = salt['cmd.shell']('qubes-prefs default_netvm') -%} -"{{ slsdotpath }}-set-{{ default_netvm }}-netvm": +"default_netvm-netvm-{{ slsdotpath }}": qvm.vm: - require: - qvm: {{ slsdotpath }} @@ -16,7 +16,7 @@ include: - prefs: - netvm: {{ slsdotpath }} -"{{ slsdotpath }}-clockvm": +"clockvm-{{ slsdotpath }}": cmd.run: - require: - qvm: {{ slsdotpath }} diff --git a/qusal/sys-pgp/create.sls b/qusal/sys-pgp/create.sls index 458cb4a..c8232ba 100644 --- a/qusal/sys-pgp/create.sls +++ b/qusal/sys-pgp/create.sls @@ -7,26 +7,28 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}-create": - qvm.vm: - - require: - - sls: {{ slsdotpath }}.clone - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - netvm: "" - - memory: 200 - - maxmem: 300 - - vcpus: 1 - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- netvm: "" +- memory: 200 +- maxmem: 300 +- vcpus: 1 +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} {% from 'utils/macros/policy.sls' import policy_set with context -%} {{ policy_set(sls_path, '80') }} diff --git a/qusal/sys-pgp/install.sls b/qusal/sys-pgp/install.sls index bea7aaa..6e07828 100644 --- a/qusal/sys-pgp/install.sls +++ b/qusal/sys-pgp/install.sls @@ -22,10 +22,21 @@ include: - split-gpg2 - qubes-gpg-split - gnupg2 - {% if grains['os_family']|lower == 'debian' -%} - - sq - {% elif grains['os_family']|lower == 'redhat' -%} - - sequoia-sq - {% endif -%} + +{% set pkg = { + 'Debian': { + 'pkg': ['sq'], + }, + 'RedHat': { + 'pkg': ['sequoia-sq'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} {% endif -%} diff --git a/qusal/sys-pihole/README.md b/qusal/sys-pihole/README.md index 1692781..59f0533 100644 --- a/qusal/sys-pihole/README.md +++ b/qusal/sys-pihole/README.md @@ -24,32 +24,34 @@ to it. - Top: ```sh -qubesctl top.enable sys-pihole -qubesctl --targets=sys-pihole state.apply -qubesctl top.disable sys-pihole +qubesctl top.enable sys-pihole browser +qubesctl --targets=tpl-browser,sys-pihole,dvm-sys-pihole state.apply +qubesctl top.disable sys-pihole browser +qubesctl state.apply browser.appmenus ``` - State: ```sh qubesctl state.apply sys-pihole.create +qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install qubesctl --skip-dom0 --targets=sys-pihole state.apply sys-pihole.install +qubesctl --skip-dom0 --targets=dvm-browser-sys-pihole state.apply sys-pihole.install +qubesctl state.apply browser.appmenus ``` -If you want to change the `updatevm` and `default_netvm` and the `netvm` of -all qubes from `sys-firewall` to `sys-pihole`, run: +If you want to change the global preferences `updatevm` and `default_netvm` +and the per-qube preference `netvm` of all qubes from `sys-firewall` to +`sys-pihole`, run: ```sh qubesctl state.apply sys-pihole.prefs ``` ## Usage -You can clone sys-pihole. If you do, you must manually change the IP address -of the clone. - -If you want to use Tor, then you should reconfigure your netvm chaining (will -break tor's client stream isolation): - -- qube -> sys-pihole -> Tor-gateway -> sys-firewall -> sys-net +Two qubes will be created for usage. You should run the `pihole` program in +`sys-pihole`. If you want to view statistics or manage Pi-Hole through the +browser, open the browser in `disp-browser-sys-pihole`. The URL will be given +below. Pi-hole will be installed with these default settings: @@ -61,11 +63,19 @@ You can change these settings via the admin interface: - URL: http://localhost/admin - default password: `UpSNQsy4` -You should change this password on first use by running: +You should change this password on first use by running in `sys-pihole`: ```sh pihole -a -p ``` +You can clone `sys-pihole`. If you do, you must manually change the IP address +of the clone. + +If you want to combine Pi-Hole with Tor, then you should reconfigure your +netvm chaining (will break tor's client stream isolation) as such: + +- qube -> sys-pihole -> Tor-gateway -> sys-firewall -> sys-net + ## Credits - [Patrizio Tufarolo](https://blog.tufarolo.eu/how-to-configure-pihole-in-qubesos-proxyvm/) diff --git a/qusal/sys-pihole/configure-dvm.sls b/qusal/sys-pihole/configure-dvm.sls new file mode 100644 index 0000000..531c09e --- /dev/null +++ b/qusal/sys-pihole/configure-dvm.sls @@ -0,0 +1,15 @@ +{# +SPDX-FileCopyrightText: 2022 - 2023 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' %} + +"{{ slsdotpath }}-dvm-rc.local": + file.append: + - name: /rw/config/rc.local + - text: "qvm-connect-tcp 80:@default:80" + +{% endif -%} diff --git a/qusal/sys-pihole/configure-dvm.top b/qusal/sys-pihole/configure-dvm.top new file mode 100644 index 0000000..402e29a --- /dev/null +++ b/qusal/sys-pihole/configure-dvm.top @@ -0,0 +1,9 @@ +{# +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +base: + 'dvm-sys-pihole': + - sys-pihole.configure-dvm diff --git a/qusal/sys-pihole/create.sls b/qusal/sys-pihole/create.sls index 7a59788..0229d56 100644 --- a/qusal/sys-pihole/create.sls +++ b/qusal/sys-pihole/create.sls @@ -7,44 +7,99 @@ SPDX-License-Identifier: GPL-3.0-or-later {%- import "debian/template.jinja" as template -%} -## TODO: Loop as currently it doesn't check recursively ## Use the netvm of the default_netvm. {% set default_netvm = salt['cmd.shell']('qubes-prefs default_netvm') -%} {% set netvm = salt['cmd.shell']('qvm-prefs ' + default_netvm + ' netvm') -%} -## If netvm is empty, user's default_netvm is the uplink (sys-net). +## If netvm of default_netvm is empty, user's default_netvm is the first in +## the chain (sys-net). {% if netvm == '' %} {% set netvm = default_netvm %} {% endif %} include: - .clone + - browser.create -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: {{ template.template }} - - label: orange - - class: StandaloneVM - - prefs: - - label: orange - - memory: 300 - - maxmem: 800 - - vcpus: 1 - - netvm: {{ netvm }} - - provides-network: true - - features: - - enable: - - servicevm - - service.updates-proxy-setup - - disable: - - service.cups - - service.cups-browsed +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: {{ template.template }} +- label: orange +- class: StandaloneVM +prefs: +- label: orange +- memory: 300 +- maxmem: 800 +- vcpus: 1 +- netvm: {{ netvm }} +- provides-network: true +features: +- enable: + - servicevm + - service.updates-proxy-setup +- disable: + - service.cups + - service.cups-browsed +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: dvm-browser-{{ slsdotpath }} +force: True +require: +- sls: browser.create +present: +- template: tpl-browser +- label: orange +prefs: +- label: orange +- memory: 300 +- maxmem: 800 +- vcpus: 1 +- netvm: "" +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop" +{%- endload %} +{{ load(defaults) }} + + +{% load_yaml as defaults -%} +name: disp-browser-{{ slsdotpath }} +force: True +require: +- sls: browser.create +present: +- template: dvm-browser-{{ slsdotpath }} +- label: orange +- class: DispVM +prefs: +- label: orange +- memory: 300 +- maxmem: 800 +- vcpus: 1 +- netvm: "" +features: +- disable: + - service.cups + - service.cups-browsed +- set: + - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-open-file-manager.desktop qubes-run-terminal.desktop" +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-resize-private-volume": cmd.run: - name: qvm-volume resize {{ slsdotpath }}:private 20Gi - require: - qvm: {{ slsdotpath }} + +{% from 'utils/macros/policy.sls' import policy_set with context -%} +{{ policy_unset(sls_path, '80') }} diff --git a/qusal/sys-pihole/files/policy/default.policy b/qusal/sys-pihole/files/policy/default.policy new file mode 100644 index 0000000..fcc9e50 --- /dev/null +++ b/qusal/sys-pihole/files/policy/default.policy @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +## Do not modify this file, create a new policy with with a lower number in the +## file name instead. For example `30-user.policy`. +qubes.ConnectTCP +80 disp-browser-{{ slsdotpath }} @default allow target={{ sls_path }} +qubes.ConnectTCP * disp-browser-{{ slsdotpath }} @anyvm deny +## vim:ft=qrexecpolicy diff --git a/qusal/sys-pihole/install.sls b/qusal/sys-pihole/install.sls index 6a1964b..68bde2e 100644 --- a/qusal/sys-pihole/install.sls +++ b/qusal/sys-pihole/install.sls @@ -56,7 +56,6 @@ include: - ca-certificates - curl - dnsutils - - firefox-esr - git - idn2 - lighttpd diff --git a/qusal/sys-ssh-agent/README.md b/qusal/sys-ssh-agent/README.md index 02813ae..25715f8 100644 --- a/qusal/sys-ssh-agent/README.md +++ b/qusal/sys-ssh-agent/README.md @@ -111,20 +111,21 @@ qusal.SshAgent * @anyvm @anyvm deny #### Generate keys Keys can be selectively allocated to different ssh-agents by adding them to -different directories under `~/keys/<AGENT>`, where the `<AGENT>` directory -should have the same name as the agent itself. Example: `~/keys/work`. +different directories under `~/.ssh/identities.d/<AGENT>`, where the `<AGENT>` +directory should have the same name as the agent itself. Example: +`~/.ssh/identities.d/work`. Import preexisting keys to the agent directory or generate keys for a specific agent: ```sh -mkdir -m 0700 -p ~/keys/<AGENT> -ssh-keygen -t ed25519 -f ~/keys/<AGENT>/id_example +mkdir -m 0700 -p ~/.ssh/identities.d/<AGENT> +ssh-keygen -t ed25519 -f ~/.ssh/identities.d/<AGENT>/id_example ``` You would do the following for the `work` agent: ```sh -mkdir -m 0700 -p ~/keys/work -ssh-keygen -t ed25519 -f ~/keys/work/id_example +mkdir -m 0700 -p ~/.ssh/identities.d/work +ssh-keygen -t ed25519 -f ~/.ssh/identities.d/work/id_example ``` #### Limit key usage @@ -144,8 +145,8 @@ The `.ssh-add-option` file has the following format: ``` Or you can manually add the key to the agent which are not located under the -~/keys directory so they aren't automatically added (substitute AGENT, SECS, -and LIFE for their appropriate values): +`~/.ssh/identities.d` directory so they aren't automatically added (substitute +AGENT, SECS, and LIFE for their appropriate values): ```sh SSH_AUTH_SOCK="/run/user/1000/qubes-ssh-agent/<AGENT>.sock" ssh-add -t <SECS> -f <FILE> ``` diff --git a/qusal/sys-ssh-agent/configure.sls b/qusal/sys-ssh-agent/configure.sls index b149980..505170b 100644 --- a/qusal/sys-ssh-agent/configure.sls +++ b/qusal/sys-ssh-agent/configure.sls @@ -10,11 +10,20 @@ include: - dev.home-cleanup - dotfiles.copy-x11 -"{{ slsdotpath }}-create-keys-directory": +"{{ slsdotpath }}-create-ssh-directory": file.directory: - - name: /home/user/keys + - name: /home/user/.ssh - mode: '0700' - user: user - group: user + - makedirs: True + +"{{ slsdotpath }}-create-keys-directory": + file.directory: + - name: /home/user/.ssh/identities.d + - mode: '0700' + - user: user + - group: user + - makedirs: True {% endif %} diff --git a/qusal/sys-ssh-agent/create.sls b/qusal/sys-ssh-agent/create.sls index 0b3efe2..bfabc73 100644 --- a/qusal/sys-ssh-agent/create.sls +++ b/qusal/sys-ssh-agent/create.sls @@ -7,28 +7,30 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - label: gray - - netvm: "" - - memory: 200 - - maxmem: 300 - - vcpus: 1 - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- label: gray +- netvm: "" +- memory: 200 +- maxmem: 300 +- vcpus: 1 +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} {% from 'utils/macros/policy.sls' import policy_set with context -%} {{ policy_set(sls_path, '80') }} diff --git a/qusal/sys-ssh-agent/files/rpc/qusal.SshAgent b/qusal/sys-ssh-agent/files/rpc/qusal.SshAgent index cbe681d..a182ed2 100644 --- a/qusal/sys-ssh-agent/files/rpc/qusal.SshAgent +++ b/qusal/sys-ssh-agent/files/rpc/qusal.SshAgent @@ -14,7 +14,23 @@ die(){ #origin="$QREXEC_REMOTE_DOMAIN" agent="$QREXEC_SERVICE_ARGUMENT" socket="/tmp/qubes-ssh-agent/${agent}.sock" +service="qubes-ssh-agent-sock@${agent}.service" +## Trust the service is activating and sleep a bit more before failing later. +systemctl --user is-active "${service}" >/dev/null 2>&1 \ + || sleep 10 +systemctl --user is-active "${service}" >/dev/null 2>&1 \ + || die "Agent is not enabled: ${agent}" +active_timestamp="$(systemctl --user show "${service}" --property ActiveEnterTimestamp | cut -d "=" -f2)" +test -n "${active_timestamp:-}" \ + || die "Failed to get agent active timestamp: ${agent}" + +active_epoch="$(date -d"${active_timestamp}" "+%s")" +now_epoch="$(date --utc "+%s")" +difference="$((now_epoch-active_epoch))" +test "${difference}" -gt 15 || sleep 5 + +test -e "$socket" || die "Socket doesn't exist: $socket" test -S "$socket" || die "Not a socket: $socket" exec socat STDIO UNIX-CLIENT:"$socket" diff --git a/qusal/sys-ssh-agent/files/agent/bin/qvm-ssh-agent b/qusal/sys-ssh-agent/files/server/bin/qvm-ssh-agent similarity index 94% rename from qusal/sys-ssh-agent/files/agent/bin/qvm-ssh-agent rename to qusal/sys-ssh-agent/files/server/bin/qvm-ssh-agent index 0511c67..064e237 100755 --- a/qusal/sys-ssh-agent/files/agent/bin/qvm-ssh-agent +++ b/qusal/sys-ssh-agent/files/server/bin/qvm-ssh-agent @@ -38,13 +38,13 @@ ls_agent(){ } add_key(){ - for dir in $HOME/keys/$agent; do + for dir in $HOME/.ssh/identities.d/$agent; do test -d "$dir" || continue dir="${dir##*/}" socket="/tmp/${sock_dir}/${dir}.sock" test -S "$socket" || continue keys="$(grep -sl -- "-----BEGIN OPENSSH PRIVATE KEY-----" \ - "$HOME/keys/$dir"/* || true)" + "$HOME/.ssh/identities.d/$dir"/* || true)" test -n "$keys" || continue echo "Agent: ($dir) $socket" SSH_AUTH_SOCK="$socket" ssh-add -D 2>/dev/null || true diff --git a/qusal/sys-ssh-agent/files/agent/systemd/qubes-ssh-agent-sock@.service b/qusal/sys-ssh-agent/files/server/systemd/qubes-ssh-agent-sock@.service similarity index 100% rename from qusal/sys-ssh-agent/files/agent/systemd/qubes-ssh-agent-sock@.service rename to qusal/sys-ssh-agent/files/server/systemd/qubes-ssh-agent-sock@.service diff --git a/qusal/sys-ssh-agent/install-client.sls b/qusal/sys-ssh-agent/install-client.sls index e084559..9cff4e7 100644 --- a/qusal/sys-ssh-agent/install-client.sls +++ b/qusal/sys-ssh-agent/install-client.sls @@ -24,15 +24,22 @@ include: - qubes-core-agent-networking - ca-certificates - socat - {% if grains['os_family']|lower == 'debian' -%} - - libpam-systemd - - procps - - openssh-client - {% elif grains['os_family']|lower == 'redhat' -%} - - systemd-pam - - procps-ng - - openssh-clients - {% endif -%} + +{% set pkg = { + 'Debian': { + 'pkg': ['libpam-systemd', 'procps', 'openssh-client'], + }, + 'RedHat': { + 'pkg': ['systemd-pam', 'procps-ng', 'openssh-clients'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-client-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} "{{ slsdotpath }}-client-user-systemd-dir": file.recurse: diff --git a/qusal/sys-ssh-agent/install.sls b/qusal/sys-ssh-agent/install.sls index e08ee62..3158d9e 100644 --- a/qusal/sys-ssh-agent/install.sls +++ b/qusal/sys-ssh-agent/install.sls @@ -21,15 +21,26 @@ include: - skip_suggestions: True - pkgs: - socat - {% if grains['os_family']|lower == 'debian' -%} - - libpam-systemd - {% elif grains['os_family']|lower == 'redhat' -%} - - systemd-pam - {% endif -%} + +{% set pkg = { + 'Debian': { + 'pkg': ['libpam-systemd', 'procps', 'openssh-client'], + }, + 'RedHat': { + 'pkg': ['systemd-pam', 'procps-ng', 'openssh-clients'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} "{{ slsdotpath }}-agent-bin-dir": file.recurse: - - source: salt://{{ slsdotpath }}/files/agent/bin + - source: salt://{{ slsdotpath }}/files/server/bin - name: /usr/bin - file_mode: '0755' - user: root @@ -37,7 +48,7 @@ include: "{{ slsdotpath }}-agent-user-systemd-dir": file.recurse: - - source: salt://{{ slsdotpath }}/files/agent/systemd/ + - source: salt://{{ slsdotpath }}/files/server/systemd/ - name: /usr/lib/systemd/user/ - dir_mode: '0755' - file_mode: '0644' @@ -63,11 +74,20 @@ include: - group: root - makedirs: True +"{{ slsdotpath }}-skel-create-ssh-directory": + file.directory: + - name: /etc/skel/.ssh + - mode: '0700' + - user: user + - group: user + - makedirs: True + "{{ slsdotpath }}-skel-create-keys-directory": file.directory: - - name: /etc/skel/keys + - name: /etc/skel/.ssh/identities.d - mode: '0700' - user: root - group: root + - makedirs: True {% endif -%} diff --git a/qusal/dotfiles/files/gtk/.config/gtk-4.0/qubes-incoming-bookmark-created b/qusal/sys-ssh-agent/map.jinja similarity index 100% rename from qusal/dotfiles/files/gtk/.config/gtk-4.0/qubes-incoming-bookmark-created rename to qusal/sys-ssh-agent/map.jinja diff --git a/qusal/sys-sshfs/README.md b/qusal/sys-sshfs/README.md new file mode 100644 index 0000000..56486d4 --- /dev/null +++ b/qusal/sys-sshfs/README.md @@ -0,0 +1,68 @@ +# sys-sshfs + +## Table of Contents + +* [Description](#description) +* [Installation](#installation) +* [Access Control](#access-control) +* [Credits](#credits) + +## Description + +SSH File System over Qrexec on Qubes OS. + +Creates a SSH server qube named "sys-sshfs". +TODO + +## Installation + +The SSH connector service is only started if the service is enabled for that +qube in Dom0: +``` +qvm-features QUBE service.qubes-sshfs 1 +``` + +- Top: +```sh +qubesctl top.enable sys-sshfs +qubesctl --targets=tpl-sys-sshfs,sys-sshfs state.apply +qubesctl top.disable sys-sshfs +``` + +- State: +```sh +qubesctl state.apply sys-sshfs.create +qubesctl --skip-dom0 --targets=tpl-sys-sshfs state.apply sys-sshfs.install +qubesctl --skip-dom0 --targets=sys-sshfs state.apply sys-sshfs.configure +``` + +Install on the client template: +```sh +qubesctl --skip-dom0 --targets=QUBE state.apply sys-sshfs.install-client +``` + +Configure the client: +```sh +qubesctl --skip-dom0 --targets=QUBE state.apply sys-sshfs.configure-client +``` + +## Access Control + +A `qusal.Sshfs` service is created to allow use of SSH File Transfer Protocol +over Qrexec. The default policy `asks` if you want to sync with the +`sys-sshfs` qube. + +If you want to `allow` SSH between qubes, insert in you user policy file +`/etc/qubes/policy.d/30-user.policy` to allow the service using the following +format: +```qrexecpolicy +qusal.Sshfs * SOURCE @default allow target=TARGET default_target=DEFAULT_TARGET +``` + +## Usage + +TODO + +## Credits + +- [Unman](https://github.com/unman/shaker/tree/master/share) diff --git a/qusal/sys-sshfs/clone.sls b/qusal/sys-sshfs/clone.sls new file mode 100644 index 0000000..9391fbc --- /dev/null +++ b/qusal/sys-sshfs/clone.sls @@ -0,0 +1,8 @@ +{# +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +{% from 'utils/macros/clone-template.sls' import clone_template -%} +{{ clone_template('debian-minimal', sls_path) }} diff --git a/qusal/sys-sshfs/clone.top b/qusal/sys-sshfs/clone.top new file mode 100644 index 0000000..f35b821 --- /dev/null +++ b/qusal/sys-sshfs/clone.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - sys-sshfs.clone diff --git a/qusal/sys-sshfs/configure-client.sls b/qusal/sys-sshfs/configure-client.sls new file mode 100644 index 0000000..2f7d9bf --- /dev/null +++ b/qusal/sys-sshfs/configure-client.sls @@ -0,0 +1,57 @@ +{# +SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +"{{ slsdotpath }}-client-rc.local": + file.append: + - name: /rw/config/rc.local + - text: | + systemctl enable qubes-ssh-forwarder.socket + systemctl start qubes-ssh-forwarder.socket + sshfs -p 840 localhost:/home/tx tx + +"{{ slsdotpath }}-home-tx-dir-client": + file.directory: + - name: /home/user/tx + - mode: '0700' + - user: user + - group: user + - makedirs: True + +"{{ slsdotpath }}-home-ssh-dir-client": + file.directory: + - name: /home/user/.ssh + - mode: '0700' + - user: user + - group: user + - makedirs: True + +"{{ slsdotpath }}-ssh-forwarder-template-to-systemd-bind": + file.managed: + - name: /rw/bind-dirs/lib/systemd/system/qubes-ssh-forwarder@.service + - source: salt://{{ slsdotpath }}/files/client/qubes-ssh-forwarder@.service + - mode: '0644' + - user: root + - group: root + - makedirs: True + +"{{ slsdotpath }}-ssh-forwarder-socket-to-systemd-bind": + file.managed: + - name: /rw/bind-dirs/lib/systemd/system/qubes-ssh-forwarder.socket + - source: salt://{{ slsdotpath }}/files/client/qubes-ssh-forwarder.socket + - mode: '0644' + - user: root + - group: root + - makedirs: True + +"{{ slsdotpath }}-bind-sshfs-client" + file.managed: + - name: /rw/config/qubes-bind-dirs.d/50_sshfs.conf + - source: salt://{{ slsdotpath }}/files/client/50_sshfs.conf + - mode: '0644' + - user: root + - group: root + - makedirs: True diff --git a/qusal/dotfiles/copy-all.top b/qusal/sys-sshfs/configure-client.top similarity index 77% rename from qusal/dotfiles/copy-all.top rename to qusal/sys-sshfs/configure-client.top index 04dba10..7f3c93b 100644 --- a/qusal/dotfiles/copy-all.top +++ b/qusal/sys-sshfs/configure-client.top @@ -6,4 +6,4 @@ SPDX-License-Identifier: GPL-3.0-or-later base: '*': - - dotfiles.copy-all + - sys-sshfs.configure-client diff --git a/qusal/sys-sshfs/configure.sls b/qusal/sys-sshfs/configure.sls new file mode 100644 index 0000000..326b0fb --- /dev/null +++ b/qusal/sys-sshfs/configure.sls @@ -0,0 +1,29 @@ +{# +SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +"{{ slsdotpath }}-start-ssh-on-boot": + file.append: + - name: /rw/config/rc.local + - text: | + systemctl unmask ssh + systemctl start ssh + +"{{ slsdotpath }}-create-home-ssh-dir": + file.directory: + - name: /home/user/.ssh + - mode: '0700' + - user: user + - group: user + - makedirs: True + +"{{ slsdotpath }}-creates-tx-dir": + file.directory: + - name: /home/tx + - mode: '0777' + - user: user + - group: user + - makedirs: True diff --git a/qusal/dotfiles/copy-git.top b/qusal/sys-sshfs/configure.top similarity index 71% rename from qusal/dotfiles/copy-git.top rename to qusal/sys-sshfs/configure.top index 570054d..0fad6d4 100644 --- a/qusal/dotfiles/copy-git.top +++ b/qusal/sys-sshfs/configure.top @@ -5,5 +5,5 @@ SPDX-License-Identifier: GPL-3.0-or-later #} base: - '*': - - dotfiles.copy-git + 'sys-sshfs': + - sys-sshfs.configure diff --git a/qusal/sys-sshfs/create.sls b/qusal/sys-sshfs/create.sls new file mode 100644 index 0000000..f0f58d0 --- /dev/null +++ b/qusal/sys-sshfs/create.sls @@ -0,0 +1,46 @@ +{# +SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +include: + - .clone + +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: yellow +prefs: +- template: tpl-{{ slsdotpath }} +- label: yellow +- netvm: "" +- vcpus: 1 +- memory: 300 +- maxmem: 700 +- autostart: False +- include_in_backups: True +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +"{{ slsdotpath }}-resize-private-volume": + cmd.run: + - name: qvm-volume extend {{ slsdotpath }}:private 40Gi + - require: + - qvm: {{ slsdotpath }} + +{% from 'utils/macros/policy.sls' import policy_set with context -%} +{{ policy_set(sls_path, '80') }} diff --git a/qusal/sys-sshfs/create.top b/qusal/sys-sshfs/create.top new file mode 100644 index 0000000..67c24c0 --- /dev/null +++ b/qusal/sys-sshfs/create.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - sys-sshfs.create diff --git a/qusal/sys-sshfs/files/client/50_sshfs.conf b/qusal/sys-sshfs/files/client/50_sshfs.conf new file mode 100644 index 0000000..87e6a65 --- /dev/null +++ b/qusal/sys-sshfs/files/client/50_sshfs.conf @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +binds+=( '/lib/systemd/system/qubes-ssh-forwarder.socket') +binds+=( '/lib/systemd/system/qubes-ssh-forwarder@.service') + +# vim: ft=bash diff --git a/qusal/sys-sshfs/files/client/qubes-ssh-forwarder.socket b/qusal/sys-sshfs/files/client/qubes-ssh-forwarder.socket new file mode 100644 index 0000000..97d086d --- /dev/null +++ b/qusal/sys-sshfs/files/client/qubes-ssh-forwarder.socket @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[Unit] +Description=Forward connection to SSH over Qrexec +ConditionPathExists=/var/run/qubes-service/qubes-sshfs + +[Socket] +ListenStream=127.0.0.1:840 +BindToDevice=lo +Accept=true + +[Install] +WantedBy=multi-user.target diff --git a/qusal/sys-sshfs/files/client/qubes-ssh-forwarder@.service b/qusal/sys-sshfs/files/client/qubes-ssh-forwarder@.service new file mode 100644 index 0000000..b1ecf1e --- /dev/null +++ b/qusal/sys-sshfs/files/client/qubes-ssh-forwarder@.service @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[Unit] +Description=Forward connection to SSH over Qrexec + +[Service] +ExecStart=/usr/bin/qrexec-client-vm -- @default qusal.Sshfs +StandardInput=socket +StandardOutput=inherit diff --git a/qusal/sys-sshfs/files/policy/default.policy b/qusal/sys-sshfs/files/policy/default.policy new file mode 100644 index 0000000..9140ff5 --- /dev/null +++ b/qusal/sys-sshfs/files/policy/default.policy @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2023 Qusal contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +## Do not modify this file, create a new policy with with a lower number in the +## file name instead. For example `30-user.policy`. +qusal.Sshfs * @anyvm @default ask target=sys-sshfs default_target=sys-sshfs +qusal.Sshfs * @anyvm @anyvm deny +## vim:ft=qrexecpolicy diff --git a/qusal/sys-sshfs/files/rpc/qusal.Sshfs b/qusal/sys-sshfs/files/rpc/qusal.Sshfs new file mode 100755 index 0000000..addeac6 --- /dev/null +++ b/qusal/sys-sshfs/files/rpc/qusal.Sshfs @@ -0,0 +1,7 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +exec socat STDIO TCP:localhost:22 diff --git a/qusal/sys-sshfs/install-client.sls b/qusal/sys-sshfs/install-client.sls new file mode 100644 index 0000000..f60c6b2 --- /dev/null +++ b/qusal/sys-sshfs/install-client.sls @@ -0,0 +1,38 @@ +{# +SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +"{{ slsdotpath }}-updated-client": + pkg.uptodate: + - refresh: True + +"{{ slsdotpath }}-installed-client": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: + - socat + +{% set pkg = { + 'Debian': { + 'pkg': ['sshfs', 'openssh-client'], + }, + 'RedHat': { + 'pkg': ['fuse-sshfs', 'openssh-clients'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-client-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} + +{% endif -%} diff --git a/qusal/dotfiles/copy-net.top b/qusal/sys-sshfs/install-client.top similarity index 78% rename from qusal/dotfiles/copy-net.top rename to qusal/sys-sshfs/install-client.top index 6079dff..bb97abb 100644 --- a/qusal/dotfiles/copy-net.top +++ b/qusal/sys-sshfs/install-client.top @@ -6,4 +6,4 @@ SPDX-License-Identifier: GPL-3.0-or-later base: '*': - - dotfiles.copy-net + - sys-sshfs.install-client diff --git a/qusal/sys-sshfs/install.sls b/qusal/sys-sshfs/install.sls new file mode 100644 index 0000000..aba464c --- /dev/null +++ b/qusal/sys-sshfs/install.sls @@ -0,0 +1,44 @@ +{# +SPDX-FileCopyrightText: 2022 unman <unman@thirdeyesecurity.com> +SPDX-FileCopyrightText: 2023 Qusal contributors + +SPDX-License-Identifier: GPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +"{{ slsdotpath }}-updated": + pkg.uptodate: + - refresh: True + +"{{ slsdotpath }}-installed": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: + - openssh-server + - socat + +"{{ slsdotpath }}-stop-ssh": + service.dead: + - name: ssh + +"{{ slsdotpath }}-disable-ssh": + service.disabled: + - name: ssh + +"{{ slsdotpath }}-mask-ssh": + service.masked: + - name: ssh + +"{{ slsdotpath }}-set-rpc-service": + file.managed: + - name: /etc/qubes-rpc/qusal.Sshfs + - source: salt://{{ slsdotpath }}/files/rpc/qusal.Sshfs + - mode: '0755' + - user: root + - group: root + - makedirs: True + +{% endif -%} diff --git a/qusal/dotfiles/copy-gtk.top b/qusal/sys-sshfs/install.top similarity index 71% rename from qusal/dotfiles/copy-gtk.top rename to qusal/sys-sshfs/install.top index 6008ef0..ae7e530 100644 --- a/qusal/dotfiles/copy-gtk.top +++ b/qusal/sys-sshfs/install.top @@ -5,5 +5,5 @@ SPDX-License-Identifier: GPL-3.0-or-later #} base: - '*': - - dotfiles.copy-gtk + 'tpl-sys-sshfs': + - sys-sshfs.install diff --git a/qusal/sys-syncthing/README.md b/qusal/sys-syncthing/README.md index 2844c9a..e35647e 100644 --- a/qusal/sys-syncthing/README.md +++ b/qusal/sys-syncthing/README.md @@ -29,9 +29,6 @@ qvm-features QUBE service.qubes-syncthing 1 ``` The client requires `socat` to be installed. -By default the service will connect to the `sys-syncthing` qube, but you can -change the default via policy. - To use the service, add a Remote Device, and copy the `DeviceID` from the target qube. On the Advanced tab, under Addresses, change `dynamic` to `tcp://127.0.0.1:22001` diff --git a/qusal/sys-syncthing/create.sls b/qusal/sys-syncthing/create.sls index 532508b..cf61182 100644 --- a/qusal/sys-syncthing/create.sls +++ b/qusal/sys-syncthing/create.sls @@ -8,49 +8,53 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - name: tpl-{{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - prefs: - - vcpus: 1 - - memory: 300 - - maxmem: 700 - - autostart: False - - include_in_backups: False - - features: - - disable: - - service.cups - - service.cups-browsed - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" - - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +prefs: +- vcpus: 1 +- memory: 300 +- maxmem: 700 +- autostart: False +- include_in_backups: False +features: +- disable: + - service.cups + - service.cups-browsed +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" + - default-menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - require: - - sls: {{ slsdotpath }}.clone - - present: - - template: tpl-{{ slsdotpath }} - - label: gray - - prefs: - - template: tpl-{{ slsdotpath }} - - label: gray - - vcpus: 1 - - memory: 300 - - maxmem: 700 - - autostart: False - - include_in_backups: True - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed - - set: - - menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: gray +prefs: +- template: tpl-{{ slsdotpath }} +- label: gray +- vcpus: 1 +- memory: 300 +- maxmem: 700 +- autostart: False +- include_in_backups: True +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed +- set: + - menu-items: "qubes-run-terminal.desktop qubes-start.desktop firefox-esr.desktop syncthing-ui.desktop" +{%- endload %} +{{ load(defaults) }} "{{ slsdotpath }}-resize-private-volume": cmd.run: diff --git a/qusal/sys-syncthing/init.top b/qusal/sys-syncthing/init.top index 288130d..3838684 100644 --- a/qusal/sys-syncthing/init.top +++ b/qusal/sys-syncthing/init.top @@ -10,3 +10,5 @@ base: - sys-syncthing.create 'tpl-sys-syncthing': - sys-syncthing.install + 'sys-syncthing': + - sys-syncthing.configure diff --git a/qusal/sys-syncthing/install.sls b/qusal/sys-syncthing/install.sls index 2ed6f5d..e05d1ac 100644 --- a/qusal/sys-syncthing/install.sls +++ b/qusal/sys-syncthing/install.sls @@ -24,16 +24,27 @@ SPDX-License-Identifier: GPL-3.0-or-later - qubes-core-agent-networking - socat - syncthing - {% if grains['os_family']|lower == 'debian' -%} - - libpam-systemd - {% elif grains['os_family']|lower == 'debian' -%} - - systemd-pam - {% endif -%} ## UI - firefox-esr - qubes-core-agent-nautilus - nautilus +{% set pkg = { + 'Debian': { + 'pkg': ['libpam-systemd'], + }, + 'RedHat': { + 'pkg': ['systemd-pam'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} + "{{ slsdotpath }}-rpc-service": file.managed: - name: /etc/qubes-rpc/qusal.Syncthing diff --git a/qusal/sys-usb/create.sls b/qusal/sys-usb/create.sls index 59c4471..ae56f90 100644 --- a/qusal/sys-usb/create.sls +++ b/qusal/sys-usb/create.sls @@ -20,7 +20,7 @@ include: - qubes-ctap-dom0 #} - +{# "{{ slsdotpath }}-absent": qvm.absent: - names: @@ -28,32 +28,37 @@ include: - sys-usb-dock - sys-usb-left - dvm-{{ slsdotpath }} +#} -"dvm-{{ slsdotpath }}": - qvm.vm: - - name: dvm-{{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: red - - prefs: - - template: tpl-{{ slsdotpath }} - - label: red - - netvm: "" - - memory: 0 - - maxmem: 400 - - vcpus: 1 - - virt_mode: hvm - - template_for_dispvms: True - - include_in_backups: False - - features: - - enable: - - servicevm - - appmenus-dispvm - - disable: - - service.cups - - service.cups-browsed - - service.meminfo-writer - - service.qubes-updates-proxy +{% load_yaml as defaults -%} +name: dvm-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: red +prefs: +- template: tpl-{{ slsdotpath }} +- label: red +- netvm: "" +- memory: 0 +- maxmem: 400 +- vcpus: 1 +- virt_mode: hvm +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - servicevm + - appmenus-dispvm +- disable: + - service.cups + - service.cups-browsed + - service.meminfo-writer + - service.qubes-updates-proxy +{%- endload %} +{{ load(defaults) }} ## TODO: fix _modules/ext_module_qvm.py {% set usb_pcidevs = salt['grains.get']('pci_usb_devs', []) -%} @@ -64,44 +69,47 @@ include: {% set usb_host_model = 'unknown' -%} {% set usbs = ['sys-usb'] -%} {% endif -%} -{% for usb in usbs -%} -"{{ usb }}": - qvm.vm: - - require: - - qvm: dvm-{{ slsdotpath }} - - name: {{ usb }} - - present: - - template: dvm-{{ slsdotpath }} - - label: red - - class: DispVM - - prefs: - - template: dvm-{{ slsdotpath }} - - label: red - - netvm: "" - - memory: 0 - - maxmem: 400 - - include_in_backups: False - - pci_strictreset: False - {% if usb_host_model == 'T430' -%} - - autostart: False - {% if usb == 'sys-usb-left' -%} - - pcidevs: {{ usb_pcidevs[0]|yaml }} - {% elif usb == 'sys-usb' -%} - - pcidevs: {{ usb_pcidevs[1]|yaml }} - {% elif usb == 'sys-usb-dock' -%} - - pcidevs: {{ usb_pcidevs[2]|yaml }} - {% endif -%} - {% else -%} - - autostart: True - - pcidevs: {{ usb_pcidevs|yaml }} - {% endif -%} - - features: - - enable: - - servicevm - - disable: - - service.cups - - service.cups-browsed - - service.meminfo-writer - - service.qubes-updates-proxy +{% for usb in usbs -%} +{% load_yaml as defaults -%} +name: {{ usb }} +force: True +require: +- qvm: dvm-{{ slsdotpath }} +present: +- template: dvm-{{ slsdotpath }} +- label: red +- class: DispVM +prefs: +- template: dvm-{{ slsdotpath }} +- label: red +- netvm: "" +- memory: 0 +- maxmem: 400 +- include_in_backups: False +- pci_strictreset: False +## TODO: remove this "complex" jinja from yaml and use a best practice +{% if usb_host_model == 'T430' -%} +- autostart: False +{% if usb == 'sys-usb-left' -%} +- pcidevs: {{ usb_pcidevs[0]|yaml }} +{% elif usb == 'sys-usb' -%} +- pcidevs: {{ usb_pcidevs[1]|yaml }} +{% elif usb == 'sys-usb-dock' -%} +- pcidevs: {{ usb_pcidevs[2]|yaml }} +{% endif -%} +{% else -%} +- autostart: True +- pcidevs: {{ usb_pcidevs|yaml }} +{% endif -%} +features: +- enable: + - servicevm +- disable: + - service.cups + - service.cups-browsed + - service.meminfo-writer + - service.qubes-updates-proxy +{%- endload %} +{{ load(defaults) }} {% endfor -%} diff --git a/qusal/terraform/create.sls b/qusal/terraform/create.sls index 760bdc84..7e27a24 100644 --- a/qusal/terraform/create.sls +++ b/qusal/terraform/create.sls @@ -7,21 +7,25 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: blue - - prefs: - - template: tpl-{{ slsdotpath }} - - label: blue - - vpus: 1 - - memory: 400 - - maxmem: 600 - - autostart: False - - features: - - disable: - - service.cups - - service.cups-browsed - - service.tinyproxy +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: purple +prefs: +- template: tpl-{{ slsdotpath }} +- label: purple +- vpus: 1 +- memory: 400 +- maxmem: 600 +- autostart: False +features: +- disable: + - service.cups + - service.cups-browsed + - service.tinyproxy +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/terraform/install.sls b/qusal/terraform/install.sls index ba03966..4fb2351 100644 --- a/qusal/terraform/install.sls +++ b/qusal/terraform/install.sls @@ -6,6 +6,9 @@ SPDX-License-Identifier: GPL-3.0-or-later {% if grains['nodename'] != 'dom0' -%} +include: + - sys-ssh-agent.install-client + {% from 'utils/macros/install-repo.sls' import install_repo -%} {{ install_repo(sls_path, 'terraform') }} @@ -20,8 +23,9 @@ SPDX-License-Identifier: GPL-3.0-or-later - skip_suggestions: True - pkgs: - qubes-core-agent-networking + - ca-certificates - terraform - - openssh-client + - terraform-ls - vim - man-db diff --git a/qusal/utils/macros/install-repo.sls b/qusal/utils/macros/install-repo.sls index 07400a9..517ac8e 100644 --- a/qusal/utils/macros/install-repo.sls +++ b/qusal/utils/macros/install-repo.sls @@ -48,6 +48,10 @@ If sls_path is 'browser', then this would install the repo from: - group: root - makedirs: True +"{{ name }}-remove-{{ repo }}-old-format": + file.absent: + - name: /etc/apt/sources.list.d/{{ repo }}.list + {% elif grains['os_family']|lower == 'redhat' -%} "{{ name }}-install-{{ repo }}-keyring": diff --git a/qusal/utils/macros/sync-appmenus.sls b/qusal/utils/macros/sync-appmenus.sls index f9a0c5a..95f752e 100644 --- a/qusal/utils/macros/sync-appmenus.sls +++ b/qusal/utils/macros/sync-appmenus.sls @@ -13,7 +13,7 @@ Usage: 2: Set qube to sync the appmenus: {{ sync_appmenus('tpl-' ~ sls_path) }} -{{ sync_appmenus('tpl-debian') }} +{{ sync_appmenus('tpl-ssh') }} #} {% macro sync_appmenus(qube) -%} diff --git a/qusal/utils/tools/builder/core.sls b/qusal/utils/tools/builder/core.sls index 07dac1b..2e95b7c 100644 --- a/qusal/utils/tools/builder/core.sls +++ b/qusal/utils/tools/builder/core.sls @@ -24,20 +24,23 @@ SPDX-License-Identifier: GPL-3.0-or-later - rpm - licensecheck - devscripts - {% if grains['os_family']|lower == 'debian' -%} - - equivs - - dctrl-tools - - build-essential - - debhelper - - quilt - - lintian - - mmdebstrap - {% elif grains['os_family']|lower == 'redhat' -%} - - rpmdevtools - - rpm-sign - - rpm-build - - fedora-packager - - fedora-review - {% endif -%} + +{% set pkg = { + 'Debian': { + 'pkg': ['equivs', 'dctrl-tools', 'build-essential' 'debhelper', 'quilt', + 'lintian', 'mmdebstrap'], + }, + 'RedHat': { + 'pkg': ['rpmdevtools', 'rpm-sign', 'rpm-build', 'fedora-packager', + 'fedora-review'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-core-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} {% endif -%} diff --git a/qusal/utils/tools/builder/doc.sls b/qusal/utils/tools/builder/doc.sls index 5ce2998..f698ea8 100644 --- a/qusal/utils/tools/builder/doc.sls +++ b/qusal/utils/tools/builder/doc.sls @@ -21,10 +21,5 @@ SPDX-License-Identifier: GPL-3.0-or-later - groff - man-db - less - {# - {% if grains['os_family']|lower == 'debian' -%} - {% elif grains['os_family']|lower == 'redhat' -%} - {% endif -%} - #} {% endif -%} diff --git a/qusal/vault/create.sls b/qusal/vault/create.sls index 93ebfb3..a18e034 100644 --- a/qusal/vault/create.sls +++ b/qusal/vault/create.sls @@ -7,29 +7,37 @@ SPDX-License-Identifier: GPL-3.0-or-later include: - .clone -"tpl-{{ slsdotpath }}": - qvm.vm: - - name: tpl-{{ slsdotpath }} - - features: - - set: - - menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" - - default-menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: tpl-{{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +features: +- set: + - menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} -"{{ slsdotpath }}": - qvm.vm: - - name: {{ slsdotpath }} - - present: - - template: tpl-{{ slsdotpath }} - - label: black - - prefs: - - template: tpl-{{ slsdotpath }} - - label: black - - netvm: "" - - memory: 400 - - maxmem: 600 - - vcpus: 1 - - autostart: False - - include_in_backups: True - - features: - - set: - - menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" +{% load_yaml as defaults -%} +name: {{ slsdotpath }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: tpl-{{ slsdotpath }} +- label: black +prefs: +- template: tpl-{{ slsdotpath }} +- label: black +- netvm: "" +- memory: 400 +- maxmem: 600 +- vcpus: 1 +- autostart: False +- include_in_backups: True +features: +- set: + - menu-items: "org.keepassxc.KeePassXC.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/qusal/vault/install.sls b/qusal/vault/install.sls index 2fc2542..c35c318 100644 --- a/qusal/vault/install.sls +++ b/qusal/vault/install.sls @@ -21,11 +21,21 @@ include: - pkgs: - keepassxc - gnupg2 - {% if grains['os_family']|lower == 'debian' -%} - - sq - {% elif grains['os_family']|lower == 'debian' -%} - - sequoia-sq - {% endif -%} - - openssh-client + +{% set pkg = { + 'Debian': { + 'pkg': ['sq', 'openssh-client'], + }, + 'RedHat': { + 'pkg': ['sequoia-sq', 'openssh-clients'], + }, +}.get(grains.os_family) -%} + +"{{ slsdotpath }}-installed-os-specific": + pkg.installed: + - refresh: True + - install_recommends: False + - skip_suggestions: True + - pkgs: {{ pkg.pkg|sequence|yaml }} {% endif -%} diff --git a/scripts/shell-lint.sh b/scripts/shell-lint.sh index a983c39..54a64c6 100755 --- a/scripts/shell-lint.sh +++ b/scripts/shell-lint.sh @@ -1,5 +1,6 @@ #!/bin/sh +## SPDX-FileCopyrightText: 2018 Andreas Kusalananda <https://github.com/kusalaananda> ## SPDX-FileCopyrightText: 2023 Qusal contributors ## ## SPDX-License-Identifier: GPL-3.0-or-later diff --git a/scripts/spec-get.sh b/scripts/spec-get.sh index 14c08ce..bf7752c 100755 --- a/scripts/spec-get.sh +++ b/scripts/spec-get.sh @@ -47,6 +47,8 @@ group="qusal" block_max_chars group 70 file_roots="/srv/salt/${group}" vendor="Benjamin Grande" +license="GPL-3.0-or-later" + url="https://github.com/ben-grande/qusal" version="1.0" @@ -59,8 +61,7 @@ if ! test -f "${readme}"; then echo "Project ${name} does not have README.md" >&2 exit 1 fi -## TODO: no longer working because there might be multiple licenses -license="$(awk '/SPDX-License-Identifier:/ {print $2}' "${readme}" | head -1)" + block_max_chars license 70 description="$(sed -n '/^## Description/,/^## /p' "${readme}" | sed '1d;$d' | sed "1{/^$/d}")" diff --git a/scripts/update-toc.sh b/scripts/update-toc.sh index 6454244..474ec32 100755 --- a/scripts/update-toc.sh +++ b/scripts/update-toc.sh @@ -7,6 +7,24 @@ ## Requires: https://github.com/mzlogin/vim-markdown-toc set -eu +usage(){ + echo "Usage: ${0##*/} <file> [file ...]" + exit 1 +} + +case "${1-}" in + ""|-h|--?help) usage;; +esac + +## vim-markdown-toc deletes lines if they are folded, can't rely on its native +## update on save. +if ! vim -e -c 'setf markdown' -c 'if !exists(":GenTocGFM") | cq | endif' -c q +then + echo "Error: Vim Plugin mzlogin/vim-markdown-toc is not installed." + exit 1 +fi + + for f in "$@"; do if ! grep -q "^## Table of Contents$" "$f"; then echo "Could not find table of contents on file: $f" >&2; exit 1