From 3aeb1c0dc2cf75e4642c2450d17aa029f46a4ae4 Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger Date: Thu, 5 Sep 2024 16:21:59 +0200 Subject: [PATCH] add new aliases for VU --- bash/bash_completion | 200 ++++++++++++++++++++ bash/fedora_aliases | 6 + borg-backup-profiles/fedora40-priv.json | 233 ++++++++++++++++++++++++ nvim/lazyvim.json | 4 +- 4 files changed, 441 insertions(+), 2 deletions(-) create mode 100644 bash/bash_completion create mode 100644 borg-backup-profiles/fedora40-priv.json diff --git a/bash/bash_completion b/bash/bash_completion new file mode 100644 index 0000000..da6f0e6 --- /dev/null +++ b/bash/bash_completion @@ -0,0 +1,200 @@ +_poetry_f5ec5f92d1cfe4e4_complete() +{ + local cur script coms opts com + COMPREPLY=() + _get_comp_words_by_ref -n : cur words + + # for an alias, get the real script behind it + if [[ $(type -t ${words[0]}) == "alias" ]]; then + script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/") + else + script=${words[0]} + fi + + # lookup for command + for word in ${words[@]:1}; do + if [[ $word != -* ]]; then + com=$word + break + fi + done + + # completing for an option + if [[ ${cur} == --* ]] ; then + opts="--ansi --directory --help --no-ansi --no-cache --no-interaction --no-plugins --quiet --verbose --version" + + case "$com" in + + (about) + opts="${opts} " + ;; + + (add) + opts="${opts} --allow-prereleases --dev --dry-run --editable --extras --group --lock --optional --platform --python --source" + ;; + + (build) + opts="${opts} --format --output" + ;; + + ('cache clear') + opts="${opts} --all" + ;; + + ('cache list') + opts="${opts} " + ;; + + (check) + opts="${opts} --lock" + ;; + + (config) + opts="${opts} --list --local --unset" + ;; + + ('debug info') + opts="${opts} " + ;; + + ('debug resolve') + opts="${opts} --extras --install --python --tree" + ;; + + ('env info') + opts="${opts} --executable --path" + ;; + + ('env list') + opts="${opts} --full-path" + ;; + + ('env remove') + opts="${opts} --all" + ;; + + ('env use') + opts="${opts} " + ;; + + (export) + opts="${opts} --all-extras --dev --extras --format --only --output --with --with-credentials --without --without-hashes --without-urls" + ;; + + (help) + opts="${opts} " + ;; + + (init) + opts="${opts} --author --dependency --description --dev-dependency --license --name --python" + ;; + + (install) + opts="${opts} --all-extras --compile --dry-run --extras --no-dev --no-directory --no-root --only --only-root --remove-untracked --sync --with --without" + ;; + + (list) + opts="${opts} " + ;; + + (lock) + opts="${opts} --check --no-update" + ;; + + (new) + opts="${opts} --name --readme --src" + ;; + + (publish) + opts="${opts} --build --cert --client-cert --dist-dir --dry-run --password --repository --skip-existing --username" + ;; + + (remove) + opts="${opts} --dev --dry-run --group --lock" + ;; + + (run) + opts="${opts} " + ;; + + (search) + opts="${opts} " + ;; + + ('self add') + opts="${opts} --allow-prereleases --dry-run --editable --extras --source" + ;; + + ('self install') + opts="${opts} --dry-run --sync" + ;; + + ('self lock') + opts="${opts} --check --no-update" + ;; + + ('self remove') + opts="${opts} --dry-run" + ;; + + ('self show') + opts="${opts} --addons --latest --outdated --tree" + ;; + + ('self show plugins') + opts="${opts} " + ;; + + ('self update') + opts="${opts} --dry-run --preview" + ;; + + (shell) + opts="${opts} " + ;; + + (show) + opts="${opts} --all --latest --no-dev --only --outdated --top-level --tree --why --with --without" + ;; + + ('source add') + opts="${opts} --default --priority --secondary" + ;; + + ('source remove') + opts="${opts} " + ;; + + ('source show') + opts="${opts} " + ;; + + (update) + opts="${opts} --dry-run --lock --no-dev --only --sync --with --without" + ;; + + (version) + opts="${opts} --dry-run --next-phase --short" + ;; + + esac + + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + __ltrim_colon_completions "$cur" + + return 0; + fi + + # completing for a command + if [[ $cur == $com ]]; then + coms="about add build 'cache clear' 'cache list' check config 'debug info' 'debug resolve' 'env info' 'env list' 'env remove' 'env use' export help init install list lock new publish remove run search 'self add' 'self install' 'self lock' 'self remove' 'self show' 'self show plugins' 'self update' shell show 'source add' 'source remove' 'source show' update version" + + COMPREPLY=($(compgen -W "${coms}" -- ${cur})) + __ltrim_colon_completions "$cur" + + return 0 + fi +} + +complete -o default -F _poetry_f5ec5f92d1cfe4e4_complete poetry +complete -o default -F _poetry_f5ec5f92d1cfe4e4_complete /home/seb/.local/share/pypoetry/venv/bin/poetry diff --git a/bash/fedora_aliases b/bash/fedora_aliases index b6b9fe7..5be16f0 100644 --- a/bash/fedora_aliases +++ b/bash/fedora_aliases @@ -29,6 +29,12 @@ alias fs24c='cd ~/Nextcloud/Documents/Unibas/FS24' alias sdev='ssh sebl@slenzlinger.dev' alias sslenz='ssh fm18b_sebaschi@slenzlinger.ch' +# VU aliases + +alias vu='cd ~/para/education/vu' +alias ss='cd ~/para/education/vu/2024-s1-p1/ss' +alias plsps='cd ~/para/education/vu/2024-s1-p1/plsps' + alias ccat='pygmentize -g' # list repo IDs and which .repo they belong to diff --git a/borg-backup-profiles/fedora40-priv.json b/borg-backup-profiles/fedora40-priv.json new file mode 100644 index 0000000..653a2a5 --- /dev/null +++ b/borg-backup-profiles/fedora40-priv.json @@ -0,0 +1,233 @@ +{ + "id": 2, + "name": "fedora40-priv", + "added_at": "2024-06-08 16:59:25.966522", + "repo": { + "url": "ssh://BORG_REPO_URL", + "added_at": "2024-06-24 18:58:15.316153", + "encryption": "repokey-blake2", + "unique_size": 20698046843, + "unique_csize": null, + "total_size": 247024121037, + "total_unique_chunks": 64667, + "create_backup_cmd": "", + "extra_borg_arguments": "" + }, + "ssh_key": null, + "compression": "lz4", + "exclude_patterns": "*.iso\n*.log\nlog/\nlogs/\n*/cache\n*/data\n*.csv\n*/.cache\n*/Downloads\n*/.local/share/Trash\n*/.npm\n*/.node_modules\n*/.git\n*/.virtualenvs\n*/.Trash\n*/temp\n*/tmp\n*/.DS_Store\n*/Thumbs.db\n*/.thumbnails\n*/__pycache__\n*/node_modules\n*/.vscode\n*/.idea\n*/.venv\n*/env\n*/build\n*/dist\n*/*.log\n*/log/*\n*/logs/*\n*.iso\n*.qcow2\n*.vmdk\n*/vmware\n*/.local\n*/.cache\n*/opt\n*/.pytest_cache", + "exclude_if_present": ".nobackup", + "schedule_mode": "interval", + "schedule_interval_count": 15, + "schedule_interval_unit": "minutes", + "schedule_fixed_hour": 3, + "schedule_fixed_minute": 42, + "schedule_interval_hours": 3, + "schedule_interval_minutes": 42, + "schedule_make_up_missed": true, + "validation_on": true, + "validation_weeks": 1, + "prune_on": false, + "prune_hour": 2, + "prune_day": 7, + "prune_week": 4, + "prune_month": 6, + "prune_year": 2, + "prune_keep_within": "10H", + "new_archive_name": "{user}-at-{hostname}_{now:%Y-%m-%d_%H%M%S}", + "prune_prefix": "{hostname}-", + "pre_backup_cmd": "", + "post_backup_cmd": "", + "dont_run_on_metered_networks": true, + "SourceFileModel": [ + { + "dir": "/home/seb", + "dir_size": 28041024866, + "dir_files_count": 76845, + "path_isdir": true, + "profile": 2, + "added_at": "2024-06-24 17:31:54.595457" + } + ], + "SchemaVersion": { + "id": 1, + "version": 20, + "changed_at": "2024-06-08 16:58:51.359742" + }, + "WifiSettingModel": [ + { + "id": 2, + "ssid": "LenbrO", + "last_connected": "2024-06-29 08:09:43", + "allowed": true, + "profile": 2 + }, + { + "id": 3, + "ssid": "Seb", + "last_connected": "2024-06-21 18:32:20", + "allowed": true, + "profile": 2 + }, + { + "id": 4, + "ssid": "unibas-device", + "last_connected": null, + "allowed": true, + "profile": 2 + }, + { + "id": 5, + "ssid": "eduroam", + "last_connected": "2024-06-21 14:12:17", + "allowed": true, + "profile": 2 + } + ], + "SettingsModel": [ + { + "key": "enable_notifications", + "value": true, + "str_value": "", + "label": "Display notifications when background tasks fail", + "group": "Notifications", + "tooltip": "", + "type": "checkbox" + }, + { + "key": "enable_notifications_success", + "value": true, + "str_value": "", + "label": "Notify about successful background tasks", + "group": "Notifications", + "tooltip": "", + "type": "checkbox" + }, + { + "key": "autostart", + "value": true, + "str_value": "", + "label": "Automatically start Vorta at login", + "group": "Startup", + "tooltip": "Add Vorta to the systems autostart list", + "type": "checkbox" + }, + { + "key": "foreground", + "value": true, + "str_value": "", + "label": "Open main window on startup", + "group": "Startup", + "tooltip": "Open main window when the application is launched", + "type": "checkbox" + }, + { + "key": "get_srcpath_datasize", + "value": true, + "str_value": "", + "label": "Get statistics of file/folder when added", + "group": "Information", + "tooltip": "When adding a new source, calculate its size and the number of files.", + "type": "checkbox" + }, + { + "key": "use_system_keyring", + "value": true, + "str_value": "", + "label": "Store repository passwords in system keychain, if available", + "group": "Security", + "tooltip": "Otherwise Vorta's configuration database stores the password in plaintext.", + "type": "checkbox" + }, + { + "key": "override_mount_permissions", + "value": false, + "str_value": "", + "label": "Try to replace file permissions when mounting an archive", + "group": "Security", + "tooltip": "Set owner to current user and umask to 0277", + "type": "checkbox" + }, + { + "key": "previous_profile_id", + "value": false, + "str_value": "2", + "label": "Previously selected profile", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "previous_window_width", + "value": false, + "str_value": "800", + "label": "Previous window width", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "previous_window_height", + "value": false, + "str_value": "600", + "label": "Previous window height", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "diff_files_display_mode", + "value": false, + "str_value": "0", + "label": "Diff dialog display mode", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "extract_files_display_mode", + "value": false, + "str_value": "0", + "label": "Extract dialog display mode", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "sourcetab_sort_column", + "value": false, + "str_value": "0", + "label": "Source Tab Sort Column", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "sourcetab_sort_order", + "value": false, + "str_value": "0", + "label": "Source Tab Sort Order", + "group": "", + "tooltip": "", + "type": "internal" + }, + { + "key": "enable_background_question", + "value": true, + "str_value": "", + "label": "If the system tray isn't available, ask whether to continue in the background on exit", + "group": "", + "tooltip": "", + "type": "checkbox" + }, + { + "key": "disable_background_state", + "value": false, + "str_value": "", + "label": "Previous background exit button state", + "group": "", + "tooltip": "", + "type": "internal" + } + ] +} \ No newline at end of file diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index f03853f..8e6b0ec 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -3,7 +3,7 @@ ], "news": { - "NEWS.md": "3314" + "NEWS.md": "6520" }, - "version": 3 + "version": 6 } \ No newline at end of file