diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..09e2dc2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,211 @@ +#Maintained in linux-init-files.org +* +!.gitignore +!README.md +!linux-config.org + +!/.rsync-ignore + +!/etc + +!/etc/acpi +!/etc/acpi/events +!/etc/acpi/events/* +!/etc/acpi/actions +!/etc/acpi/actions/* + +!/etc/crypttab* + +!/etc/apt +!/etc/apt/* +!/etc/apt/sources.list.d +!/etc/apt/sources.list.d/* + +!/etc/rsnapshot +!/etc/rsnapshot/* + +!/etc/zsh +!/etc/zsh/zshenvb +!/etc/zsh/zshprofile + +!/dot-config + +!/dot-config/alacritty +!/dot-config/alacritty/* + +!/dot-config/mako +!/dot-config/mako/* + +!/dot-config/waybar +!/dot-config/waybar/* + +!/dot-config/kanshi +!/dot-config/kanshi/* + +!/dot-config/i3 +!/dot-config/i3/config + +!/dot-config/i3blocks +!/dot-config/i3blocks/config + +!/dot-config/i3status +!/dot-config/i3status/config + +!/dot-config/polybar +!/dot-config/polybar/config + +!/dot-config/sway +!/dot-config/sway/config +!/dot-config/sway/host-config-* + +!/dot-config/tmux +!/dot-config/tmux/tmux.conf + +!/dot-config/wofi +!/dot-config/wofi/config +!/dot-config/wofi/style.css + +!/dot-config/zsh +!/dot-config/zsh/.zshenv +!/dot-config/zsh/.zlogin +!/dot-config/zsh/.zshrc +!/dot-config/zsh/.zprofile + +!/DotFiles + +!/DotFiles/.gnupg +!/DotFiles/.gnupg/gpg.conf +!/DotFiles/.gnupg/gpg-agent.conf + + +!/DotFiles/.bashrc +!/DotFiles/.bash_profile +!/DotFiles/.bash_profile.local.example +!/DotFiles/.clang-format +!/DotFiles/.mbsyncrc +!/DotFiles/.profile +!/DotFiles/.ignore +!/DotFiles/.syncrclone + +!/DotFiles/.syncrclone/crontab.intelnuc +!/DotFiles/.syncrclone/crontab.x1c6 +!/DotFiles/.syncrclone/crontab.t14s +!/DotFiles/.syncrclone/excludes.txt +!/DotFiles/.syncrclone/gdrive-excludes.txt +!/DotFiles/.syncrclone/privacy-excludes.txt +!/DotFiles/.syncrclone/config.py +!/DotFiles/.syncrclone/gdrive-config.py +!/DotFiles/.syncrclone/gdrive-excludes.txt +!/DotFiles/.syncrclone/gdrive-docs-config.py +!/DotFiles/.syncrclone/hetzner-config.py +!/DotFiles/.ripgreprc +!/DotFiles/.Xdefaults +!/DotFiles/.gdbinit +!/DotFiles/.lldbinit + +!/directories + +!/directories/bin + +!/directories/bin/gdb-scripts/ +!/directories/bin/gdb-scripts/* + +!/directories/bin/sway/ +!/directories/bin/sway/* + + +!/directories/bin/llvm/ +!/directories/bin/llvm/* + +/directories/bin/llvm/build +/directories/bin/thirdparty +/directories/bin/thirdparty/* + +!/directories/bin/AIS +!/directories/bin/AIScatcher +!/directories/bin/AIScheck +!/directories/bin/build-emacs +!/directories/bin/bluetooth-headphone-controls +!/directories/bin/discharge-suspend +!/directories/bin/edit +!/directories/bin/eman +!/directories/bin/expert-advice +!/directories/bin/extract-debug-info +!/directories/bin/firefox +!/directories/bin/gdb-scripts +!/directories/bin/gdrive-mount +!/directories/bin/getmails +!/directories/bin/google-trans +!/directories/bin/google-trans-de-en +!/directories/bin/google-trans-en-de +!/directories/bin/gpg-cache +!/directories/bin/hetzner-du +!/directories/bin/hetzner-mount +!/directories/bin/htop-regexp +!/directories/bin/llvm +!/directories/bin/make-compile_commands +!/directories/bin/md-read +!/directories/bin/network-online +!/directories/bin/post-blank +!/directories/bin/post-lock +!/directories/bin/pre-blank +!/directories/bin/pre-lock +!/directories/bin/.projectile +!/directories/bin/random-man-page +!/directories/bin/rclone-mount +!/directories/bin/remove-broken-symlinks +!/directories/bin/remove-conflicted-copies +!/directories/bin/resgithub.sh +!/directories/bin/rsnapshot-if-mounted +!/directories/bin/stm32cubeide-uninstall +!/directories/bin/syncrclone-gdrive-docs +!/directories/bin/syncrclone-gdrive +!/directories/bin/syncrclone-htop +!/directories/bin/syncrclone-once +!/directories/bin/thirdparty +!/directories/bin/tmux-current-session +!/directories/bin/tmux-pane-tty +!/directories/bin/upd +!/directories/bin/AIS +!/directories/bin/AIScatcher +!/directories/bin/AIScheck +!/directories/bin/build-emacs +!/directories/bin/edit +!/directories/bin/eman +!/directories/bin/expert-advice +!/directories/bin/extract-debug-info +!/directories/bin/gdb-scripts +!/directories/bin/gdrive-mount +!/directories/bin/getmails +!/directories/bin/google-trans +!/directories/bin/google-trans-de-en +!/directories/bin/google-trans-en-de +!/directories/bin/gpg-cache +!/directories/bin/hetzner-du +!/directories/bin/hetzner-mount +!/directories/bin/htop-regexp +!/directories/bin/llvm +!/directories/bin/make-compile_commands +!/directories/bin/md-read +!/directories/bin/post-blank +!/directories/bin/post-lock +!/directories/bin/pre-blank +!/directories/bin/pre-lock +!/directories/bin/.projectile +!/directories/bin/random-man-page +!/directories/bin/rclone-mount +!/directories/bin/remove-broken-symlinks +!/directories/bin/remove-conflicted-copies +!/directories/bin/rsnapshot-if-mounted +!/directories/bin/stm32cubeide-uninstall +!/directories/bin/sway +!/directories/bin/syncrclone-gdrive +!/directories/bin/syncrclone-htop +!/directories/bin/syncrclone-once +!/directories/bin/thirdparty +!/directories/bin/tmux-current-session +!/directories/bin/tmux-pane-tty +!/directories/bin/upd +!/directories/bin/wifi-toggle +!/directories/bin/enable-disable-wifi +!/directories/bin/70-wifi-wired-exclusive.sh diff --git a/.rsync-ignore b/.rsync-ignore new file mode 100755 index 00000000..aa23ed2d --- /dev/null +++ b/.rsync-ignore @@ -0,0 +1,5 @@ +#Maintained in linux-config.org +cloud/.syncrclone/ +Documents/.syncrclone/ +OpenAudible/aax/ +OpenAudible/books/ diff --git a/DotFiles/.Xdefaults b/DotFiles/.Xdefaults new file mode 100755 index 00000000..2f5ccd2f --- /dev/null +++ b/DotFiles/.Xdefaults @@ -0,0 +1,34 @@ +! Maintained in linux-config.org +! Use a truetype font and size. +*.font: -*-JetBrainsMono Nerd Font-*-*-*-*-14-*-*-*-*-*-* +Xft.autohint: 0 +Xft.antialias: 1 +Xft.hinting: true +Xft.hintstyle: hintslight +Xft.dpi: 96 +Xft.rgba: rgb +Xft.lcdfilter: lcddefault + +! Fonts {{{ +#ifdef SRVR_t460 +Xft.dpi: 104 +#endif +#ifdef SRVR_intelnuc +Xft.dpi: 108 +#endif +#ifdef SRVR_x270 +Xft.dpi: 96 +#endif +#ifdef SRVR_t14s +Xft.dpi: 96 +#endif +#ifdef SRVR_x1c6 +Xft.dpi: 96 +#endif +#ifdef SRVR_x13amdg4 +Xft.dpi: 188 +#endif +#ifdef SRVR_xmgneo +Xft.dpi: 188 +#endif +! }}} diff --git a/DotFiles/.bash_profile b/DotFiles/.bash_profile new file mode 100644 index 00000000..85e6b15f --- /dev/null +++ b/DotFiles/.bash_profile @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +logger -t "startup-initfile" BASH_PROFILE +[ -f ~/.profile ] && . ~/.profile || true +[ -f ~/.bashrc ] && . ~/.bashrc || true +#emacs --bg-daemon &> /dev/null & + +[ -f "${HOME}/.bash_profile.local" ] && . "${HOME}/.bash_profile.local" +[ -f "${HOME}/.cargo/env" ] && . "$HOME/.cargo/env" +sway-autostart diff --git a/DotFiles/.bashrc b/DotFiles/.bashrc new file mode 100755 index 00000000..c0130cf3 --- /dev/null +++ b/DotFiles/.bashrc @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +logger -t "startup-initfile" BASHRC +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + dumb) color_prompt=no;; + xterm-256color) color_prompt=no;; + *) color_prompt=no + ;; +esac + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt=no + fi +fi + +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +stty -ixon + +GPG_TTY=$(tty) +export GPG_TTY +# Set up fzf key bindings and fuzzy completion +eval "$(fzf --bash)" + +if [ -f "${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh" ]; then + GIT_PROMPT_ONLY_IN_REPO=1 + source "${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh" +fi diff --git a/DotFiles/.clang-format b/DotFiles/.clang-format new file mode 100644 index 00000000..9149d835 --- /dev/null +++ b/DotFiles/.clang-format @@ -0,0 +1,13 @@ +# Maintained in linux-config.org +BasedOnStyle: Google +Language: Cpp +IndentWidth: 4 +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AccessModifierOffset: -4 +PointerAlignment: Left +ColumnLimit: 80 +KeepEmptyLinesAtTheStartOfBlocks: true diff --git a/DotFiles/.gdbinit b/DotFiles/.gdbinit new file mode 100755 index 00000000..ab24ab39 --- /dev/null +++ b/DotFiles/.gdbinit @@ -0,0 +1,90 @@ +# Maintained in linux-config.org + +set auto-load safe-path / +set auto-load local-gdbinit on +set history save on +set history filename ~/.gdb_history +set history size 32768 +set history expansion on + +set output-radix 16 + +define pretty +set print pretty on +set print symbol-filename on +set pagination off +set confirm off +set print array off +set print array-indexes on +set print address off +set print symbol-filename off +end + +pretty + +define lsource +list *$rip +end + +define il +info locals $arg0 +end + +define ila +info locals +end + + +define hook-quit +#shell tmux kill-session -t "$(voltron-session)" &> /dev/null +#shell tmux kill-session -t "$(tmux-current-session)" &> /dev/null +end + +#### Initialise GEF Session +define gef-init + +source ~/bin/thirdparty/gef/gef.py + +define f +frame $arg0 +context +end + +define hook-up +context +end + +define hook-down +context +end + +gef save updates ~/.gef.rc +gef config context.layout "legend regs stack -args source code -threads -trace -extra -memory" +gef config context.nb_lines_code 13 +gef config context.nb_lines_code_prev 6 +gef config context.nb_lines_stack 4 +tmux-setup +# context +# shell tmux select-pane -t .0 + +end + +#### Initialise Voltron Session +define voltron-init +source ~/bin/thirdparty/pyenv/versions/3.9.2/lib/python3.9/site-packages/voltron/entry.py + +alias vtty = shell tmux-pane-tty voltron 4 + +define voltron-source-tty +shell tmux-pane-tty +end + +voltron init + +end + +#### Initialise utility extensions +define ext-init +gef-init +voltron-init +end diff --git a/DotFiles/.gnupg/gpg-agent.conf b/DotFiles/.gnupg/gpg-agent.conf new file mode 100644 index 00000000..77c1e4bb --- /dev/null +++ b/DotFiles/.gnupg/gpg-agent.conf @@ -0,0 +1,9 @@ +# Maintained in linux-config.org +#gpg-preset-passphrase +allow-preset-passphrase +pinentry-program /usr/bin/pinentry +max-cache-ttl 86400 +default-cache-ttl 86400 +max-cache-ttl-ssh 86400 +default-cache-ttl-ssh 86400 +enable-ssh-support diff --git a/DotFiles/.gnupg/gpg.conf b/DotFiles/.gnupg/gpg.conf new file mode 100644 index 00000000..27e2a890 --- /dev/null +++ b/DotFiles/.gnupg/gpg.conf @@ -0,0 +1,2 @@ +# Maintained in linux-config.org +use-agent diff --git a/DotFiles/.ignore b/DotFiles/.ignore new file mode 100644 index 00000000..1424a850 --- /dev/null +++ b/DotFiles/.ignore @@ -0,0 +1,5 @@ +# Maintained in linux-config.org +*~ +.git +cache +.cache diff --git a/DotFiles/.lldbinit b/DotFiles/.lldbinit new file mode 100755 index 00000000..935c87e8 --- /dev/null +++ b/DotFiles/.lldbinit @@ -0,0 +1,48 @@ +# Maintained in linux-config.org + +#settings write -f .lldb-settings-local-start +#settings read -f .lldb-settings-local + +settings set target.load-cwd-lldbinit true +settings set interpreter.prompt-on-quit false +settings set target.x86-disassembly-flavor intel + +command alias bfl breakpoint set -f %1 -l %2 +command alias lv command script import "~/bin/thirdparty/pyenv/versions/3.9.2/lib/python3.9/site-packages/voltron/entry.py" +command alias sl source list -a $rip +command alias so thread step-out +#auto breaks - annotate code with labels eg debug_inspect__var_of_interest +command alias b_inspect breakpoint set -p "debug_inspect_" +command alias b_call breakpoint set -p "debug_call_" + +# regexp break points arent pending/deferred +#b_inspect +#b_call + +command regex rlook 's/(.+)/image lookup -rn %1/' + +#breg X will break at *X* labels +command regex breg 's/(.+)/breakpoint set -p "%1"/' +#bdeb X will break at debug*X labels +command regex bdeb 's/(.+)/breakpoint set -p "debug_(.+)%1"/' +#bcall X will break at debug_call__X labels +command regex bcall 's/(.+)/breakpoint set -p "debug_call__%1"/' +#binsp X will break at debug_inspect__X labels +command regex binsp 's/(.+)/breakpoint set -p "debug_inspect__%1"/' + +command regex srcb 's/([0-9]+)/settings set stop-line-count-before %1/' +srcb 2 +command regex srca 's/([0-9]+)/settings set stop-line-count-after %1/' +srca 3 + +settings set stop-disassembly-display no-debuginfo + +#step into stl +settings set target.process.thread.step-avoid-regexp "" + + +#alias vtty = shell tmux-pane-tty voltron 4 + +#define voltron-source-tty +#shell tmux-pane-tty +#end diff --git a/DotFiles/.mbsyncrc b/DotFiles/.mbsyncrc new file mode 100644 index 00000000..998347eb --- /dev/null +++ b/DotFiles/.mbsyncrc @@ -0,0 +1,114 @@ +# Maintained in linux-config.org +Create Both +Expunge Both +SyncState * + +IMAPAccount gmx +Host imap.gmx.com +User rileyrg@gmx.de +PassCmd "pass Email/gmx/apps/mbsync" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt +PipelineDepth 1 + +IMAPStore gmx-remote +Account gmx + +MaildirStore gmx-local +Path ~/Maildir/gmx/ +Inbox ~/Maildir/gmx/INBOX +SubFolders Legacy + +Channel gmx-inbox +Far :gmx-remote:"INBOX" +Near :gmx-local:"INBOX" + +Channel gmx-sent +Far :gmx-remote:"Gesendet" +Near :gmx-local:"Sent" + +Channel gmx-learning +Far :gmx-remote:"Learning" +Near :gmx-local:"Learning" + +Channel gmx-drafts +Far :gmx-remote:"Entw&APw-rfe" +Near :gmx-local:"Drafts" + +Channel gmx-bin +Far :gmx-remote:"Gel&APY-scht" +Near :gmx-local:"Bin" + +Channel gmx-spam +Far :gmx-remote:"Spamverdacht" +Near :gmx-local:"Spam" + +Channel gmx-archive +Far :gmx-remote:"Archiv" +Near :gmx-local:"Archive" + +Group gmx +Channel gmx-inbox +Channel gmx-sent +Channel gmx-drafts +Channel gmx-bin +Channel gmx-spam +Channel gmx-archive + +Group gmx-special-interest +Channel gmx-learning + +IMAPAccount gmail +Host imap.gmail.com +User rileyrg@gmail.com +PassCmd "pass Email/gmail/apps/mbsync" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt +PipelineDepth 32 + +IMAPStore gmail-remote +Account gmail + +MaildirStore gmail-local +Path ~/Maildir/gmail/ +Inbox ~/Maildir/gmail/INBOX +SubFolders Legacy + +Channel gmail-inbox +Far :gmail-remote:"INBOX" +Near :gmail-local:"INBOX" + +Channel gmail-sent +Far :gmail-remote:"[Google Mail]/Sent Mail" +Near :gmail-local:"Sent" + +Channel gmail-drafts +Far :gmail-remote:"[Google Mail]/Drafts" +Near :gmail-local:"Drafts" + +Channel gmail-bin +Far :gmail-remote:"[Google Mail]/Bin" +Near :gmail-local:"Bin" + +Channel gmail-spam +Far :gmail-remote:"[Google Mail]/Spam" +Near :gmail-local:"Spam" + +Channel gmail-archive +Far :gmail-remote:"[Google Mail]/All Mail" +Near :gmail-local:"Archive" + +Channel gmail-gmx-archive +Far :gmail-remote:"[Google Mail]/All Mail" +Near :gmx-local:"gmail/Archive" + +Group gmail +Channel gmail-inbox +Channel gmail-sent +Channel gmail-drafts +Channel gmail-bin +Channel gmail-spam +Channel gmail-archive + +Group gmail-gmx +Channel gmail-gmx-archive diff --git a/DotFiles/.profile b/DotFiles/.profile new file mode 100755 index 00000000..e3801b76 --- /dev/null +++ b/DotFiles/.profile @@ -0,0 +1,111 @@ +# Maintained in linux-config.org +logger -t "startup-initfile" PROFILE + +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +export DOT_PROFILE_SOURCED=1 + +export PRINTER="Canon_TR8500_series" + +export PROMPT_COMMAND='history -a' + +export ALTERNATE_EDITOR="" +export EDITOR="emacsclient -t" +export VISUAL="emacsclient -r" +# export EAT_SHELL_INTEGRATION_DIR="$HOME/.emacs.d/straight/build/eat/integration" + + +export HISTSIZE=2056 +export HISTCONTROL=ignoreboth:erasedups + +# export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig + +export ARDUINO_SDK_PATH="${HOME}"/cloud/homefiles/development/arduino/arduinoSDK +export CMAKE_EXPORT_COMPILE_COMMANDS=1 + +export RIPGREP_CONFIG_PATH="${HOME}"/.ripgreprc + +# OBS recording studio +# export QT_QPA_PLATFORM=wayland +export QT_QPA_PLATFORM="xcb" + +#alias man=eman + +export PATH="${HOME}/bin":"${HOME}/bin/sway":"${HOME}/.local/bin":"${HOME}/.emacs.d/bin":"${HOME}/bin/thirdparty/emacs/bin":"${HOME}/.cargo/bin":"./node_modules/.bin":"${PATH}" + +export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +export USE_GPG_FOR_SSH="yes" # used in xsession + +if [ -z "$XDG_CONFIG_HOME" ] +then + export XDG_CONFIG_HOME="${HOME}/.config" +fi + +# for sway waybar tray +export XDG_CURRENT_DESKTOP=sway +export XDG_SESSION_DESKTOP=sway + +export GRIM_DEFAULT_DIR="${HOME}/tmp" + +systemctl start --user mbsync.timer + +#homebrew +test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" + +export FZF_TMUX_OPTS=1 +export FZF_TMUX_OPTS="-d 40%" + +export BAT_POWER_SUSPEND_LEVEL=30 +export BAT_POWER_POLL_CYCLE=300 + +discharge-suspend & + +export XKB_DEFAULT_LAYOUT=de +export XKB_DEFAULT_OPTIONS=ctrl:nocaps + +export PATH="${HOME}/bin/thirdparty/flutter/bin:$PATH" + +export PATH="${HOME}"/bin/llvm:"${HOME}"/bin/llvm/build/bin:"$PATH" + +export PURE_PYTHON=1 + +# haskell +#source "${HOME}/.ghcup/env" + +export PYENV_ROOT="${HOME}/bin/thirdparty/pyenv" +export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init --path)" + +# platformio integration - point to pio ide (vscode) stuff. +export PATH="${PATH}:${HOME}/.platformio/penv/bin" + +# android sdk +export ANDROID_HOME="${HOME}/development/Android/Sdk" +export PATH="${PATH}:${ANDROID_HOME}/emulator" +export PATH="${PATH}:${ANDROID_HOME}/platform-tools" + +export ANDROID_STUDIO_HOME="${HOME}/bin/thirdparty/android-studio" +export PATH="${PATH}:${ANDROID_STUDIO_HOME}/bin" + +export NVM_DIR="$HOME/.config/nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm + +export PATH="/snap/bin:$PATH" + +# platformio integration - point to pio ide (vscode) stuff. +export PATH="${PATH}:${HOME}/bin/thirdparty/stm32cubeide_1.9.0" + +export USER_STARTX_START= + +# fix for java apps in sway +export _JAVA_AWT_WM_NONREPARENTING=1 +pgrep emacs > /dev/null || (emacs --daemon="general" > /dev/null 2>&1 & ) +[ -f "${HOME}/.profile.local" ] && . "${HOME}/.profile.local" diff --git a/DotFiles/.ripgreprc b/DotFiles/.ripgreprc new file mode 100755 index 00000000..8c361652 --- /dev/null +++ b/DotFiles/.ripgreprc @@ -0,0 +1,14 @@ +# Maintained in linux-config.org +# Don't let ripgrep vomit really long lines to my terminal, and show a preview. +--max-columns=150 + +# Set the colors. +--color=never +--colors=line:none +--colors=line:style:bold + +# Because who cares about case!? +--smart-case + +#ignore .gitignore +# --no-ignore-vcs diff --git a/DotFiles/.syncrclone/config.py b/DotFiles/.syncrclone/config.py new file mode 120000 index 00000000..46fa2603 --- /dev/null +++ b/DotFiles/.syncrclone/config.py @@ -0,0 +1 @@ +hetzner-config.py \ No newline at end of file diff --git a/DotFiles/.syncrclone/crontab.intelnuc b/DotFiles/.syncrclone/crontab.intelnuc new file mode 100644 index 00000000..bab706d1 --- /dev/null +++ b/DotFiles/.syncrclone/crontab.intelnuc @@ -0,0 +1,2 @@ +30 4 * * * . $HOME/.profile; export SYNC_CRON=1;syncrclone-once +30 3 * * * . $HOME/.profile; syncrclone /home/rgr/.syncrclone/gdrive-config.py diff --git a/DotFiles/.syncrclone/crontab.t14s b/DotFiles/.syncrclone/crontab.t14s new file mode 100644 index 00000000..0337b477 --- /dev/null +++ b/DotFiles/.syncrclone/crontab.t14s @@ -0,0 +1,2 @@ +0 7-23/2 * * * . $HOME/.profile; export SYNC_CRON=1;syncrclone-once +30 22 * * * . $HOME/.profile; syncrclone /home/rgr/.syncrclone/gdrive-config.py diff --git a/DotFiles/.syncrclone/crontab.x1c6 b/DotFiles/.syncrclone/crontab.x1c6 new file mode 100644 index 00000000..5bc3f55e --- /dev/null +++ b/DotFiles/.syncrclone/crontab.x1c6 @@ -0,0 +1,2 @@ +0 8-20/2 * * * . $HOME/.profile; export SYNC_CRON=1;syncrclone-once +30 11 * * * . $HOME/.profile; syncrclone /home/rgr/.syncrclone/gdrive-config.py diff --git a/DotFiles/.syncrclone/excludes.txt b/DotFiles/.syncrclone/excludes.txt new file mode 100644 index 00000000..3af056cf --- /dev/null +++ b/DotFiles/.syncrclone/excludes.txt @@ -0,0 +1,8 @@ +- .android/avd/ +- hexchat/logs/ +- hexchat/scrollback/ +- cache/ +- rclone/rclone.conf +- .syncrclone/logs/ +- .syncrclone/backups/ +- emacs-config/straight/ diff --git a/DotFiles/.syncrclone/gdrive-config.py b/DotFiles/.syncrclone/gdrive-config.py new file mode 100644 index 00000000..afce26e9 --- /dev/null +++ b/DotFiles/.syncrclone/gdrive-config.py @@ -0,0 +1,295 @@ +# Maintained in linux-config.org rgr +""" +syncrclone + +Config File + +This configuration file is read as Python so things can be customized as +desired. With few exception, any missing items will go to the defaults +already specified. + +Flags should always be a list. +Example: `--exclude myfile` will be ['--exclude','myfile'] + +This is *ALWAYS* evaluated from the parent of this file. + +""" +## Remotes: + +# Specify the remotes to be used in the rclone config. This should be the +# root to be synchronized. If local, no need to specify a remote. +# For example: +# +# remoteA = "/full/path/to/local" +# remoteB = "b2:bucket/" +# +# See docs/config_tips.md for some helpful tips and tricks +remoteA = "/home/rgr/cloud/" +remoteB = "gdrive:cloud/" + +# (ADVANCED USAGE) Specify where to store past file lists, backups, logs, locks, etc. +# This value must be either: +# None : (Default) Stored internal to the remote at remote{A/B}:.syncrclone +# string : Specify an alternative location (either same remote or not) which +# DOES NOT OVERLAP with the remote. The only acceptable overlap is when +# set to None. +# +# Note that overlap is tested but isn't perfect in the case of alias remotes. May cause +# issues later in the sync! Not compatible with sync_backups +workdirA = None # /.syncrclone +workdirB = None # /.syncrclone + +# Names are needed so that one directory can sync to OR from multiple +# locations. Names should be unique. The default below is randomly +# set +import subprocess +name = subprocess.check_output("hostname").rstrip() +name = name.decode("utf-8") +import hashlib +name += hashlib.md5(f"{remoteA}{remoteB}".encode()).hexdigest() + +## rclone flags + +# Specify the path to the rclone executable. +rclone_exe = "rclone" + +# Specify FILTERING flags only. Note that if filtering flags are used later, +# it *will* cause issues. Examples of rclone filters: +# --include --exclude +# --include-from --exclude-from +# --filter --filter-from +# +# note that ['--filter','- .syncrclone/**'] is automatically prepended. +# +# These should be specified as a list. For example, to exclude *.exc, do +# ['--exclude','*.exc'] + +## +# See warnings in the readme about --exclude-if-present +filter_flags = ["--filter-from", "excludes.txt","--filter-from", "gdrive-excludes.txt","--filter-from", "privacy-excludes.txt"] + +# General rclone flags are called every time rclone is called. This is how +# you can specify things like the conifg file. +# Remember that this config is evaluated from its parent directory. +# +# Example: ['--config','path/to/config'] +# +# Note: Not all flags are compatible and may break the behavior of syncrclone +# such as ones changing the display (`--progress`, `--log-level`) +# +# Also, some flags may be needed for certain remotes. See +# https://github.com/Jwink3101/syncrclone/issues/1 +# for a discussion of needing `--drive-skip-gdocs` for gdrive +# +# There is extemely minimal validation of flags. If you're uncertain, have +# a backup and test with `--dry-run` +rclone_flags = [ "--links" ] + +# The following are added to the existing environment. +# These should NOT include any filtering! +rclone_env = {} + +# Additionally, specify flags for only one side or the other. +# Examples would be things like `--fast-list` +rclone_flagsA = [] +rclone_flagsB = ["--fast-list"] + +## Sync Options + +# How to compare files on A and B. Note that mtime also includes size. +# Hashes will be automatic based on common hashes. Will raise an error if +# there are no common hashes. +# Options: {'size','mtime','hash'} +# +# Notes: +# * if using size, can have false negatives. +compare = "mtime" + +# When doing mtime comparisons, what is the error to allow +dt = 1.1 # seconds + +# How to handle conflicts. +# Note that even if comparison is done via hash, you can still resolve via +# mod time. Be aware that not all remotes return reliable mod times and adjust +# accordingly. See https://rclone.org/overview/ +# +# 'A','B' : Always select A or B +# 'tag' : Tag both. Makes tag_conflict irrelevant +# +# 'older','newer' : Select the respective file. See note below. +# 'smaller','larger' : Select the smaller or larger file +# +# If a conflict cannot be resolved it will default to 'tag' and print a warning. +conflict_mode = "newer" + +# You can choose to tag the other file rather than overwrite it. If tagged, +# it will get renamed to have appended `.{time}.{A or B}` to the file +tag_conflict = False + +# Hashes can be expensive to compute on some remotes such as local or sftp. +# As such, rather than recompute them all, the hashes of the previous state +# can be used if the filename,size,mtime all match. Then the hashes of the +# remaining files will be computed in a second rclone call. +# +# For most other remotes (e.g. S3, B2), hashes are stored by the remote +# so there is no need to reuse them +reuse_hashesA = False +reuse_hashesB = False + +# Some remotes (e.g. S3) require an additional API call to get modtimes. If you +# are comparing with 'size' of 'hash', you can forgo this API call by setting +# this to False. Future versions may be smart about this and allow for +# server-side modtime with a cache but that is not yet possible. +always_get_mtime = True + +# When backups are set, all overwrites or deletes will instead be backed up (moved into +# the workdir folder) +backup = True + +# For safety, backups are usually done with a copy but some remotes do not support +# server-side-copy. Using copy then means that you do a download+upload. To be +# more efficient, you can use `move` instead of `copy`. If there is an interruption, +# the file may be in the backup dir and could appear deleted. Nothing *should* be lost +# but care should be taken. +# +# None: Automatic based on remote support +# False: Always use move (not suggested) +# True: Always use copy (safest) +backup_with_copy = None + +# Specify whether to also sync the backed up files between A and B. If True, +# both remotes will have all of the backups. If False, each remote will only +# have what it backed up on the respective side. +# +# Not compatible with specified workdirs +sync_backups = False + +# Some remotes do not support hashes at all (e.g crypt) while others do not +# always return a hash for all files (e.g. S3). When this is encountered, +# syncrclone can fall back to another `compare` or `renames{AB}` attribute. +# Specify as None (default) to instead throw an error. +hash_fail_fallback = None # {'size','mtime',None} + +# By default, syncrclone will set a lock to prevent other sync jobs from +# working at the same time. Note that other tools will not respect these +# locks. They are only for syncrclone. +# +# They are not strictly needed and require extra rclone calls. As such, they +# can be disabled. If disabled, will also NOT respect them from other calls +set_lock = False + +# While transfers will follow the respective rclone flags (e.g. ['--transfers','10'], +# delete, backup, and move actions need more calls. There is some optimization but it +# still may need more than one call. This allows it to happen in separate rclone calls. +# Some remotes do not like concurrent rclone calls so this is the default +action_threads = 1 +# action_threads = __CPU_COUNT__ // 1.5 +# action_threads = 4 + +# syncrclone does not transfer empty directories however if a directory is +# empty after a sync and it was NOT empty before (e.g. the directory was moved +# or deleted), then it can remove them. Note that (a) this only removes +# directories that were *made* empty by syncrclone, and (b) if files still +# exist in the directory (e.g. they were excluded), it will *not* delete them. +# +# This settings doesn't make sense for some remotes. Leave as None to set +# automatically based on whether the remote supports empty directories. +cleanup_empty_dirsA = None +cleanup_empty_dirsB = None + +# By design, syncrclone needs to list all of the files on the remotes AFTER a run as well. +# This can be slow on some remotes so syncrclone can try to reduce relisting at the end by +# using the original. Note that this feature is EXPERIMENTAL. There may be some edge +# cases not considered; especially with regards to move tracking and hashes. +# +# The default used to be False but it is now True. See the docs for more details. +avoid_relist = True + +## Rename Tracking + +# Renames can be tracked if the file is unmodified on both sides and only +# renamed on one side (if it is renamed to the same on both sides, it won't +# do anything). Will not track if a rename cannot be uniquely identified +# +# Tracking is done via the following. Note that the pool of considered +# files are *only* those that have been identified as new. +# +# 'size' : Size of the file only. VERY UNSAFE +# 'mtime' : mtime and size. Slightly safer than size but still risky +# 'hash' : Hash of the files +# None : Disable rename tracking +# +# Because moving files has to be done with individual rclone calls, it is often more +# efficient to disable rename tracking as a delete and copy can be more efficient for +# lots of files. It also doesn't make sense to use renames on A or B if the remote B or A +# doesn't support server-side copy or move. +renamesA = None +renamesB = None + +## Status +# Set the time for status updates while listing slower remotes. Note that for transfer +# status, use rclone_flags = ['--stats','10'] or the like. +list_status_dt = 10 # sec + +## Logs + +# All output is printed to stdout and stderr but this can also be saved and +# uploaded to a remote. Note that the last upload step will not be in the logs +# themselves. The log name is fixed as '{name}_{date}.log' +# +# Can also specify a local location. Useful if both remotes are remote. Recall +# that the paths are relative to this file. If blank, will not save logs +save_logs = True +local_log_dest = "" # NOT on a remote + +## Pre- and Post-shell commands to run +# Specify shell code to be evaluated before and/or after running syncrclone. Note +# these are all run from the directory of this config (as with everything else). +# STDOUT and STDERR will be captured. Note that there is no validation or +# security of the inputs. These are not actually called if using dry-run. +# +# The post shell call also has the "$STATS" environment variable defined which has +# the run statistics including timing (which will be different than the final since +# the logs will not yet have been dumped) +# +# Can be specified as the following: +# +# string : Run with shell=True in the parent directory to this file. +# Can cd as needed and can be multiple lines and multiple commands. +# list : Will execute with shell=False in the parent directory to this file. +# dict : Specify subprocess.Popen flags plus the keyword 'cmd'. YOU decide if +# shell should be True or False based on 'cmd'. syncrclone will override settings +# for std(out/err). Will update os.environ with any 'env' settings. +# +# If the final cmd (specified directly as a list or a list inside the dict), each +# command will be run through C-style formatting. C-Style is used to not break the +# more-common str.format (or f-string) formats that may exist. +# os.environ may be updated with `env` inside of a dict. +# +# Example: +# post_shell = 'echo "$STATS"' +# post_shell = ["echo","%(STATS)s"] +# will look the same +pre_sync_shell = "" +post_sync_shell = "" + +# Be default, even if the shell commands had an error, syncrclone out continue. +# This setting can make it so that it will exit. Note that it ONLY applies to the +# pre_sync_shell script as the only thing to break afterwards is relisting +stop_on_shell_error = False + +# syncrclone needs to write a few temp files for syncing and file listing. By default, +# (when set as None), it uses tempfile.TemporaryDirectory().name which is then plotform +# specific. Alternatively, specify a directory to use for temp files. Remember that paths +# are relative to this file so use an absolute path as needed +# +# NOTE: It is *highly* suggested that you use something unique for each config and/or +# run so as to not clobber each other. See (commented) suggestion +tempdir = None # tempfile.TemporaryDirectory().name +# import time; tempdir = f"/tmp/{name}/{time.time_ns()} + +####### +# This should only be changed by the user when migrating from an older config +# to a newer one. Just because the current version of syncrclone and the version +# below do not match, it does not mean the sync won't work. +_syncrclone_version = "20230310.0.BETA" diff --git a/DotFiles/.syncrclone/gdrive-docs-config.py b/DotFiles/.syncrclone/gdrive-docs-config.py new file mode 100644 index 00000000..2b4a0b79 --- /dev/null +++ b/DotFiles/.syncrclone/gdrive-docs-config.py @@ -0,0 +1,295 @@ +# Maintained in linux-config.org rgr +""" +syncrclone + +Config File + +This configuration file is read as Python so things can be customized as +desired. With few exception, any missing items will go to the defaults +already specified. + +Flags should always be a list. +Example: `--exclude myfile` will be ['--exclude','myfile'] + +This is *ALWAYS* evaluated from the parent of this file. + +""" +## Remotes: + +# Specify the remotes to be used in the rclone config. This should be the +# root to be synchronized. If local, no need to specify a remote. +# For example: +# +# remoteA = "/full/path/to/local" +# remoteB = "b2:bucket/" +# +# See docs/config_tips.md for some helpful tips and tricks +remoteA = "/home/rgr/cloud/homefiles/directories/Documents/" +remoteB = "gdrive:cloud/homefiles/directories/Documents" + +# (ADVANCED USAGE) Specify where to store past file lists, backups, logs, locks, etc. +# This value must be either: +# None : (Default) Stored internal to the remote at remote{A/B}:.syncrclone +# string : Specify an alternative location (either same remote or not) which +# DOES NOT OVERLAP with the remote. The only acceptable overlap is when +# set to None. +# +# Note that overlap is tested but isn't perfect in the case of alias remotes. May cause +# issues later in the sync! Not compatible with sync_backups +workdirA = None # /.syncrclone +workdirB = None # /.syncrclone + +# Names are needed so that one directory can sync to OR from multiple +# locations. Names should be unique. The default below is randomly +# set +import subprocess +name = subprocess.check_output("hostname").rstrip() +name = name.decode("utf-8") +import hashlib +name += hashlib.md5(f"{remoteA}{remoteB}".encode()).hexdigest() + +## rclone flags + +# Specify the path to the rclone executable. +rclone_exe = "rclone" + +# Specify FILTERING flags only. Note that if filtering flags are used later, +# it *will* cause issues. Examples of rclone filters: +# --include --exclude +# --include-from --exclude-from +# --filter --filter-from +# +# note that ['--filter','- .syncrclone/**'] is automatically prepended. +# +# These should be specified as a list. For example, to exclude *.exc, do +# ['--exclude','*.exc'] + +## +# See warnings in the readme about --exclude-if-present +filter_flags = ["--filter-from", "privacy-excludes.txt"] + +# General rclone flags are called every time rclone is called. This is how +# you can specify things like the conifg file. +# Remember that this config is evaluated from its parent directory. +# +# Example: ['--config','path/to/config'] +# +# Note: Not all flags are compatible and may break the behavior of syncrclone +# such as ones changing the display (`--progress`, `--log-level`) +# +# Also, some flags may be needed for certain remotes. See +# https://github.com/Jwink3101/syncrclone/issues/1 +# for a discussion of needing `--drive-skip-gdocs` for gdrive +# +# There is extemely minimal validation of flags. If you're uncertain, have +# a backup and test with `--dry-run` +rclone_flags = [ "--links" ] + +# The following are added to the existing environment. +# These should NOT include any filtering! +rclone_env = {} + +# Additionally, specify flags for only one side or the other. +# Examples would be things like `--fast-list` +rclone_flagsA = [] +rclone_flagsB = ["--fast-list"] + +## Sync Options + +# How to compare files on A and B. Note that mtime also includes size. +# Hashes will be automatic based on common hashes. Will raise an error if +# there are no common hashes. +# Options: {'size','mtime','hash'} +# +# Notes: +# * if using size, can have false negatives. +compare = "mtime" + +# When doing mtime comparisons, what is the error to allow +dt = 1.1 # seconds + +# How to handle conflicts. +# Note that even if comparison is done via hash, you can still resolve via +# mod time. Be aware that not all remotes return reliable mod times and adjust +# accordingly. See https://rclone.org/overview/ +# +# 'A','B' : Always select A or B +# 'tag' : Tag both. Makes tag_conflict irrelevant +# +# 'older','newer' : Select the respective file. See note below. +# 'smaller','larger' : Select the smaller or larger file +# +# If a conflict cannot be resolved it will default to 'tag' and print a warning. +conflict_mode = "newer" + +# You can choose to tag the other file rather than overwrite it. If tagged, +# it will get renamed to have appended `.{time}.{A or B}` to the file +tag_conflict = False + +# Hashes can be expensive to compute on some remotes such as local or sftp. +# As such, rather than recompute them all, the hashes of the previous state +# can be used if the filename,size,mtime all match. Then the hashes of the +# remaining files will be computed in a second rclone call. +# +# For most other remotes (e.g. S3, B2), hashes are stored by the remote +# so there is no need to reuse them +reuse_hashesA = False +reuse_hashesB = False + +# Some remotes (e.g. S3) require an additional API call to get modtimes. If you +# are comparing with 'size' of 'hash', you can forgo this API call by setting +# this to False. Future versions may be smart about this and allow for +# server-side modtime with a cache but that is not yet possible. +always_get_mtime = True + +# When backups are set, all overwrites or deletes will instead be backed up (moved into +# the workdir folder) +backup = True + +# For safety, backups are usually done with a copy but some remotes do not support +# server-side-copy. Using copy then means that you do a download+upload. To be +# more efficient, you can use `move` instead of `copy`. If there is an interruption, +# the file may be in the backup dir and could appear deleted. Nothing *should* be lost +# but care should be taken. +# +# None: Automatic based on remote support +# False: Always use move (not suggested) +# True: Always use copy (safest) +backup_with_copy = None + +# Specify whether to also sync the backed up files between A and B. If True, +# both remotes will have all of the backups. If False, each remote will only +# have what it backed up on the respective side. +# +# Not compatible with specified workdirs +sync_backups = False + +# Some remotes do not support hashes at all (e.g crypt) while others do not +# always return a hash for all files (e.g. S3). When this is encountered, +# syncrclone can fall back to another `compare` or `renames{AB}` attribute. +# Specify as None (default) to instead throw an error. +hash_fail_fallback = None # {'size','mtime',None} + +# By default, syncrclone will set a lock to prevent other sync jobs from +# working at the same time. Note that other tools will not respect these +# locks. They are only for syncrclone. +# +# They are not strictly needed and require extra rclone calls. As such, they +# can be disabled. If disabled, will also NOT respect them from other calls +set_lock = False + +# While transfers will follow the respective rclone flags (e.g. ['--transfers','10'], +# delete, backup, and move actions need more calls. There is some optimization but it +# still may need more than one call. This allows it to happen in separate rclone calls. +# Some remotes do not like concurrent rclone calls so this is the default +action_threads = 1 +# action_threads = __CPU_COUNT__ // 1.5 +# action_threads = 4 + +# syncrclone does not transfer empty directories however if a directory is +# empty after a sync and it was NOT empty before (e.g. the directory was moved +# or deleted), then it can remove them. Note that (a) this only removes +# directories that were *made* empty by syncrclone, and (b) if files still +# exist in the directory (e.g. they were excluded), it will *not* delete them. +# +# This settings doesn't make sense for some remotes. Leave as None to set +# automatically based on whether the remote supports empty directories. +cleanup_empty_dirsA = None +cleanup_empty_dirsB = None + +# By design, syncrclone needs to list all of the files on the remotes AFTER a run as well. +# This can be slow on some remotes so syncrclone can try to reduce relisting at the end by +# using the original. Note that this feature is EXPERIMENTAL. There may be some edge +# cases not considered; especially with regards to move tracking and hashes. +# +# The default used to be False but it is now True. See the docs for more details. +avoid_relist = True + +## Rename Tracking + +# Renames can be tracked if the file is unmodified on both sides and only +# renamed on one side (if it is renamed to the same on both sides, it won't +# do anything). Will not track if a rename cannot be uniquely identified +# +# Tracking is done via the following. Note that the pool of considered +# files are *only* those that have been identified as new. +# +# 'size' : Size of the file only. VERY UNSAFE +# 'mtime' : mtime and size. Slightly safer than size but still risky +# 'hash' : Hash of the files +# None : Disable rename tracking +# +# Because moving files has to be done with individual rclone calls, it is often more +# efficient to disable rename tracking as a delete and copy can be more efficient for +# lots of files. It also doesn't make sense to use renames on A or B if the remote B or A +# doesn't support server-side copy or move. +renamesA = None +renamesB = None + +## Status +# Set the time for status updates while listing slower remotes. Note that for transfer +# status, use rclone_flags = ['--stats','10'] or the like. +list_status_dt = 10 # sec + +## Logs + +# All output is printed to stdout and stderr but this can also be saved and +# uploaded to a remote. Note that the last upload step will not be in the logs +# themselves. The log name is fixed as '{name}_{date}.log' +# +# Can also specify a local location. Useful if both remotes are remote. Recall +# that the paths are relative to this file. If blank, will not save logs +save_logs = True +local_log_dest = "" # NOT on a remote + +## Pre- and Post-shell commands to run +# Specify shell code to be evaluated before and/or after running syncrclone. Note +# these are all run from the directory of this config (as with everything else). +# STDOUT and STDERR will be captured. Note that there is no validation or +# security of the inputs. These are not actually called if using dry-run. +# +# The post shell call also has the "$STATS" environment variable defined which has +# the run statistics including timing (which will be different than the final since +# the logs will not yet have been dumped) +# +# Can be specified as the following: +# +# string : Run with shell=True in the parent directory to this file. +# Can cd as needed and can be multiple lines and multiple commands. +# list : Will execute with shell=False in the parent directory to this file. +# dict : Specify subprocess.Popen flags plus the keyword 'cmd'. YOU decide if +# shell should be True or False based on 'cmd'. syncrclone will override settings +# for std(out/err). Will update os.environ with any 'env' settings. +# +# If the final cmd (specified directly as a list or a list inside the dict), each +# command will be run through C-style formatting. C-Style is used to not break the +# more-common str.format (or f-string) formats that may exist. +# os.environ may be updated with `env` inside of a dict. +# +# Example: +# post_shell = 'echo "$STATS"' +# post_shell = ["echo","%(STATS)s"] +# will look the same +pre_sync_shell = "" +post_sync_shell = "" + +# Be default, even if the shell commands had an error, syncrclone out continue. +# This setting can make it so that it will exit. Note that it ONLY applies to the +# pre_sync_shell script as the only thing to break afterwards is relisting +stop_on_shell_error = False + +# syncrclone needs to write a few temp files for syncing and file listing. By default, +# (when set as None), it uses tempfile.TemporaryDirectory().name which is then plotform +# specific. Alternatively, specify a directory to use for temp files. Remember that paths +# are relative to this file so use an absolute path as needed +# +# NOTE: It is *highly* suggested that you use something unique for each config and/or +# run so as to not clobber each other. See (commented) suggestion +tempdir = None # tempfile.TemporaryDirectory().name +# import time; tempdir = f"/tmp/{name}/{time.time_ns()} + +####### +# This should only be changed by the user when migrating from an older config +# to a newer one. Just because the current version of syncrclone and the version +# below do not match, it does not mean the sync won't work. +_syncrclone_version = "20230310.0.BETA" diff --git a/DotFiles/.syncrclone/gdrive-excludes.txt b/DotFiles/.syncrclone/gdrive-excludes.txt new file mode 100644 index 00000000..a221ecb8 --- /dev/null +++ b/DotFiles/.syncrclone/gdrive-excludes.txt @@ -0,0 +1 @@ +- directories/Documents/ diff --git a/DotFiles/.syncrclone/hetzner-config.py b/DotFiles/.syncrclone/hetzner-config.py new file mode 100644 index 00000000..17d9002e --- /dev/null +++ b/DotFiles/.syncrclone/hetzner-config.py @@ -0,0 +1,292 @@ +# Maintained in linux-config.org +""" +syncrclone + +Config File + +This configuration file is read as Python so things can be customized as +desired. With few exception, any missing items will go to the defaults +already specified. + +Flags should always be a list. +Example: `--exclude myfile` will be ['--exclude','myfile'] + +This is *ALWAYS* evaluated from the parent of this file. + +""" +## Remotes: + +# Specify the remotes to be used in the rclone config. This should be the +# root to be synchronized. If local, no need to specify a remote. +# For example: +# +# remoteA = "/full/path/to/local" +# remoteB = "b2:bucket/" +# +# See docs/config_tips.md for some helpful tips and tricks +remoteA = "/home/rgr/cloud" +remoteB = "hetzner:cloud" + +# (ADVANCED USAGE) Specify where to store past file lists, backups, logs, locks, etc. +# This value must be either: +# None : (Default) Stored internal to the remote at remote{A/B}:.syncrclone +# string : Specify an alternative location (either same remote or not) which +# DOES NOT OVERLAP with the remote. The only acceptable overlap is when +# set to None. +# +# Note that overlap is tested but isn't perfect in the case of alias remotes. May cause +# issues later in the sync! Not compatible with sync_backups +workdirA = None # /.syncrclone +workdirB = None # /.syncrclone + +# Names are needed so that one directory can sync to OR from multiple +# locations. Names should be unique. The default below is randomly +# set +import subprocess +name = subprocess.check_output("hostname").rstrip() +name = name.decode("utf-8") +import hashlib +name += hashlib.md5(f"{remoteA}{remoteB}".encode()).hexdigest() +## rclone flags + +# Specify the path to the rclone executable. +rclone_exe = "rclone" + +# Specify FILTERING flags only. Note that if filtering flags are used later, +# it *will* cause issues. Examples of rclone filters: +# --include --exclude +# --include-from --exclude-from +# --filter --filter-from +# +# note that ['--filter','- .syncrclone/**'] is automatically prepended. +# +# These should be specified as a list. For example, to exclude *.exc, do +# ['--exclude','*.exc'] +# +# See warnings in the readme about --exclude-if-present +filter_flags = ["--filter-from", "excludes.txt","--filter-from", "gdrive-excludes.txt"] + +# General rclone flags are called every time rclone is called. This is how +# you can specify things like the conifg file. +# Remember that this config is evaluated from its parent directory. +# +# Example: ['--config','path/to/config'] +# +# Note: Not all flags are compatible and may break the behavior of syncrclone +# such as ones changing the display (`--progress`, `--log-level`) +# +# Also, some flags may be needed for certain remotes. See +# https://github.com/Jwink3101/syncrclone/issues/1 +# for a discussion of needing `--drive-skip-gdocs` for gdrive +# +# There is extemely minimal validation of flags. If you're uncertain, have +# a backup and test with `--dry-run` +rclone_flags = ["--metadata", "--links","--check-first","--checkers","5","--transfers","5"] +# The following are added to the existing environment. +# These should NOT include any filtering! +rclone_env = {} + +# Additionally, specify flags for only one side or the other. +# Examples would be things like `--fast-list` +rclone_flagsA = [] +#rclone_flagsB = ["--sftp-disable-hashcheck"] +rclone_flagsB = [] +## Sync Options + +# How to compare files on A and B. Note that mtime also includes size. +# Hashes will be automatic based on common hashes. Will raise an error if +# there are no common hashes. +# Options: {'size','mtime','hash'} +# +# Notes: +# * if using size, can have false negatives. +compare = "mtime" + +# When doing mtime comparisons, what is the error to allow +dt = 1.1 # seconds + +# How to handle conflicts. +# Note that even if comparison is done via hash, you can still resolve via +# mod time. Be aware that not all remotes return reliable mod times and adjust +# accordingly. See https://rclone.org/overview/ +# +# 'A','B' : Always select A or B +# 'tag' : Tag both. Makes tag_conflict irrelevant +# +# 'older','newer' : Select the respective file. See note below. +# 'smaller','larger' : Select the smaller or larger file +# +# If a conflict cannot be resolved it will default to 'tag' and print a warning. +conflict_mode = "newer" + +# You can choose to tag the other file rather than overwrite it. If tagged, +# it will get renamed to have appended `.{time}.{A or B}` to the file +tag_conflict = False + +# Hashes can be expensive to compute on some remotes such as local or sftp. +# As such, rather than recompute them all, the hashes of the previous state +# can be used if the filename,size,mtime all match. Then the hashes of the +# remaining files will be computed in a second rclone call. +# +# For most other remotes (e.g. S3, B2), hashes are stored by the remote +# so there is no need to reuse them +reuse_hashesA = False +reuse_hashesB = False + +# Some remotes (e.g. S3) require an additional API call to get modtimes. If you +# are comparing with 'size' of 'hash', you can forgo this API call by setting +# this to False. Future versions may be smart about this and allow for +# server-side modtime with a cache but that is not yet possible. +always_get_mtime = True + +# When backups are set, all overwrites or deletes will instead be backed up (moved into +# the workdir folder) +backup = True + +# For safety, backups are usually done with a copy but some remotes do not support +# server-side-copy. Using copy then means that you do a download+upload. To be +# more efficient, you can use `move` instead of `copy`. If there is an interruption, +# the file may be in the backup dir and could appear deleted. Nothing *should* be lost +# but care should be taken. +# +# None: Automatic based on remote support +# False: Always use move (not suggested) +# True: Always use copy (safest) +backup_with_copy = None + +# Specify whether to also sync the backed up files between A and B. If True, +# both remotes will have all of the backups. If False, each remote will only +# have what it backed up on the respective side. +# +# Not compatible with specified workdirs +sync_backups = False + +# Some remotes do not support hashes at all (e.g crypt) while others do not +# always return a hash for all files (e.g. S3). When this is encountered, +# syncrclone can fall back to another `compare` or `renames{AB}` attribute. +# Specify as None (default) to instead throw an error. +hash_fail_fallback = None # {'size','mtime',None} + +# By default, syncrclone will set a lock to prevent other sync jobs from +# working at the same time. Note that other tools will not respect these +# locks. They are only for syncrclone. +# +# They are not strictly needed and require extra rclone calls. As such, they +# can be disabled. If disabled, will also NOT respect them from other calls +set_lock = False + +# While transfers will follow the respective rclone flags (e.g. ['--transfers','10'], +# delete, backup, and move actions need more calls. There is some optimization but it +# still may need more than one call. This allows it to happen in separate rclone calls. +# Some remotes do not like concurrent rclone calls so this is the default +action_threads = 1 +# action_threads = __CPU_COUNT__ // 1.5 +# action_threads = 4 + +# syncrclone does not transfer empty directories however if a directory is +# empty after a sync and it was NOT empty before (e.g. the directory was moved +# or deleted), then it can remove them. Note that (a) this only removes +# directories that were *made* empty by syncrclone, and (b) if files still +# exist in the directory (e.g. they were excluded), it will *not* delete them. +# +# This settings doesn't make sense for some remotes. Leave as None to set +# automatically based on whether the remote supports empty directories. +cleanup_empty_dirsA = None +cleanup_empty_dirsB = None + +# By design, syncrclone needs to list all of the files on the remotes AFTER a run as well. +# This can be slow on some remotes so syncrclone can try to reduce relisting at the end by +# using the original. Note that this feature is EXPERIMENTAL. There may be some edge +# cases not considered; especially with regards to move tracking and hashes. +# +# The default used to be False but it is now True. See the docs for more details. +avoid_relist = True + +## Rename Tracking + +# Renames can be tracked if the file is unmodified on both sides and only +# renamed on one side (if it is renamed to the same on both sides, it won't +# do anything). Will not track if a rename cannot be uniquely identified +# +# Tracking is done via the following. Note that the pool of considered +# files are *only* those that have been identified as new. +# +# 'size' : Size of the file only. VERY UNSAFE +# 'mtime' : mtime and size. Slightly safer than size but still risky +# 'hash' : Hash of the files +# None : Disable rename tracking +# +# Because moving files has to be done with individual rclone calls, it is often more +# efficient to disable rename tracking as a delete and copy can be more efficient for +# lots of files. It also doesn't make sense to use renames on A or B if the remote B or A +# doesn't support server-side copy or move. +renamesA = None +renamesB = None + +## Status +# Set the time for status updates while listing slower remotes. Note that for transfer +# status, use rclone_flags = ['--stats','10'] or the like. +list_status_dt = 10 # sec + +## Logs + +# All output is printed to stdout and stderr but this can also be saved and +# uploaded to a remote. Note that the last upload step will not be in the logs +# themselves. The log name is fixed as '{name}_{date}.log' +# +# Can also specify a local location. Useful if both remotes are remote. Recall +# that the paths are relative to this file. If blank, will not save logs +save_logs = True +local_log_dest = "" # NOT on a remote + +## Pre- and Post-shell commands to run +# Specify shell code to be evaluated before and/or after running syncrclone. Note +# these are all run from the directory of this config (as with everything else). +# STDOUT and STDERR will be captured. Note that there is no validation or +# security of the inputs. These are not actually called if using dry-run. +# +# The post shell call also has the "$STATS" environment variable defined which has +# the run statistics including timing (which will be different than the final since +# the logs will not yet have been dumped) +# +# Can be specified as the following: +# +# string : Run with shell=True in the parent directory to this file. +# Can cd as needed and can be multiple lines and multiple commands. +# list : Will execute with shell=False in the parent directory to this file. +# dict : Specify subprocess.Popen flags plus the keyword 'cmd'. YOU decide if +# shell should be True or False based on 'cmd'. syncrclone will override settings +# for std(out/err). Will update os.environ with any 'env' settings. +# +# If the final cmd (specified directly as a list or a list inside the dict), each +# command will be run through C-style formatting. C-Style is used to not break the +# more-common str.format (or f-string) formats that may exist. +# os.environ may be updated with `env` inside of a dict. +# +# Example: +# post_shell = 'echo "$STATS"' +# post_shell = ["echo","%(STATS)s"] +# will look the same +pre_sync_shell = "" +post_sync_shell = "" + +# Be default, even if the shell commands had an error, syncrclone out continue. +# This setting can make it so that it will exit. Note that it ONLY applies to the +# pre_sync_shell script as the only thing to break afterwards is relisting +stop_on_shell_error = False + +# syncrclone needs to write a few temp files for syncing and file listing. By default, +# (when set as None), it uses tempfile.TemporaryDirectory().name which is then plotform +# specific. Alternatively, specify a directory to use for temp files. Remember that paths +# are relative to this file so use an absolute path as needed +# +# NOTE: It is *highly* suggested that you use something unique for each config and/or +# run so as to not clobber each other. See (commented) suggestion +tempdir = None # tempfile.TemporaryDirectory().name +# import time; tempdir = f"/tmp/{name}/{time.time_ns()} + +####### +# This should only be changed by the user when migrating from an older config +# to a newer one. Just because the current version of syncrclone and the version +# below do not match, it does not mean the sync won't work. +_syncrclone_version = "20230310.0.BETA" diff --git a/DotFiles/.syncrclone/privacy-excludes.txt b/DotFiles/.syncrclone/privacy-excludes.txt new file mode 100644 index 00000000..b4ee1c58 --- /dev/null +++ b/DotFiles/.syncrclone/privacy-excludes.txt @@ -0,0 +1 @@ +- Personal/certs-passes/ diff --git a/README.md b/README.md new file mode 100644 index 00000000..e1963015 --- /dev/null +++ b/README.md @@ -0,0 +1,3562 @@ + + +# Introduction + + +## Status + +Work in progress!! +Keep most config and scripts in a single org file for documentation. Use org tangling for exporting them. + + +## GIT + + +### ~/.config/git/config + +global git settings +NB - NOT Exported as lots of things want to update it + + [user] + name = rileyrg + email = rileyrg@gmx.de + [push] + default = current + [github] + user = rileyrg + [pull] + rebase = false + + +### master branch, no commit + + #!/bin/sh + branch="$(git rev-parse --abbrev-ref HEAD)" + if [ "$branch" = "master" ]; then + echo "You can't commit directly to master branch" + exit 1 + fi + + +# Basic shell things + + +## X/Sway common + + ! Maintained in linux-config.org + ! Use a truetype font and size. + *.font: -*-JetBrainsMono Nerd Font-*-*-*-*-14-*-*-*-*-*-* + Xft.autohint: 0 + Xft.antialias: 1 + Xft.hinting: true + Xft.hintstyle: hintslight + Xft.dpi: 96 + Xft.rgba: rgb + Xft.lcdfilter: lcddefault + + ! Fonts {{{ + #ifdef SRVR_t460 + Xft.dpi: 104 + #endif + #ifdef SRVR_intelnuc + Xft.dpi: 108 + #endif + #ifdef SRVR_x270 + Xft.dpi: 96 + #endif + #ifdef SRVR_t14s + Xft.dpi: 96 + #endif + #ifdef SRVR_x1c6 + Xft.dpi: 96 + #endif + #ifdef SRVR_x13amdg4 + Xft.dpi: 188 + #endif + #ifdef SRVR_xmgneo + Xft.dpi: 188 + #endif + ! }}} + + +## Bash Startup Files + + +### ~/.profile + + # Maintained in linux-config.org + logger -t "startup-initfile" PROFILE + + # ~/.profile: executed by the command interpreter for login shells. + # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login + # exists. + # see /usr/share/doc/bash/examples/startup-files for examples. + # the files are located in the bash-doc package. + + # the default umask is set in /etc/profile; for setting the umask + # for ssh logins, install and configure the libpam-umask package. + #umask 022 + + export DOT_PROFILE_SOURCED=1 + + export PRINTER="Canon_TR8500_series" + + export PROMPT_COMMAND='history -a' + + export ALTERNATE_EDITOR="" + export EDITOR="emacsclient -t" + export VISUAL="emacsclient -r" + # export EAT_SHELL_INTEGRATION_DIR="$HOME/.emacs.d/straight/build/eat/integration" + + + export HISTSIZE=2056 + export HISTCONTROL=ignoreboth:erasedups + + # export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig + + export ARDUINO_SDK_PATH="${HOME}"/cloud/homefiles/development/arduino/arduinoSDK + export CMAKE_EXPORT_COMPILE_COMMANDS=1 + + export RIPGREP_CONFIG_PATH="${HOME}"/.ripgreprc + + # OBS recording studio + # export QT_QPA_PLATFORM=wayland + export QT_QPA_PLATFORM="xcb" + + #alias man=eman + + export PATH="${HOME}/bin":"${HOME}/bin/sway":"${HOME}/.local/bin":"${HOME}/.emacs.d/bin":"${HOME}/bin/thirdparty/emacs/bin":"${HOME}/.cargo/bin":"./node_modules/.bin":"${PATH}" + + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + export USE_GPG_FOR_SSH="yes" # used in xsession + + if [ -z "$XDG_CONFIG_HOME" ] + then + export XDG_CONFIG_HOME="${HOME}/.config" + fi + + # for sway waybar tray + export XDG_CURRENT_DESKTOP=sway + export XDG_SESSION_DESKTOP=sway + + export GRIM_DEFAULT_DIR="${HOME}/tmp" + + systemctl start --user mbsync.timer + + #homebrew + test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" + + +### ~/.bash\_profile + + #!/usr/bin/env bash + # Maintained in linux-config.org + logger -t "startup-initfile" BASH_PROFILE + [ -f ~/.profile ] && . ~/.profile || true + [ -f ~/.bashrc ] && . ~/.bashrc || true + #emacs --bg-daemon &> /dev/null & + + +### ~/.bashrc + + #!/usr/bin/env bash + # Maintained in linux-config.org + logger -t "startup-initfile" BASHRC + # ~/.bashrc: executed by bash(1) for non-login shells. + # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) + # for examples + + # If not running interactively, don't do anything + [ -z "$PS1" ] && return + + # check the window size after each command and, if necessary, + # update the values of LINES and COLUMNS. + shopt -s checkwinsize + + # set variable identifying the chroot you work in (used in the prompt below) + if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) + fi + + # set a fancy prompt (non-color, unless we know we "want" color) + case "$TERM" in + dumb) color_prompt=no;; + xterm-256color) color_prompt=no;; + *) color_prompt=no + ;; + esac + + if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt=no + fi + fi + + if [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi + + stty -ixon + + GPG_TTY=$(tty) + export GPG_TTY + # Set up fzf key bindings and fuzzy completion + eval "$(fzf --bash)" + +1. bash git prompt + + if [ -f "${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh" ]; then + GIT_PROMPT_ONLY_IN_REPO=1 + source "${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh" + fi + + +## ZSH Related + + +### ~/.config/zsh/.zshrc + + # Maintained in linux-config.org + logger -t "startup-initfile" ZSHRC + [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return + export TERM="kitty" + # Path to your oh-my-zsh installation. + export ZSH="${XDG_CONFIG_HOME}/zsh/oh-my-zsh" + + if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + ZSH_TMUX_AUTOSTART=true + else + ZSH_TMUX_AUTOSTART=false + fi + + # ZSH_TMUX_ + AUTOSTART_ONCE=true + ZSH_TMUX_AUTOCONNECT=true + ZSH_TMUX_AUTOQUIT=true + + # Set name of the theme to load --- if set to "random", it will + # load a random theme each time oh-my-zsh is loaded, in which case, + # to know which specific one was loaded, run: echo $RANDOM_THEME + # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes + + ZSH_THEME=robbyrussell + + # ZSH_THEME="agnoster" + + # Set list of themes to pick from when loading at random + # Setting this variable when ZSH_THEME=random will cause zsh to load + # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ + # If set to an empty array, this variable will have no effect. + # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + + # Uncomment the following line to use case-sensitive completion. + # CASE_SENSITIVE="true" + + # Uncomment the following line to use hyphen-insensitive completion. + # Case-sensitive completion must be off. _ and - will be interchangeable. + # HYPHEN_INSENSITIVE="true" + + # Uncomment the following line to disable bi-weekly auto-update checks. + # DISABLE_AUTO_UPDATE="true" + + # Uncomment the following line to change how often to auto-update (in days). + # export UPDATE_ZSH_DAYS=13 + + # Uncomment the following line to disable colors in ls. + # DISABLE_LS_COLORS="true" + + # Uncomment the following line to disable auto-setting terminal title. + # DISABLE_AUTO_TITLE="true" + + # Uncomment the following line to enable command auto-correction. + # ENABLE_CORRECTION="true" + + # Uncomment the following line to display red dots whilst waiting for completion. + # COMPLETION_WAITING_DOTS="true" + + # Uncomment the following line if you want to disable marking untracked files + # under VCS as dirty. This makes repository status check for large repositories + # much, much faster. + DISABLE_UNTRACKED_FILES_DIRTY="true" + + # Uncomment the following line if you want to change the command execution time + # stamp shown in the history command output. + # You can set one of the optional three formats: + # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" + # or set a custom format using the strftime function format specifications, + # see 'man strftime' for details. + # HIST_STAMPS="mm/dd/yyyy" + + # Would you like to use another custom folder than $ZSH/custom? + # ZSH_CUSTOM=/path/to/new-custom-folder + + # Which plugins would you like to load? + # Standard plugins can be found in ~/.oh-my-zsh/plugins/* + # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ + # Example format: plugins=(rails git textmate ruby lighthouse) + # Add wisely, as too many plugins slow down shell startup. + plugins=( + zsh-autosuggestions + dotenv + chucknorris + vi-mode + tmux + safe-paste + colored-man-pages + zsh-syntax-highlighting + ) + export HISTFILE=${XDG_CONFIG_HOME}/zsh/.zsh_history_$HOST + + setopt EXTENDED_HISTORY + setopt SHARE_HISTORY + setopt HIST_IGNORE_SPACE + setopt HIST_FIND_NO_DUPS + setopt HIST_BEEP + + + source $ZSH/oh-my-zsh.sh + + # User configuration + setopt extended_glob + bindkey "^[[5~" history-beginning-search-backward + bindkey "^[[6~" history-beginning-search-forward + + # Set personal aliases, overriding those provided by oh-my-zsh libs, + # plugins, and themes. Aliases can be placed here, though oh-my-zsh + # users are encouraged to define aliases within the ZSH_CUSTOM folder. + # For a full list of active aliases, run `alias`. + # + # Example aliases + # alias zshconfig="mate ~/.zshrc" + # alias ohmyzsh="mate ~/.oh-my-zsh" + # + # GREP_OPTIONS="--color=never" + POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # DEFAULT_USER means we dont show user and host in normal shell prompt + DEFAULT_USER=$USER + # Set up fzf key bindings and fuzzy completion + source <(fzf --zsh) + command -v "fdfind" >> /dev/null && export FZF_DEFAULT_COMMAND="fdfind . $HOME" + + [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \ + source "$EAT_SHELL_INTEGRATION_DIR/zsh" + + xhost +local: > /dev/null 2>&1 + + +### ~/.config/zsh/.zlogin + + # Maintained in linux-config.org + logger -t "startup-initfile" ZLOGIN + # [ -s "${HOME}/.rvm/scripts/rvm" ] && source "${HOME}/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* + if [[ -z $DOT_PROFILE_SOURCED ]]; then + if [ -f ~/.profile ]; then + emulate sh -c '. ~/.profile' + fi + fi + if [ "$(tty)" = "/dev/tty1" ];then + chuck + sway-autostart + fi + + +### zprofile + + # Maintained in linux-config.org + + +### ~/.zshenv + + # Maintained in linux-config.org + if [ -z "$XDG_CONFIG_HOME" ] && [ -d "${HOME}/.config" ] + then + export XDG_CONFIG_HOME="${HOME}/.config" + fi + + xhost +SI:localuser:root &> /dev/null + + ZDOTDIR=$HOME/.config/zsh + [ -f "${HOME}/.cargo/env" ] && . "${HOME}/.cargo/env" + + +### Oh-My-Zsh Related + +Directory is [here](.oh-my-zsh/). + +1. Aliases ~/.config/zsh/oh-my-zsh/custom/aliases.zsh + + # Maintained in linux-config.org + alias grep="grep -n --color" + alias hg='history|grep' + +2. Functions ~/.config/zsh/oh-my-zsh/custom/functions.zsh + + mkc () { + mkdir -p "$@" && cd "$@" #create full path and cd to it + + } + + +## Tmux :tmux: + + +### ~/.profile + + export FZF_TMUX_OPTS=1 + export FZF_TMUX_OPTS="-d 40%" + + +### .config/tmux/tmux.conf + + # Maintained in linux-config.org + # Change the prefix key to C-a + set-option -g status on + set-option -g status-interval 1 + set-option -g status-justify centre + set-option -g status-keys vi + set-option -g status-position bottom + set-option -g status-style fg=colour136,bg=colour235 + set-option -g status-left-length 20 + set-option -g status-left-style default + set-option -g status-left "#[fg=green]#H #[fg=black]β€’ #[fg=green,bright]#(uname -r)#[default]" + set-option -g status-right-length 140 + set-option -g status-right-style default + set-option -g status-right "#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) " + set-option -ag status-right "#[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',') " + set-option -ag status-right " #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d" + set-window-option -g window-status-style fg=colour244 + set-window-option -g window-status-style bg=default + set-window-option -g window-status-current-style fg=colour166 + set-window-option -g window-status-current-style bg=default + + set-option -g default-shell /bin/zsh + set-option -ga update-environment SWAYSOCK + + set -g prefix C-a + + unbind C-b + bind C-a send-prefix + + set -g pane-border-format "#{pane_index} #{pane_title} tty:#{pane_tty}" + set -g pane-border-status bottom + + # reload tmux config + bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..." + + # To copy, left click and drag to highlight text in yellow, + # once you release left click yellow text will disappear and will automatically be available in clibboard + # # Use vim keybindings in copy mode + setw -g mode-keys vi + + bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" + bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" + bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" + + # Some extra key bindings to select higher numbered windows + bind F1 selectw -t:10 + bind F2 selectw -t:11 + bind F3 selectw -t:12 + bind F4 selectw -t:13 + bind F5 selectw -t:14 + bind F6 selectw -t:15 + bind F7 selectw -t:16 + bind F8 selectw -t:17 + bind F9 selectw -t:18 + bind F10 selectw -t:19 + bind F11 selectw -t:20 + bind F12 selectw -t:21 + + # A key to toggle between smallest and largest sizes if a window is visible in + # multiple places + bind F set -w window-size + + # Keys to toggle monitoring activity in a window and the synchronize-panes option + bind m set monitor-activity + bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}' + + bind K kill-session + bind x kill-pane + bind X kill-pane -a + bind c command-prompt -p "window name:" "new-window; rename-window '%%'" + bind + new-window + new -d -s0 + # neww -d -nemacs 'exec emacsclient -nw ~/.emacs.d/linux-init/inits.org' + # setw -t0:1 aggressive-resize on + # neww -d -nhtop 'exec htop' + + # Use Alt-arrow keys without prefix key to switch panes + bind -n M-Left select-pane -L + bind -n M-Right select-pane -R + bind -n M-Up select-pane -U + bind -n M-Down select-pane -D + + set -g mouse on + set -g @yank_selection 'clipboard' # 'primary' or 'secondary' or 'clipboard' + set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary' + # List of plugins + set -g @plugin 'tmux-plugins/tpm' + set -g @plugin 'tmux-plugins/tmux-sensible' + set -g @plugin 'tmux-plugins/tmux-yank' + set -g @plugin 'tmux-plugins/tmux-resurrect' + set -g @plugin 'sainnhe/tmux-fzf' + + run -b '~/.config/tmux/plugins/tpm/tpm' + + +### ~/bin/tmux-current-session + + #!/usr/bin/env bash + # Maintained in linux-config.org + echo "$(tmux list-panes -t "$TMUX_PANE" -F '#S' | head -n1)" + + +### ~/bin/tmux-pane-tty + +Written to find the tty for a pane in order to redirect gef context source to a voltron pane + + #!/usr/bin/env bash + #Maintained in linux-config.org + session="${1:-""}" + [ -z ${session} ] && exit 1 + pane_index="${2:-0}" + window="${3:-0}" + tmux list-panes -t "${session}:${window}" -F 'pane_index:#{pane_index} #{pane_tty}' | awk '/pane_index:'"${pane_index}"'/ {print $2 }' + + +# TODO Power Related + +Caveat - for my thinkpads. +Script that checks for a .BATTERY\_POWER\_LOW file and if its there and +we're discharging, it suspends the laptop. If it's there and we're +charging it deletes it. If its not there and we're below a certain +threshold and we're discharging, create. It runs as a looping bash +script kicked off in **.profile** as cron jobs cant escalate systemctl +priviliges. Or something. + + +## requirements + +Linux sys directory ***sys/class/power\_supply/BAT0*** is +there. **notify-send** and **beep** are installed. + + +## ~/bin/discharge-suspend + +If you want to stop the suspend then create file +**~/.BAT\_POWER\_SUSPEND\_SUSPEND**. This defaults to 30% battery level as +the suspend threshold but you can set an ENV variable +**BAT\_POWER\_SUSPEND\_LEVEL** to override it. The polling period is every +ten minutes which can be overridden with the ENV **.BAT\_POWER\_POLL\_CYCLE**. + + #!/usr/bin/env bash + # Maintained in linux-config.org + # + # + pollCycle=${BAT_POWER_POLL_CYCLE:-600} + while true; do + sleep "$pollCycle" + if [ ! -f ~/.BAT_POWER_SUSPEND_SUSPEND ];then + mapfile -t batStats< <(cat /sys/class/power_supply/BAT0/{status,capacity}) + status=${batStats[0]} + level=${batStats[1]} + if [ "$status" = "Discharging" ]; then + if [ "$level" -le "${BAT_POWER_SUSPEND_LEVEL:-30}" ]; then + if [ -f ~/.BAT_POWER_LOW ]; then + notify-send "** SUSPENDING in 15 SECONDS **" + beep + sleep 15 + rm ~/.BAT_POWER_LOW + systemctl suspend + else + touch ~/.BAT_POWER_LOW + notify-send "**WARNING**" "Battery low. Suspending in ${pollCycle} seconds." + beep + fi + fi + else + rm -f ~/.BAT_POWER_LOW + fi + fi + done + + +## ENV SET + + export BAT_POWER_SUSPEND_LEVEL=30 + export BAT_POWER_POLL_CYCLE=300 + + +## exec discharge-suspend + + discharge-suspend & + + +# Network + + +## ~/bin/network-online + + #!/usr/bin/env bash + #Maintained in linux-config.org + wget -q --spider http://google.com + + +# Editors + + +## emacs + + +### sway-editor + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-do-tool "Emacs-general" || emacsclient -s "general" -n -c && sleep 1 && sway-do-tool "Emacs-general" + + +## Vim + + +### ~/.vimrc + + " Maintained in linux-config.org + set nocompatible " be iMproved, required + filetype off " required + + call plug#begin('~/.vim/plugged') + + Plug 'scrooloose/nerdtree' + Plug 'Xuyuanp/nerdtree-git-plugin' + Plug 'airblade/vim-gitgutter' + Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } + Plug 'junegunn/fzf.vim' + Plug 'tpope/vim-fugitive' + Plug 'christoomey/vim-tmux-navigator' + Plug 'vim-scripts/mru.vim' + " Plug 'ervandew/supertab' + + call plug#end() + + set nonu nu ic is hls + + map ; :Files + + " Mapping selecting mappings + nmap (fzf-maps-n) + xmap (fzf-maps-x) + omap (fzf-maps-o) + + nnoremap :if &modifiable && !&readonly && &modified :write :endif:bnext + nnoremap :if &modifiable && !&readonly && &modified :write :endif:bprevious + + " Insert mode completion + imap (fzf-complete-word) + imap (fzf-complete-path) + imap (fzf-complete-file-ag) + imap (fzf-complete-line) + + cnoreabbrev tn getcmdtype() == ":" && getcmdline() == 'tn' ? 'tabnew' : 'tn' + cnoreabbrev th getcmdtype() == ":" && getcmdline() == 'th' ? 'tabp' : 'th' + cnoreabbrev tl getcmdtype() == ":" && getcmdline() == 'tl' ? 'tabn' : 'tl' + cnoreabbrev te getcmdtype() == ":" && getcmdline() == 'te' ? 'tabedit' : 'te' + + nnoremap :buffers:buffer + + map :NERDTreeToggle + + set shortmess+=A + set splitbelow + set splitright + + +# ripgrep + + +## ~/.ignore + + # Maintained in linux-config.org + *~ + .git + cache + .cache + + +## ~/.ripgreprc + + + # Maintained in linux-config.org + # Don't let ripgrep vomit really long lines to my terminal, and show a preview. + --max-columns=150 + + # Set the colors. + --color=never + --colors=line:none + --colors=line:style:bold + + # Because who cares about case!? + --smart-case + + #ignore .gitignore + # --no-ignore-vcs + + +# Sway Wayland Compositing Tile Manager :i3:swaywm:sway: + +Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. +It works with your existing i3 configuration and supports most of i3's features, plus a few extras. + + +## xkb keyboard + +Set keyboard layout. +Override in .profile.local + + export XKB_DEFAULT_LAYOUT=de + export XKB_DEFAULT_OPTIONS=ctrl:nocaps + + +## SwayWM config + + +### general + + # Maintained in linux-config.org + + # Logo key. Use Mod1 for Alt. + set $mod Mod4 + set $super Mod4 + + # Home row direction keys, like vim + set $left h + set $down j + set $up k + set $right l + + + set $term 'kitty' + set $menu 'sway-launcher' + set $editor 'sway-editor' + set $wallpaper '~/Pictures/Wallpapers/current ' + + # Font for window titles. Will also be used by the bar unless a different font + # is used in the bar {} block below. + font pango: "JetBrainsMono Nerd Font 6" + #DejaVu Sans Mono, Terminus Bold Semi-Condensed 11 + + mouse_warping output + + bar { + swaybar_command waybar + position top + hidden_state hide + mode hide + modifier Mod4 + } + bindsym $mod+Alt+b "exec killall -SIGUSR1 waybar" + + + set $mode_system System (b) blank (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown + mode "$mode_system" { + bindsym b exec sway-lock-utils blank, mode "default" + bindsym l exec sway-lock-utils lock, mode "default" + bindsym e exec sway-lock-utils logout, mode "default" + bindsym s exec sway-lock-utils suspend, mode "default" + bindsym h exec sway-lock-utils hibernate, mode "default" + bindsym r exec sway-lock-utils reboot, mode "default" + bindsym Shift+s exec sway-lock-utils shutdown, mode "default" + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" + } + + bindsym $mod+Control+q mode "$mode_system" + + bindsym --release $mod+L exec sway-lock-utils lock + + # + # Resizing containers: + # + mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + # bindsym $left resize shrink width 10px + # bindsym $down resize grow height 10px + # bindsym $up resize shrink height 10px + # bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" + } + + bindsym $mod+r mode "resize" + + ### Key bindings + # + # Basics: + # + # Kill focused window + bindsym $mod+Shift+q kill + bindsym $mod+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Start your editor + bindsym $mod+Shift+e exec $editor + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Control+c reload + + # Exit sway (logs you out of your Wayland session) + # bindsym $mod+Control+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + + # + # Moving around: + # + # Move your focus around + # bindsym $mod+$left focus left + # bindsym $mod+$down focus down + # bindsym $mod+$up focus up + # bindsym $mod+$right focus right + # # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window + # bindsym $mod+Shift+$right move right + # bindsym $mod+Shift+$left move left + # bindsym $mod+Shift+$down move down + # bindsym $mod+Shift+$up move up + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + # # + # # Workspaces: + # + # Switch to workspace + bindsym $mod+1 workspace 1 + bindsym $mod+2 workspace 2 + bindsym $mod+3 workspace 3 + bindsym $mod+4 workspace 4 + bindsym $mod+5 workspace 5 + bindsym $mod+6 workspace 6 + bindsym $mod+7 workspace 7 + bindsym $mod+8 workspace 8 + bindsym $mod+9 workspace 9 + bindsym $mod+0 workspace 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace 1 + bindsym $mod+Shift+2 move container to workspace 2 + bindsym $mod+Shift+3 move container to workspace 3 + bindsym $mod+Shift+4 move container to workspace 4 + bindsym $mod+Shift+5 move container to workspace 5 + bindsym $mod+Shift+6 move container to workspace 6 + bindsym $mod+Shift+7 move container to workspace 7 + bindsym $mod+Shift+8 move container to workspace 8 + bindsym $mod+Shift+9 move container to workspace 9 + bindsym $mod+Shift+0 move container to workspace 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. + + # bindsym $mod+control+shift+$right move workspace to output right + # bindsym $mod+control+shift+$left move workspace to output left + # bindsym $mod+control+$right move container to output right + # bindsym $mod+control+$left move container to output left + bindsym $mod+control+shift+right move workspace to output right; #focus output right; + bindsym $mod+control+shift+left move workspace to output left; # focus output left; + bindsym $mod+control+shift+down move workspace to output down; #focus output down; + bindsym $mod+control+shift+up move workspace to output up; focus #output up; + + bindsym $mod+control+right move container to output right; focus output right; + bindsym $mod+control+left move container to output left; focus output left; + bindsym $mod+control+down move container to output down; focus output down; + bindsym $mod+control+up move container to output up; focus output up; + + bindsym $mod+Control+m exec sway-display-swap + bindsym $mod+Tab workspace back_and_forth + + # + # Layout stuff: + + # + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent + + # + # Scratchpad: + # + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + bindsym $mod+Return exec sway-scratch-terminal + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show + + +### host specific :scale:scaling: + + include "${HOME}/.config/sway/host-config-$(hostname)" + +1. Thinkpad T14s + + 1. scaling + + #Maintained in linux-config.org + output eDP-1 mode 1920x1080@60hz scale 1.0 + +2. XMG Neo + + 1. scaling + + #Maintained in linux-config.org + output eDP-1 mode 2560x1440@165hz scale 1.15 + + +### launcher + + for_window [title="sway-launcher"] floating enable + + +### display + +1. wallpaper + + # done in sway-workspace-init + # output * bg $wallpaper fill + +2. transparency + + set $trans 0.7 + set $alphamark "Ξ±" + for_window [con_mark=$alphamark] opacity set $trans + bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans + +3. lid :lid:clamshell: + + set $laptop-id `sway-laptop-id` + bindswitch lid:on exec "sway-screen disable $laptop-id" + bindswitch lid:off exec "sway-screen enable $laptop-id" + +4. brightness :brightness: + + bindsym --locked XF86MonBrightnessUp exec --no-startup-id brightnessctl set +${BRIGHTNESS_DELTA:-15} && sway-brightness-notify + bindsym --locked XF86MonBrightnessDown exec --no-startup-id brightnessctl set ${BRIGHTNESS_DELTA:-15}- && sway-brightness-notify + +5. gaps + + gaps inner 1 + gaps outer 0 + + +### scratchpad terminal + +$term is set to "sway-scratch-terminal + + for_window [title=ScratchTerminal] mark "$alphamark", move to scratchpad; [title=ScratchTerminal] scratchpad show + +1. ~/bin/sway/sway-scratch-terminal + + #!/usr/bin/env bash + #Maintained in linux-config.org + swaymsg "[title=ScratchTerminal] scratchpad show " || (sway-notify "created new scratchpad terminal" && kitty --title "ScratchTerminal" -e tmux new-session -A -s ScratchTerminal) + + +### navigation :navigation + + +### clipboard + +1. clipman and wofi + + A basic [clipboard manager](https://github.com/yory8/clipman) for Wayland, with support for persisting copy buffers after an application exits. + + set $clipboard "~/.local/share/clipman.json" + exec wl-paste -t text --watch clipman store + exec wl-paste -p -t text --watch clipman store -P --histpath="~/.local/share/clipman-primary.json" + bindsym $mod+y exec sway-clipboard-history-select + bindsym $mod+Control+y exec sway-clipboard-history-clear + + 1. sway-clipboard-history-select + + #!/usr/bin/env bash + # Maintained in linux-config.org + if ! (clipman pick --tool="wofi" --max-items=30); then + sway-notify "Clipboard History Is Empty" + exit 1 + else + exit 0 + fi + + 2. sway-clipboard-history-clear + + #!/usr/bin/env bash + # Maintained in linux-config.org + clipman clear -a + sway-notify "Clipboard history cleared." + + 3. Wofi Config + + 4. ~/.config/wofi/config + + [Configuration](http://manpages.ubuntu.com/manpages/impish/man5/wofi.5.html) file + + # Maintained in linux-config.org + dynamic_lines=true + gtk_dark=true + terminal=kitty + + 5. ~/.config/wofi/style.css + + /* Maintained in linux-config.org */ + window { + margin: 0px; + border: 1px solid #c0c0c0; + background-color: #282a36; + } + + #input { + margin: 2 px; + border: none; + color: #222222; + background-color: #eeeeee; + } + + #inner-box { + margin: 2px; + border: none; + background-color: #282a36; + } + + #outer-box { + margin: 2px; + border: none; + background-color: #282a36; + } + + #scroll { + margin: 0px; + border: none; + } + + #text { + margin: 2px; + border: none; + color: #f8f8f2; + } + + #entry:selected { + background-color: #44475a; + } + #entry { + border-bottom-style: solid; + border-width: 1px; + border-color: #d4af37; + } + + +### audio :audio: + +1. volume :volume: + + + bindsym XF86AudioMute exec sway-volume-notify "0" + bindsym $mod+XF86AudioMute exec pavucontrol + bindsym XF86AudioRaiseVolume exec sway-volume-notify "+" + bindsym XF86AudioLowerVolume exec sway-volume-notify "-" + # bindsym XF86AudioRaiseVolume exec pulse-volume "+5%" && sway-volume-notify + # bindsym XF86AudioLowerVolume exec pulse-volume "-5%" && sway-volume-notify + bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle && sway-volume-notify + +2. pavucontrol + + for_window [app_id="pavucontrol"] floating enable + bindsym $mod+Control+Shift+a exec pulse-restart + + +### wifi :wifi: + + bindsym --locked XF86Wlan exec sleep 1 && sway-notify "WLAN is $(nmcli radio wifi)." + + +### apps default workspace + + # assign [title="dbg:"] 3 + #assign [app_id="Alacritty"] 1 + #assign [class="Ardour"] 6 + assign [class="Code"] 3 + assign [class="Signal"] 8 + assign [class="jetbrains-studio"] 3 + assign [class="Hexchat"] 8 + assign [app_id="telegram"] 8 + assign [class="discord"] 8 + assign [class="Steam"] 9 + + +### apps default appearance + + for_window [title="wifi"] floating enable + for_window [title="bluetoothctl"] floating enable + # for_window [title="YouTube"] move container to workspace 7 + + +### apps keybindings + + + bindsym $mod+g exec "goldendict \\"`xclip -o -selection clipboard`\\"" + + bindsym $mod+Print exec sway-screenshot -i + bindsym $mod+Control+Print exec sway-screen-recorder + + bindsym $mod+Shift+f exec "sway-firefox" + bindsym $mod+Shift+c exec "sway-chrome" + bindsym $mod+Shift+m exec sway-do-tool "wwwemail" "sway-email" + bindsym $mod+Shift+a exec sway-do-tool "android-studio" "studio.sh" + bindsym $mod+Control+Shift+s exec sway-do-tool "Steam" "steam" + bindsym $mod+Control+i exec sway-do-tool "Emacs-irc" || emacsclient -s "irc" -c -n && sleep 0.5 && sway-do-tool "Emacs-irc" + bindsym $mod+Control+d exec sway-do-tool "Emacs-dired" || emacsclient -s "dired" -n -c && sleep 0.5 && sway-do-tool "Emacs-dired" + bindsym $mod+Control+e exec sway-do-tool "Emacs-email" || emacsclient -s "email" -n -c && sleep 0.5 && sway-do-tool "Emacs-email" + bindsym $mod+Control+Shift+d exec sway-screen-menu + bindsym $mod+Control+f exec command -v thunar && thunar || nautilus + bindsym $mod+Control+p exec sway-htop + bindsym $mod+Control+Shift+p exec htop-regexp + bindsym $mod+Control+f10 exec sway-notify "Opening NEW terminal instance" && kitty + bindsym $mod+Control+t exec sway-notify "Opening NEW tmux terminal instance" && kitty tmux new + bindsym $mod+Control+w exec sway-workspace-position + bindsym $mod+Control+shift+u exec sway-workspace-populate + + +### sway startup processes + + exec mako + # exec bluetooth-headphone-controls + exec sway-idle + exec sway-kanshi + exec blueman-applet &>/dev/null + exec waybar-network-applet + # exec gpg-cache + exec 'sway-workspace-populate-conditional; [ -f "${HOME}/.sway.login" ] && . "${HOME}/.sway.login" && (sleep 1 && sway-notify "~/.sway.login processed"); sway-workspace-position; swaymsg workspace 1; ' + + +## waybar config + + + + + { + "layer": "top", + "mode": "hide", + "position": "top", + "height": 22, + "width": 0, + + "modules-left": [ + "sway/workspaces", + "cpu", + "temperature", + "memory" + ], + + "modules-center": [ + "custom/weather", + "custom/clock", + "idle_inhibitor", + "custom/monitors" + ], + + "modules-right": [ + "pulseaudio", + "backlight", + "battery", + "power-profiles-daemon", + "custom/power-draw", + "tray" + ], + "network": { + "format-wifi": " {signalStrength}%" , + "format-ethernet": "{ifname}: {ipaddr}/{cidr} οž–", + "format-linked": "{ifname} (No IP) οž–", + "format-disconnected": " ", + "format-alt": "{essid} ⬇{bandwidthDownBits} ⬆{bandwidthUpBits}", + "interval": 60, + "tooltip-format": "{ifname} ο‚© {ipaddr}", + "on-click": "sway-wifi" + }, + + + "sway/workspaces": { + "persistent_workspaces": { + "1": ["DP-4"], + "2": ["DP-4"], + "3": [], + "4": ["DP-3"], + "5": [], + "6": [], + "7": [], + "8": [], + "9": [], + "10": [] + }, + "disable-scroll": true, + "all-outputs": false, + "format": "({name}){icon}", + "format-icons": { + "1": "⌨ Edit", + "2": "πŸ” Research", + "3": "πŸ‘· IDE", + "4": "πŸͺ² Debug", + "5": "πŸ“ Files", + "6": "🎧 Music", + "7": "⏡ Video", + "8": "πŸ—¨ IRC", + "9": "Steam", + "10":"Scratch", + }, + }, + + "sway/mode": { + "format": "{}" + }, + + "backlight": { + // "device": "acpi_video1", + "format": "{icon} {percent}%", + "format-icons": ["ο†…", "ο„‘"] + }, + + "battery": { + "states": { + // "good": 95, + "warning": 20, + "critical": 10 + }, + "format": "{icon} {capacity}%", + + "format-charging": "ο—§ {capacity}% ({time})", + "format-plugged": "{icon}  {capacity}%", + // "format-good": "", // An empty format will hide the module + "format-discharging": "{icon} {capacity}% ({time})", + "format-icons": ["", "", "", "", ""], + "on-click" : "sway-htop" + }, + + "custom/clock": { + "interval": 60, + "exec": "date +'%a, %d %b: %H:%M'", + "format": "{} ", + "max-length": 25 + }, + + "cpu": { + "interval": 5, + "format": "ο‹› {usage}% ({load})", + "states": { + "warning": 70, + "critical": 90 + }, + "on-click" : "hardinfo" + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "πŸ“€ο°Œ", + "deactivated": "😴" + }, + "on-click-right": "sway-lock" + }, + "pulseaudio": { + "format": "{icon} {volume}% {format_source}", + "format-muted": "πŸ”‡ {format_source}", + "format-bluetooth": "{icon}οŠ” {volume}% {format_source}", + "format-bluetooth-muted": "πŸ”‡οŠ” {format_source}", + + "format-source": "ο„° {volume}%", + "format-source-muted": "ο„±", + + "format-icons": { + "headphones": "ο€₯", + "handsfree": "", + "headset": "", + "phone": "ο‚•", + "portable": "ο‚•", + "car": "ο†Ή", + "default": ["πŸ”ˆ", "πŸ”‰", "πŸ”Š"] + }, + "on-click": "pulse-volume toggle", + "on-click-right": "pavucontrol" + }, + + "tray": { + "icon-size": 21, + "spacing": 5 + }, + + "custom/weather": { + "format": "{} ", + "tooltip": true, + "interval": 3600, + "exec": "waybar-weather-json", + "return-type": "json" + }, + + "custom/uptime": { + "format": "βŒ›{}", + "interval": 60, + "exec": "uptime -p" + }, + + "custom/monitors": { + "format": "{}", + "return-type" : "json", + "interval": 10, + "exec": "waybar-monitors", + "tooltip": "true", + "on-click": "sway-screen-menu" + }, + "custom/bluetooth": { + "format": " οŠ” ", + "interval": 30, + "exec": "waybar-bluetooth", + "tooltip": "false", + "on-click": "blueman-manager" + }, + "custom/power-draw": { + "format": "⚑{}πŸ”‹", + "interval": 5, + "exec": "waybar-power-draw", + "tooltip": "false" + }, + "power-profiles-daemon": { + "format": " {icon}{profile} ", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, + "format-icons": { + "default": "", + "performance": "", + "balanced": "ο‰Ž", + "power-saver": "" + } + }, + "wlr/taskbar": { + "format": "{icon}", + "icon-size": 14, + "icon-theme": "Numix-Circle", + "tooltip-format": "{title}", + "on-click": "activate", + "on-click-middle": "close" + }, + + "custom/mynetwork": { + "format": "{}", + "format-wifi": "πŸ“Ά{ssid}", + "format-ipaddr": "{ipaddr}", + "format-ssid": "xx{ssid}xx", + "format-alt": "{alt}:{}", + "exec": "waybar-ip-info-json", + "return-type": "json", + "interval": 60, + "on-click-right": "sway-wifi", + "tooltip-format": "{ssid}", + "tooltip": "true" + } + + } + + +### ~/.config/waybar/style.css + + *{ + border: none; + background: rgba(28, 28, 28, 0.6); + border-radius: 0; + font-family: "JetBrainsMono Nerd Font"; + font-size: 10pt; + min-height: 0; + } + + #waybar { + background: rgba(28, 28, 28, 0.6); + color: #e4e4e4; + } + + #window { + color: #e4e4e4; + font-weight: bold; + } + + #workspaces { + font-size: 8px; + /* padding: 0 2px;*/ + margin-left: 8px; + margin-right: 8px; + padding-left: 0px; + padding-right: 0px; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + background: rgba(28, 28, 28, 0.6); + } + + #workspaces button { + padding: 0 5px; + /* background: rgba(28, 28, 28, 0.9);*/ + color: #888888; + /* margin: 0 1px;*/ + } + #workspaces button:hover { + box-shadow: inherit; + text-shadow: inherit; + + } + + #workspaces button.visible { + padding: 0 5px; + border-radius: 10px; + color: #ff0000; + margin: 0 0px; + } + + #workspaces button.focused { + color: #00ff00; + + } + #workspaces button.urgent { + background: #5555ff; + + } + + #workspaces button.urgent { + background: #af005f; + color: #1b1d1e; + } + + #mode { + background: #af005f; + } + + #custom-bluetooth,#custom-power-draw,#custom-dropbox,#clock, #temperature, #cpu, #memory, #network, #backlight, #pulseaudio, #battery, #tray, #idle_inhibitor { + padding: 0 3px; + } + + #idle_inhibitor{ + font-size:16px + } + + #clock { + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + } + + @keyframes blink { + to { + background-color: darkred; + } + } + + #battery.warning:not(.charging) { + background-color: #ff8700; + color: #1b1d1e; + } + #battery.critical:not(.charging) { + color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + #battery,#battery_icon,#battery.charging { + color:gold + } + + + #cpu { + } + + #memory { + } + + #network { + } + + #network.disconnected { + background: #f53c3c; + } + + #pulseaudio { + } + + #pulseaudio.muted { + } + + #custom-weather { + font-size:12px; + } + + #tray { + margin-left: 1px; + } + + +### waybar utility scripts + +1. ~/bin/sway/waybar-bluetooth + + #!/usr/bin/env bash + # Maintained in linux-config.org + + get_from_file() { + dev=$1 + name= + if [ ! -f /tmp/bt-devices.txt ]; then + touch /tmp/bt-devices.txt + echo "" + return + fi + for i in `cat /tmp/bt-devices.txt`; do + d=`echo $i | awk -F:: '{print $1}'` + if [ $d = $dev ]; then + name=`echo $i | awk -F:: '{print $2}'` + fi + done + echo "${name}" + } + + store_file() { + dev=$1 + name="${2}" + echo "$dev::${name}" >> /tmp/bt-devices.txt + } + + connections=`hcitool con | sed -n 2p` + if [ ! -z "$connections" ]; then + # We have a connection, we want to get the name from a file if we've had + # it from there before because getting the name of the device connected + # is very slow and costly. + dev=`echo $connections | awk '{print $3}'` + name=`get_from_file $dev` + if [ -z "$name" ]; then + name=`hcitool name $dev | awk '{print $1}'` + if [ ! -z "${name}" ]; then + store_file $dev "${name}" + fi + fi + echo "πŸ’‘$name" + else + echo "πŸ”Œ" + fi + +2. ~/bin/sway/waybar-dropbox-json + + #!/usr/bin/env bash + # Maintained in linux-config.org + if ( ! dropbox running ); then + fullstat="$(dropbox status)" + stat="$(sed -n 1p <<< $fullstat)" + else + fullstat="" + if [ -f "${HOME}/.RESTART_DROPBOX" ];then + stat="Restarting Dropbox.." + sway-notify "$stat" + dropbox start &> /dev/null + else + stat="click to restart DB" + fi + fi + + jq --unbuffered --compact-output -n \ + --arg text "$stat" \ + --arg tooltip "$fullstat" \ + --arg class "dropbox-status" \ + '{text: $text, tooltip: $tooltip, class: $class}' + +3. ~/bin/sway/waybar-dropbox-status + + #!/usr/bin/env bash + #Maintained in linux-config.org + if pidof dropbox &> /dev/null ; then + stat=$(dropbox status | sed -n 1p) + echo "${stat}"; echo ""; + else + if command -v dropbox > /dev/null; then + echo "⇄Restarting Dropbox.." + dropbox start &> /dev/null & + fi + fi + +4. ~/bin/sway/waybar-ip-info-json + + ifname="${1:-$(printf '%s' /sys/class/net/*/wireless | cut -d/ -f5)}" + [ -z "$ifname" ] && exit 1 + pubip="$(curl -s -m 1 ipinfo.io/ip)" + pubip="$([ -z "$pubip" ] && echo "Offline" || echo "$pubip")" + lip=$(ip -j address | jq -r '.[] | select (.ifname=='\"$ifname\"').addr_info[] | select(.family=="inet").local') + lip="$([ -z "$lip" ] && echo -n "Offline" || echo -n "$lip")" + ssid="$(/sbin/iwconfig $ifname | grep 'ESSID:' | awk '{print $4}' | sed 's/ESSID://g' | sed 's/"//g')" + jq --unbuffered --compact-output -n \ + --arg text "πŸ“Ά $ssid" \ + --arg alt "$ifname:🌎$pubip,πŸ”Œ$lip" \ + --arg tooltip "$ifname:🌎$pubip,πŸ”Œ$lip" \ + --arg class "" \ + --arg percentage "1" \ + --arg ifname "$ifname" \ + --arg ssid "$ssid" \ + --arg public_ip "$pubip" \ + --arg ippadr "$lip" \ + '{text: $text, alt: $alt, tooltip: $tooltip, class: $class, percentage: $percentage, ifname: $ifname, ssid: $ssid, public_ip: $public_ip, ipaddr: $ippadr}' + +5. ~/bin/sway/waybar-monitors + + #!/usr/bin/env bash + #Maintained in linux-config.org + l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') + o=$(swaymsg -t get_outputs | jq -r '. | map(.name) | join(",")') + t="" + for i in `seq $l`; do t="${t} βƒ’ ";done + text="{\"text\":\""$t"\",\"tooltip\":\""$o"\"}" + echo $text + +6. ~/bin/sway/waybar-network-applet + + #!/usr/bin/env bash + #Maintained in linux-config.org + if command -v iwgtk 2>&1 >/dev/null + then + pgrep iwgtk || iwgtk -i & + else + pgrep nm-applet || nm-applet & + fi + +7. ~/bin/sway/waybar-power-draw + + #!/usr/bin/env bash + # Maintained in linux-config.org + awk '{print $1*10^-6 "W "}' /sys/class/power_supply/BAT0/power_now + +8. ~/bin/sway/waybar-weather-json + + #!/usr/bin/env bash + # Maintained in linux-config.org + sleep 5 + WTTR_LOCATION="${1:-"GrΓΆmitz,DE"}" waybar-wttr + +9. ~/bin/sway/waybar-wttr + + #!/usr/bin/env python + # Maintained in linux-config.org + + import json + import requests + from datetime import datetime + + WEATHER_CODES = { + '113': 'β˜€οΈ', + '116': '⛅️', + '119': '☁️', + '122': '☁️', + '143': '🌫', + '176': '🌦', + '179': '🌧', + '182': '🌧', + '185': '🌧', + '200': 'β›ˆ', + '227': '🌨', + '230': '❄️', + '248': '🌫', + '260': '🌫', + '263': '🌦', + '266': '🌦', + '281': '🌧', + '284': '🌧', + '293': '🌦', + '296': '🌦', + '299': '🌧', + '302': '🌧', + '305': '🌧', + '308': '🌧', + '311': '🌧', + '314': '🌧', + '317': '🌧', + '320': '🌨', + '323': '🌨', + '326': '🌨', + '329': '❄️', + '332': '❄️', + '335': '❄️', + '338': '❄️', + '350': '🌧', + '353': '🌦', + '356': '🌧', + '359': '🌧', + '362': '🌧', + '365': '🌧', + '368': '🌨', + '371': '❄️', + '374': '🌧', + '377': '🌧', + '386': 'β›ˆ', + '389': '🌩', + '392': 'β›ˆ', + '395': '❄️' + } + + data = {} + + + weather = requests.get("https://wttr.in/?format=j1").json() + + + def format_time(time): + return time.replace("00", "").zfill(2) + + + def format_temp(temp): + return (hour['FeelsLikeC']+"Β°").ljust(3) + + + def format_chances(hour): + chances = { + "chanceoffog": "Fog", + "chanceoffrost": "Frost", + "chanceofovercast": "Overcast", + "chanceofrain": "Rain", + "chanceofsnow": "Snow", + "chanceofsunshine": "Sunshine", + "chanceofthunder": "Thunder", + "chanceofwindy": "Wind" + } + + conditions = [] + for event in chances.keys(): + if int(hour[event]) > 0: + conditions.append(chances[event]+" "+hour[event]+"%") + return ", ".join(conditions) + + + data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ + " "+weather['current_condition'][0]['FeelsLikeC']+"Β°" + + data['tooltip'] = f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}Β°\n" + data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}Β°\n" + data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" + data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" + for i, day in enumerate(weather['weather']): + data['tooltip'] += f"\n" + if i == 0: + data['tooltip'] += "Today, " + if i == 1: + data['tooltip'] += "Tomorrow, " + data['tooltip'] += f"{day['date']}\n" + data['tooltip'] += f"⬆️ {day['maxtempC']}Β° ⬇️ {day['mintempC']}Β° " + data['tooltip'] += f"πŸŒ… {day['astronomy'][0]['sunrise']} πŸŒ‡ {day['astronomy'][0]['sunset']}\n" + for hour in day['hourly']: + if i == 0: + if int(format_time(hour['time'])) < datetime.now().hour-2: + continue + data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" + + + print(json.dumps(data)) + + +## swaywm scripts :sway:wayland: + + +### ~/bin/sway-active-monitors-count + + #!/usr/bin/env bash + # Maintained in linux-config.org + swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length' + + +### ~/bin/sway/sway-active-monitor-ids + + #!/usr/bin/env bash + # Maintained in linux-config.org + swaymsg -t get_outputs | jq -r 'sort_by(.rect.x) | .[] | select(.dpms and .active) | .name' + + +### ~/bin/sway/sway-active-monitor-names + + #!/usr/bin/env bash + # Maintained in linux-config.org + swaymsg -t get_outputs | jq -r 'sort_by(.rect.x) | .[] | select(.dpms and .active)|(.make + " " + .model + " " + .serial)' + + +### ~/bin/sway/sway-autostart + + #!/usr/bin/env bash + #Maintained in linux-config.org + if [ -f "${HOME}/.SWAY_START" ] && [ -z "$SSH_CONNECTION" ]; then + if [ "$(hostname)" = "xmgneo" ];then + sway --my-next-gpu-wont-be-nvidia & + else + sway & + fi + fi + + +### ~/bin/sway/sway-brightness-notify + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-notify "☼:$(printf "%.0f" `brightnessctl g`)" + + +### ~/bin/sway/sway-bluetooth + + #!/usr/bin/env bash + # Maintained in linux-config.org + exec sway-oneterminal "bluetoothctl" "bluetoothctl" + + +### ~/bin/sway/sway-do-tool + + #!/usr/bin/env bash + # Maintained in linux-config.org + + # NB ths is currently lazy. It uses brute force, and i need to do some get_tree jq stuff instead to + # get the app_id/class instance instead. But.. it works. + id="$1" + script="$2" + [ -z "$id" ] && echo "usage: sway-do-tool id" && exit 1 + if swaymsg "[title=${id}] focus" &> /dev/null; then + : + else + if swaymsg "[class=${id}] focus" &> /dev/null; then + : + else + if swaymsg "[app_id=${id}] focus" &> /dev/null; then + : + else + if [ ! -z "$script" ]; then + eval "$script" & + else + exit 1 + fi + fi + fi + fi + exit 0 + + +### ~/bin/sway/sway-oneterminal + + #!/usr/bin/env bash + #Maintained in linux-config.org + + sessionname="${1:-`pwd`}" + title="${ONETERM_TITLE:-${sessionname}}" + script="${2}" + if ! sway-do-tool "$title"; then + kitty --title "${title}" -e tmux new-session -A -s ${sessionname} ${script} & + else + if ! tmux has-session -t "${sessionname}"; then + tmux attach -t "${sessionname}" + fi + fi + exit 0 + + +### ~/bin/sway/sway-dpms + + #!/usr/bin/env bash + # Maintained in linux-config.org + DPMS="${1:-on}" + DISP="${2:-*}" + currentDPMS="$(swaymsg -t get_outputs | jq -r '.[0]'.dpms)" + [ "$dpms" != "$currentDPMS" ] && swaymsg "output $DISP DPMS $DPMS" + + +### ~/bin/sway/sway-htop + + #!/usr/bin/env bash + # Maintained in linux-config.org + exec sway-oneterminal "Processes" btop + + +### ~/bin/sway/sway-kanshi + +Monitor control with hotplug +Load a host specific kanshi file if it exists + + #!/usr/bin/env bash + #Maintained in linux-config.org + # pidof kanshi && echo "kanshi process $(pidof kanshi) already running. Exiting." && exit 0 + pkill kanshi + config="${HOME}/.config/kanshi/config-$(hostname)" + if [ -f "$config" ]; then + echo "kanshi -c $config" + kanshi -c "$config" + else + echo "kanshi default config" + kanshi + fi + +1. config + + profile { + output eDP-1 enable position 0,0 + } + +2. config-um690 + + { + output HDMI-A-1 enable mode 2560x1440 position 0,0 + output HDMI-A-2 enable mode 1920x1080 position 2560,116 + } + +3. config-t14s + + profile home-dp{ + output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 + output 'Synaptics Inc Non-PnP 0x00BC614E' mode 1920x1080 position 2560,0 + output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080 + } + profile home-hdmi{ + output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 + output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0 + output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080 + } + profile home-no-lap{ + output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 + output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0 + } + +4. config-xmgneo + + { + output eDP-1 enable enable mode 2560x1440 position 0,0 + } + + { + output eDP-1 enable mode 2560x1440 position 2560,0 + output HDMI-A-1 enable mode 2560x1440 position 0,0 + } + + { + output eDP-1 enable mode 2560x1440 position 2560,0 + output DP-1 enable mode 2560x1440 position 0,0 + } + +5. config-thinkpadt460 + + profile { + output eDP-1 enable mode 1366Γ—768 position 0,0 + } + + profile { + output eDP-1 enable mode 1366Γ—768 position 1920,0 + output DP-4 enable mode 1920x1080 position 0,0 + } + +6. config-x1c6 + + profile { + output eDP-1 enable mode 1920x1080 position 0,0 + } + + profile { + output eDP-1 disable + output DP-1 enable mode 2560x1440 position 0,0 + } + + profile { + output eDP-1 disable + output HDMI-A-1 enable mode 2560x1440 position 0,0 + } + +7. config-x13amdg4 + + profile { + output eDP-1 enable mode 1920x1200 position 0,0 + } + + +### ~/bin/sway/sway-lock-utils + +Just a gathering place of locky/suspendy type things… + + #!/usr/bin/env bash + # Maintained in linux-config.org + lock() { + pidof swaylock || swaylock -f -i ~/Pictures/LockScreen/current -s fill -c 000000 + sway-notify "unlocked" + } + + lock_gpg_clear() { + [ "$1" = gpg_clear ] && (echo RELOADAGENT | gpg-connect-agent &>/dev/null ) + lock + } + + case "$1" in + lock) + lock + ;; + lock_gpg_clear) + lock_gpg_clear + ;; + logout) + swaymsg exit + ;; + suspend) + systemctl suspend + ;; + hibernate) + systemctl hibernate + ;; + reboot) + systemctl reboot + ;; + shutdown) + systemctl poweroff + ;; + blank) + sway-dpms off + [ -f "${HOME}/.screen-blank.local" ] && . "${HOME}/.screen-blank.local" + ;; + unblank) + sway-dpms on + [ -f "${HOME}/.screen-unblank.local" ] && . "${HOME}/.screen-unblank.local" + ;; + *) + lock + ;; + esac + + exit 0 + + +### swayidle, ~/bin/sway/sway-idle :sleep:lock:idle: + + #!/usr/bin/env bash + # Maintained in linux-config.org + pkill swayidle + exec swayidle -w \ + timeout 1 '' \ + resume 'sway-lock-utils unblank' \ + timeout 10 'pidof swaylock && sway-lock-utils blank' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_BLANK:-3600} 'sway-lock-utils blank' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_LOCK:-14400} 'sway-lock-utils lock' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_SUSPEND:-0} 'sway-lock-utils suspend' \ + resume 'sway-lock-utils unblank' \ + lock 'sway-lock-utils lock' \ + unlock 'sway-lock-utils unblank' \ + before-sleep 'sway-lock-utils lock' + +1. SWAY-IDLE DEFAULTS + + Not exported : add to .profile.local + + export SWAYIDLEHOOK_BLANK=300 + export SWAYIDLEHOOK_LOCK=3600 + export SWAYIDLEHOOK_SUSPEND=0 + + +### ~/bin/sway/sway-laptop-id + +Here we look for an env `LAPTOP_ID`. In my setup that would be set in `${HOME}/.profile.local`. If thats not set we assume `eDP-1` +but in both cases we check if it exists in the sway tree, and, if not, set it t the last + + #!/usr/bin/env bash + # Maintained in linux-config.org + id="${LAPTOP_ID:-'eDP-1'}" + id=$( swaymsg -t get_outputs | jq -r ".[] | select (.name == \"${id}\") | .name") + if [ -z "$id" ];then + id=$(swaymsg -t get_outputs | jq -r '.[-1].name') + fi + echo $id + + +### ~/bin/sway/sway-lock + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-lock-utils lock + + +### ~/bin/sway/sway-blank + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-lock-utils blank + + +### ~/bin/sway/sway-notify + + #!/usr/bin/env bash + # Maintained in linux-config.org + notify-send -t ${2:-5000} "${1}" || true + + + + +### ~/bin/sway/sway-screen + +`enable` or `disable`. Won't allow you to turn off the sole enabled display. + +:ID: 82455cae-1c48-48b2-a8b3-cb5d44eeaee9 + + #!/usr/bin/env bash + # Maintained in linux-config.org + m="${2:-$(swaymsg -t get_outputs | jq -r '.[0].name')}" + c="${1:-enable}" + [ "$c" = "disable" ] && [ "$(sway-active-monitors-count)" = "1" ] && sway-notify "Not turning off single display $m" && exit 1 + swaymsg "output ${m} ${c}" + (sleep 2 && sway-notify "${m}:${c}") & + + +### ~/bin/sway/sway-workspace-position + + #!/usr/bin/env bash + # Maintained in linux-config.org + mapfile -t outputs < <( sway-active-monitor-ids ) + export leftOutput=${outputs[0]} + export rightOutput=${outputs[1]} + export rightMostOutput=${outputs[2]} + + rightOutput=${rightOutput:-${leftOutput}} + rightMostOutput=${rightMostOutput:-${rightOutput}} + + sway-notify "Left:${leftOutput}, Right:${rightOutput}, Rightmost: ${rightMostOutput}" + curr=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .name') + + # swaymsg "output * bg ~/Pictures/Wallpapers/current fill" + swaybg -o $leftOutput -i ${HOME}/Pictures/Wallpapers/s1 -m fill & + + if [ "$leftOutput" != "$rightOutput" ]; then + swaybg -o ${rightOutput} -i ${HOME}/Pictures/Wallpapers/s2 -m fill & + if [ "$rightOutput" != "${rightMostOutput}" ]; then + swaybg -o ${rightMostOutput} -i ${HOME}/Pictures/Wallpapers/s3 -m fill & + fi + fi + + swaymsg " + workspace 1; move workspace to output $leftOutput; + workspace 2; move workspace to output $rightOutput; + workspace 3; move workspace to output $leftOutput; + workspace 4; move workspace to output $rightOutput; + workspace 5; move workspace to output $rightOutput; + workspace 6; move workspace to output $rightMostOutput; + workspace 7; move workspace to output $rightMostOutput; + workspace 8; move workspace to output $rightMostOutput; + workspace $curr; + " + + +### ~/bin/sway/sway-workspace-populate + + #!/usr/bin/env bash + # Maintained in linux-config.org + swaymsg "workspace 8; layout stacking;sleep 0.3;" + sway-www "https://web.whatsapp.com/" + sway-www "https://web.telegram.org/k/" + sway-www "https://reddit.com/" + sway-www "https://mail.google.com/mail/u/0/#inbox" + sleep 0.3 + + +### ~/bin/sway/sway-workspace-populate-conditional + + #!/usr/bin/env bash + # Maintained in linux-config.org + if [ -f "${HOME}/.sway-workspace-populate" ]; then + sway-workspace-populate + elif [ -f "${HOME}/.sway-workspace-populate-user" ]; then + source "${HOME}/.sway-workspace-populate-user" + # else + # emacsclient -c -a "" & + fi + + +### ~/bin/sway/sway-screen-menu + +Gui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#org4e12781). + +:ID: 82455cae-1c48-48b2-a8b3-cb5d44eeaee9 + + #!/usr/bin/env bash + # Maintained in linux-config.org + m=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled") + if [ ! -z "$m" ]; then + c="$(zenity --list --title "Enable ${m}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)" + if [ ! -z "$c" ]; then + sway-screen $c $m + fi + fi + exit 0 + + +### ~/bin/sway/sway-display-swap + + + + #!/usr/bin/env bash + # Maintained in linux-config.org + + DISPLAY_CONFIG=($(swaymsg -t get_outputs | jq -r '.[]|"\(.name):\(.current_workspace)"')) + + for ROW in "${DISPLAY_CONFIG[@]}" + do + IFS=':' + read -ra CONFIG <<< "${ROW}" + if [ "${CONFIG[0]}" != "null" ] && [ "${CONFIG[1]}" != "null" ]; then + echo "moving ${CONFIG[1]} right..." + swaymsg -- workspace --no-auto-back-and-forth "${CONFIG[1]}" + swaymsg -- move workspace to output right + fi + done + + +### ~/bin/sway/sway-launcher-wofi + + #!/usr/bin/env bash + # Maintained in linux-config.org + exec dmenu_path | wofi --show drun,dmenu -i | xargs swaymsg exec -- + + +### ~/bin/sway/sway-launcher-rofi + + #!/usr/bin/env bash + # Maintained in linux-config.org + exec rofi -combi-modi window,drun,ssh,run -show combi -show-icons + + +### ~/bin/sway/sway-launcher-fzf + + #!/usr/bin/env bash + # Maintained in linux-config.org + exec kitty --title "sway-launcher" -e bash -c "dmenu_path | fzf | xargs swaymsg exec" + + +### ~/bin/sway/sway-launcher-ulauncher + + #!/usr/bin/env bash + # Maintained in linux-config.org + if ! pgrep "ulauncher"; then + ulauncher + else + ulauncher-toggle + fi + + +### ~/bin/sway/sway-launcher + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-launcher-fzf + + +### ~/bin/sway/sway-screenshot + +Thanks: + + #!/usr/bin/env bash + # Maintained in linux-config.org + # thanks to: https://www.reddit.com/r/linuxmasterrace/comments/k1bjkp/i_wrote_a_trivial_wrapper_for_taking_screenshots/ + + DIR=${HOME}/tmp/Screenshots + + mkdir -p "${DIR}" + + FILENAME="screenshot-$(date +%F-%T).png" + sway-notify "use the mouse to select region.." + region="$(slurp)" + if [ ! -z "$region" ]; then + sway-notify "Taking pic in 5s.." + sleep 5 + grim -g "$region" "${DIR}"/"${FILENAME}" || exit 1 + #Create a link, so don't have to search for the newest + ln -sf "${DIR}"/"${FILENAME}" "${DIR}"/screenshot-latest.png + sway-notify "Done! see ${DIR}/screenshot-latest.png" + fi + + +### ~/bin/sway/sway-screen-recorder + + #!/usr/bin/env bash + # Maintained in linux-config.org + if pgrep -x "wf-recorder"; then + sway-notify "stopping wf-recorder" + # sigint + kill -2 $(pgrep wf-recorder) + else + sway-notify "starting wf-recorder" + wf-recorder -f ${HOME}/tmp/output.mkv -g "$(slurp)" + fi + + +### ~/bin/sway/sway-volume-notify + + #!/usr/bin/env bash + # Maintained in linux-config.org + if [[ "$1" = "0" ]]; then + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + elif [[ "$1" = "+" ]]; then + wpctl set-volume @DEFAULT_AUDIO_SINK@ "0.1+" + elif [[ "$1" = "-" ]]; then + wpctl set-volume @DEFAULT_AUDIO_SINK@ "0.1-" + fi + + + volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) + volumep=$(echo $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | tr -dc '0-9')| sed 's/^0*//') + if [[ -z $volumep ]]; then + volumep="0" + elif [[ $volumep -gt "150" ]];then + volumep="150" + wpctl set-volume @DEFAULT_AUDIO_SINK@ 1 + fi + if [[ "$volume" == *"MUTED"* ]]; then + sway-notify "πŸ”Š MUTED (${volumep}%) " + else + sway-notify "πŸ”Š${volumep}%" + fi + + +### ~/bin/sway/sway-weather + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-www "https://www.accuweather.com/en/de/gr%C3%B6mitz/23743/hourly-weather-forecast/176248" + + +### sway-nvidia :nvidia:dgpu: + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway --my-next-gpu-wont-be-nvidia "$@" + + +### ~/bin/sway/sway-www + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-firefox "$@" & + + +### ~/bin/sway/sway-email + + #!/usr/bin/env bash + # Maintained in linux-config.org + MOZ_ENABLE_WAYLAND=1 firefox --name=wwwemail --new-window "https://www.gmail.com" & + + +### ~/bin/sway/sway-chrome + + #!/usr/bin/env bash + # Maintained in linux-config.org + google-chrome --ozone-platform=wayland --hide-crash-restore-bubble --new-window "$@" & + + +### ~/bin/sway/sway-firefox + + #!/usr/bin/env bash + # Maintained in linux-config.org + MOZ_ENABLE_WAYLAND=1 firefox --new-window "$1" &>/dev/null & + + +### ~/bin/sway/sway-wifi + + #!/usr/bin/env bash + # Maintained in linux-config.org + sway-oneterminal "wifi" "nmtui" &>/dev/null + + +## wayland utils + + +### ~/.config/mako/config + + default-timeout=10000 + + +# Programming Related :programming: + + +## clang-format + +clangd lsp formatting + + # Maintained in linux-config.org + BasedOnStyle: Google + Language: Cpp + IndentWidth: 4 + AllowShortBlocksOnASingleLine: false + AllowShortCaseLabelsOnASingleLine: false + AllowShortFunctionsOnASingleLine: false + AllowShortIfStatementsOnASingleLine: false + AllowShortLoopsOnASingleLine: false + AccessModifierOffset: -4 + PointerAlignment: Left + ColumnLimit: 80 + KeepEmptyLinesAtTheStartOfBlocks: true + + +## dart/flutter :dart:flutter: + + + + + +### path + + export PATH="${HOME}/bin/thirdparty/flutter/bin:$PATH" + + +## llvm :llvm: + + +### path + + export PATH="${HOME}"/bin/llvm:"${HOME}"/bin/llvm/build/bin:"$PATH" + + +### lldb :lldb: + +1. ~/.lldbinit + + # Maintained in linux-config.org + + #settings write -f .lldb-settings-local-start + #settings read -f .lldb-settings-local + + settings set target.load-cwd-lldbinit true + settings set interpreter.prompt-on-quit false + settings set target.x86-disassembly-flavor intel + + command alias bfl breakpoint set -f %1 -l %2 + command alias lv command script import "~/bin/thirdparty/pyenv/versions/3.9.2/lib/python3.9/site-packages/voltron/entry.py" + command alias sl source list -a $rip + command alias so thread step-out + #auto breaks - annotate code with labels eg debug_inspect__var_of_interest + command alias b_inspect breakpoint set -p "debug_inspect_" + command alias b_call breakpoint set -p "debug_call_" + + # regexp break points arent pending/deferred + #b_inspect + #b_call + + command regex rlook 's/(.+)/image lookup -rn %1/' + + #breg X will break at *X* labels + command regex breg 's/(.+)/breakpoint set -p "%1"/' + #bdeb X will break at debug*X labels + command regex bdeb 's/(.+)/breakpoint set -p "debug_(.+)%1"/' + #bcall X will break at debug_call__X labels + command regex bcall 's/(.+)/breakpoint set -p "debug_call__%1"/' + #binsp X will break at debug_inspect__X labels + command regex binsp 's/(.+)/breakpoint set -p "debug_inspect__%1"/' + + command regex srcb 's/([0-9]+)/settings set stop-line-count-before %1/' + srcb 2 + command regex srca 's/([0-9]+)/settings set stop-line-count-after %1/' + srca 3 + + settings set stop-disassembly-display no-debuginfo + + #step into stl + settings set target.process.thread.step-avoid-regexp "" + + + #alias vtty = shell tmux-pane-tty voltron 4 + + #define voltron-source-tty + #shell tmux-pane-tty + #end + +2. scripts + + 1. ~/bin/llvm/disassembly\_mode.py + + [disassembly\_mode.py](directories/bin/lldb/disassembly_mode.py) + + 2. ~/bin/llvm/lldb-ui-session + + Create a session but let someone else do the attach + + #!/usr/bin/env bash + # Maintained in linux-config.org + + # create a lldb debug session unless it already exists. + # the -d to new session says "dont attach to current terminal" + # there is a bug where the splt panes split that of a tmux session in the terminal + # we issue the command from. No idea why or how. + # directory="$(realpath -s "${1:-`pwd`}")" + directory="${1:-`pwd`}" + session="${2:-"voltron-$(basename "$directory")"}" + if ! TMUX= tmux has-session -t "$session" &> /dev/null; then + + tmux new-session -d -c "$directory" -s "$session" 'voltron-source 32' + firstPane=$(tmux display-message -p "#{pane_id}") + firstWindow=$(tmux display-message -p "#{window_id}") + + srcPane="$firstPane" + + tmux splitw -h -p 70 -t "$srcPane" voltron-disassembly-mixed + disassPane=$(tmux display-message -p "#{pane_id}") + + + tmux splitw -v -p 30 -t "$srcPane" voltron-locals + localsPane=$(tmux display-message -p "#{pane_id}") + + tmux new-window voltron-disassembly &> /dev/null + sourcePane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -v -p 30 -t "$sourcePane" voltron-locals + localsPane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -h -p 70 -t "$sourcePane" voltron-registers + registersPane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -h -p 70 -t "$localsPane" voltron-backtrace + backTracePane=$(tmux display-message -p "#{pane_id}") + + tmux select-window -t "$firstWindow" + tmux select-pane -t "$firstPane" + + fi + echo "$session" + + 3. ~/bin/llvm/lldb-ui + + #!/usr/bin/env bash + # Maintained in linux-config.org + directory="${1:-`pwd`}" + session="$(lldb-ui-session "${directory}" "$2")" + ONETERM_TITLE="dbg:lldb-$session" sway-oneterminal "$session" + + 4. emacs + + 1. build-emacs + + build and install in own bin directory + + #!/usr/bin/env bash + # Maintained in linux-config.org + cd ~/development/projects/emacs/emacs || return + ./configure --prefix=/home/rgr/.emacs.d/bin + make -j"$(nproc)" && make install + + 5. lldb voltron scripts + + 1. ~/bin/llvm/voltron-backtrace + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'thread backtrace' + + 2. ~/bin/llvm/voltron-breakpoints + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'breakpoint list' + + 3. ~/bin/llvm/voltron-disassembly + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'disassemble --pc --context '"${1:-4}"' --count '"${2:-4}"'' + + 4. ~/bin/llvm/voltron-disassembly-mixed + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'disassemble --mixed --pc --context '"${1:-1}"' --count '"${2:-32}"'' + + 5. ~/bin/llvm/voltron-locals + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'frame variable' --lexer c + + 6. ~/bin/llvm/voltron-registers + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v registers + + 7. ~/bin/llvm/voltron-source + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v c 'source list -a $rip -c '"${1:-32}"'' + + 8. ~/bin/llvm/voltron-stack + + #!/usr/bin/env bash + # Maintained in linux-config.org + voltron v stack + + 6. lldb python scripting :python: + + lldb also has a built-in Python interpreter, which is accessible by the β€œscript” command. All the functionality of the debugger is available as classes in the Python interpreter, so the more complex commands that in gdb you would introduce with the β€œdefine” command can be done by writing Python functions using the lldb-Python library, then loading the scripts into your running session and accessing them with the β€œscript” command. + + + + 1. TODO follow up on SE post + + + + +## gdbgui + + + + +### fix for python 3.9 + + export PURE_PYTHON=1 + + +## haskell + + # haskell + #source "${HOME}/.ghcup/env" + + +## python + + +### pyvenv + +1. add pyenv to path + + export PYENV_ROOT="${HOME}/bin/thirdparty/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init --path)" + + +### Debuggers :debuggers: + +1. pdb :pdb: + + + The official python debugger + [/home/rgr/development/projects/Python/debugging/pdb](file:///home/rgr/development/projects/Python/debugging/pdb) + +2. ipdb :ipdb: + + + + 1. installing + + pip install ipdb + + 2. Better Python Debugging + + + + 3. ~/.ipdb + + # Maintained in linux-config.org + context=5 + + +## platformio :platformio: + + # platformio integration - point to pio ide (vscode) stuff. + export PATH="${PATH}:${HOME}/.platformio/penv/bin" + + +## Android :android: + + +### Sdk :sdk: + + # android sdk + export ANDROID_HOME="${HOME}/development/Android/Sdk" + export PATH="${PATH}:${ANDROID_HOME}/emulator" + export PATH="${PATH}:${ANDROID_HOME}/platform-tools" + + export ANDROID_STUDIO_HOME="${HOME}/bin/thirdparty/android-studio" + export PATH="${PATH}:${ANDROID_STUDIO_HOME}/bin" + + +## node.js + + +### nvm + +[nvm](https://github.com/nvm-sh/nvm#installing-and-updating) allows you to quickly install and use different versions of node via the command line. + + lts/* + + export NVM_DIR="$HOME/.config/nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm + + export NVM_DIR="$HOME/.config/nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm + + +### snap + + export PATH="/snap/bin:$PATH" + + +## stm32 :embedded:stm32: + + +### stm32cubeide :stm32cubeide: + +1. path + + # platformio integration - point to pio ide (vscode) stuff. + export PATH="${PATH}:${HOME}/bin/thirdparty/stm32cubeide_1.9.0" + +2. install / uninstall + + #!/usr/bin/env bash + #Maintained in linux-config.org + version="${1:-${STM32CUBEIDE_VERSION:-"1.9.0"}}" + echo "Removing st-stm32cubeide-${version}" + sudo dpkg -r st-stm32cubeide-"$version" + sudo dpkg -r st-stlink-server + sudo dpkg -r st-stlink-udev-rules + sudo dpkg -r segger-jlink-udev-rules + +3. STM32CubeMX app + + This is a bit defunct now (may 2022) as they have packaged their code into exes. Also there is a wayland exe. + + :ID: b9b221b0-510f-415b-8819-c96b6e00a1d9 + :header-args:tangle: no + + #!/usr/bin/env bash + #Maintained in linux-config.org + java -jar ~/bin/thirdparty/STM32CubeMX/STM32CubeMX + + 1. sway + + for_window [class="STM32CubeIDE"] floating enable + assign [class="STM32CubeIDE"] 3 + assign [title="STM32CubeIDE"] 3 + +4. launcher for X11 compatability + + pending deletion + + #!/usr/bin/env bash + # Maintained in linux-config.org + JAVA_AWT_WM_NONREPARENTING=1 GDK_BACKEND=x11 exec "/opt/st/stm32cubeide_${STM32CUBEIDE_VERSION:-"1.7.0"}/stm32cubeide" + + +# PGP/GNUPG/GPG + + +## ~/.gnupg/gpg.conf + + # Maintained in linux-config.org + use-agent + + +## ~/.gnupg/gpg-agent.conf + + # Maintained in linux-config.org + #gpg-preset-passphrase + allow-preset-passphrase + pinentry-program /usr/bin/pinentry + max-cache-ttl 86400 + default-cache-ttl 86400 + max-cache-ttl-ssh 86400 + default-cache-ttl-ssh 86400 + enable-ssh-support + + +## ~/.profile + + export USER_STARTX_START= + + +## ~/.profile.local + +potentially need some gpg keys : not tangled + + +### keys :crypt: + +–—BEGIN PGP MESSAGE–— +hQEMA7IjL5SkHG4iAQgAnAMLgodgtOc1tsGz6mRqJbkJsM+R+5MTPdsOdml6xMoL +xFZjkYTDUGa3G6PsQHpbJ/tjD+6B4qmZIymq1EReWPtrepGGN6DNG8hLPVNnQ+9N +WAFaK1o+gzzfsw9XuptT5Um47k2G3zm019mGKDe0OwYJJ/r/DTHpz9yI9nj5lVdq +sdk0Y/WQL/5mcraC7LPz0FhIhuXqKKFNvcQCA6D0fTWJxlzqvXRzuc44LN+mvozq +9Q4WbvXp/etZjeiUYjXmz70KEYxFIch3OR4EGmV41apfojLTmR9R2dp/u3jYexMy +NlXugS5egyP+ioiuuTcCsSjN4rxnDwSW868lLkdhIdLAPgFdxEWpJjtaJO0A9aIB +6lJTRLKPzuwTyGiyRdKO8yqYFYwllgfEr/87qcB/ajjRpkhw9tlD8zTrODt4ZUu2 +MQQHK2rzvplmgDf2LvDMiM2gv7z4bI3YzOTiGu6m+SxW/j8LA71WRMwhFmUObgOb +g44XzdKHAV0o0Q/ZPPnJU4dlKc9nRkNS3MzpORmUGAT1/FSwt+q7uzpuBTZ1crGl +P/fo8sDBBu2QBoL2+gQZ11l7uSZMjTCR/8msBO5LbLDmyOUposbv6va1dzPN898F +ZsaqN9VNjV2b75kQiPJsZaoekClV7yOFc10/VRKBFD1MlspEovrIpReI9by6azIU +=nb0T +–—END PGP MESSAGE–— + + +# Email Related + + +## mu4e - mu for Emacs + +[mu4e](https://www.djcbsoftware.nl/code/mu/mu4e.html), a Maildir based email client for Emacs, is configured in my [emacs-config](https://github.com/rileyrg/Emacs-Customisations) + + +## Maildir sync using [mbsync](https://wiki.archlinux.org/index.php/Isync) inspired by the [SystemCrafters](https://www.youtube.com/watch?v=yZRyEhi4y44&ab_channel=SystemCrafters&loop=0) video. + +maildir sync using mbsync + + +### install isync and mu4e + +mu4e includes [mu](https://www.djcbsoftware.nl/code/mu/mu4e/Indexing-your-messages.html) for indexing. + + sudo apt install isync mu4e + + +### mbsync config + +Note the [PassCmd](https://wiki.archlinux.org/index.php/Isync) - since I use gpg then that's the way to go. + + # Maintained in linux-config.org + Create Both + Expunge Both + SyncState * + + IMAPAccount gmx + Host imap.gmx.com + User rileyrg@gmx.de + PassCmd "pass Email/gmx/apps/mbsync" + SSLType IMAPS + CertificateFile /etc/ssl/certs/ca-certificates.crt + PipelineDepth 1 + + IMAPStore gmx-remote + Account gmx + + MaildirStore gmx-local + Path ~/Maildir/gmx/ + Inbox ~/Maildir/gmx/INBOX + SubFolders Legacy + + Channel gmx-inbox + Far :gmx-remote:"INBOX" + Near :gmx-local:"INBOX" + + Channel gmx-sent + Far :gmx-remote:"Gesendet" + Near :gmx-local:"Sent" + + Channel gmx-learning + Far :gmx-remote:"Learning" + Near :gmx-local:"Learning" + + Channel gmx-drafts + Far :gmx-remote:"Entw&APw-rfe" + Near :gmx-local:"Drafts" + + Channel gmx-bin + Far :gmx-remote:"Gel&APY-scht" + Near :gmx-local:"Bin" + + Channel gmx-spam + Far :gmx-remote:"Spamverdacht" + Near :gmx-local:"Spam" + + Channel gmx-archive + Far :gmx-remote:"Archiv" + Near :gmx-local:"Archive" + + Group gmx + Channel gmx-inbox + Channel gmx-sent + Channel gmx-drafts + Channel gmx-bin + Channel gmx-spam + Channel gmx-archive + + Group gmx-special-interest + Channel gmx-learning + + IMAPAccount gmail + Host imap.gmail.com + User rileyrg@gmail.com + PassCmd "pass Email/gmail/apps/mbsync" + SSLType IMAPS + CertificateFile /etc/ssl/certs/ca-certificates.crt + PipelineDepth 32 + + IMAPStore gmail-remote + Account gmail + + MaildirStore gmail-local + Path ~/Maildir/gmail/ + Inbox ~/Maildir/gmail/INBOX + SubFolders Legacy + + Channel gmail-inbox + Far :gmail-remote:"INBOX" + Near :gmail-local:"INBOX" + + Channel gmail-sent + Far :gmail-remote:"[Google Mail]/Sent Mail" + Near :gmail-local:"Sent" + + Channel gmail-drafts + Far :gmail-remote:"[Google Mail]/Drafts" + Near :gmail-local:"Drafts" + + Channel gmail-bin + Far :gmail-remote:"[Google Mail]/Bin" + Near :gmail-local:"Bin" + + Channel gmail-spam + Far :gmail-remote:"[Google Mail]/Spam" + Near :gmail-local:"Spam" + + Channel gmail-archive + Far :gmail-remote:"[Google Mail]/All Mail" + Near :gmail-local:"Archive" + + Channel gmail-gmx-archive + Far :gmail-remote:"[Google Mail]/All Mail" + Near :gmx-local:"gmail/Archive" + + Group gmail + Channel gmail-inbox + Channel gmail-sent + Channel gmail-drafts + Channel gmail-bin + Channel gmail-spam + Channel gmail-archive + + Group gmail-gmx + Channel gmail-gmx-archive + + +### sync and index + + cd ~ + mkdir -p ~/Maildir/gmail + mkdir -p ~/Maildir/gmx + mbsync gmail gmx + mu init --maildir=~/Maildir --my-address="riley**@gmx.de" --my-address="riley**@gmail.com" + mu index + + +### mbsync services + +1. ~/.config/systemd/user/mbsync.timer + + [Unit] + Description=Mailbox synchronization timer + + [Timer] + OnBootSec=15m + OnUnitActiveSec=60m + Unit=mbsync.service + + [Install] + WantedBy=timers.target + +2. ~/.config/systemd/user/mbsync.service + + [Unit] + Description=Mailbox synchronization service + + [Service] + Type=oneshot + ExecStart=/home/rgr/bin/getmails + + and activate them + + systemctl --user enable mbsync.timer + systemctl --user start mbsync.timer + + +## ~/bin/getmails + + #!/usr/bin/env bash + # Maintained in linux-config.org + if [ $# -eq 0 ] + then + mbsync -a + else + mbsync "$@" + fi + pidof mu &> /dev/null || mu index + + +# bin + + +## ~/bin/bluetooth-headphone-controls + +Enable bluetooth multimedia pause/ play + + #!/usr/bin/env bash + # Maintained in linux-config.org + pkill mpris-proxy + mpris-proxy + + +## ~/bin/edit + + #!/usr/bin/env bash + # Maintained in linux-config.org + ${VISUAL:-${EDITOR:-vi}} "${@}" + + +## ~/bin/eman + +Use emacs for manpages if it's running +might be an idea set an alias such as 'alias man=eman' + + #!/usr/bin/env bash + # Maintained in linux-config.org + mp="${1:-man}" + if pidof emacs; then + emacsclient -c -e "(manual-entry \"-a ${mp}\")" &> /dev/null & + else + sway-oneterminal random-man "man $mp" + fi + + +## ~/bin/expert-advice + + #!/usr/bin/env bash + # Maintained in linux-config.org + f=$(command -v fortune &>/dev/null && fortune || echo "I don't need to study a subject to have my own truths. Because own truths ARE a thing in 2020.") + if [ "$1" = "t" ] + then + echo $f | xclip -i -selection clipboard + fi + echo $f + + +## ~/bin/extract-debug-info + +strip debug info and store elsewhere + + #!/usr/bin/env bash + # Maintained in linux-config.org + scriptdir=`dirname ${0}` + scriptdir=`(cd ${scriptdir}; pwd)` + scriptname=`basename ${0}` + + set -e + + function errorexit() + { + errorcode=${1} + shift + echo $@ + exit ${errorcode} + } + + function usage() + { + echo "USAGE ${scriptname} " + } + + tostripdir=`dirname "$1"` + tostripfile=`basename "$1"` + + + if [ -z ${tostripfile} ] ; then + usage + errorexit 0 "tostrip must be specified" + fi + + cd "${tostripdir}" + + debugdir=.debug + debugfile="${tostripfile}.debug" + + if [ ! -d "${debugdir}" ] ; then + echo "creating dir ${tostripdir}/${debugdir}" + mkdir -p "${debugdir}" + fi + echo "stripping ${tostripfile}, putting debug info into ${debugfile}" + objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}" + strip --strip-debug "${tostripfile}" + #objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}" + chmod -x "${debugdir}/${debugfile}" + + +## ~/bin/htop-regexp + + #!/usr/bin/env bash + #Maintained in linux-config.org + filter="${1:-"$(zenity --entry --text "HTop filter" --title "htop regexp")"}" + [ -z "$filter" ] && exit 1 + session="${2:-"htop-filter-${filter//[^[:alnum:]]/}"}" + pids=$(ps aux | awk '/'"${filter}"'/ {print $2}' | xargs | sed -e 's/ /,/g') + if tmux has-session -t "${session}"; then + tmux kill-session -t "${session}" + sleep 0.1 + fi + tmux new-session -d -s "${session}" "htop -p $pids" + sleep 0.1 + ONETERM_TITLE="filtered htop:${filter}" sway-oneterminal "${session}" + + +## ~/bin/make-compile\_commands + + #!/usr/bin/env bash + #Maintained in linux-config.org + make --always-make --dry-run \ + | grep -wE 'gcc|g++' \ + | grep -w '\-c' \ + | jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$").string[1:]}]' \ + > compile_commands.json + + +## ~/bin/md-read + + #!/usr/bin/env bash + #Maintained in linux-config.org + [ -z $(command -v lynx) ] && echo "install lynx" && exit 1 + [ -z $(command -v pandoc) ] && echo "install pandoc" && exit 1 + pandoc "$1" | lynx -stdin + + +## ~/bin/random-man-page + + #!/usr/bin/env bash + #Maintained in linux-config.org + page="$(find /usr/share/man/man1 -type f | sort -R | head -n1)" + eman "$page" + + +## ~/bin/remove-broken-symlinks + + #!/usr/bin/env bash + #Maintained in linux-config.org + find -L . -name . -o -type d -prune -o -type l -exec rm {} + + + +## ~/bin/remove-conflicted-copies + + #!/usr/bin/env bash + #Maintained in linux-config.org + if [ "$1" == "--f" ]; then + find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -exec rm -f {} \; + find ~/Dropbox/ -path "*(*s in Konflikt stehende Kopie [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -exec rm -f {} \; + + else + echo "add --f to force deletion of conflicted copies" + find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -print + find ~/Dropbox/ -path "*(*s in Konflikt stehende Kopie [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -print + fi + + +## ~/bin/resgithub.sh + +[resgithub.sh - reset local and remote git repo](https://github.com/rileyrg/resgithub) + + #!/usr/bin/bash + #Maintained in resgithub.org + tconfig=$(mktemp) + texclude=$(mktemp) + commitmsg=${1:-"git repository initialised"} + if [ -f .git/config ]; then + cp .git/config "$tconfig" + cp .git/info/exclude "$texclude" + rm -rf .git + git init . + mv "$tconfig" .git/config + mv "$texclude" .git/info/exclude + git add . + git commit -a -m "$commitmsg" + # git push -f + else + echo "test Warning: No git config file found. Aborting.";exit; + fi + + +## ~/bin/rsnapshot-if-mounted + + #!/usr/bin/env bash + #Maintained in linux-config.org + mountpoint=${1:-"/media/rsnapshot"}; + rsnapshottype=${2:-"alpha"}; + if $(/usr/bin/mountpoint -q $mountpoint); then + echo "$mountpoint is mounted"; + /usr/bin/rsnapshot -v "$rsnapshottype"; + else + echo "$mountpoint not mounted"; + fi; + + +## ~/cloud/etc/rsnapshot/excludes + + #Maintained in linux-config.org + - /home/rgr/.local/share/Steam/ + - /home/rgr/Mail/ + - /home/rgr/Maildir/ + - OpenAudible/aax/ + - OpenAudible/books/ + - OpenAudible/current/ + - cloud/.syncrclone/ + - .syncrclone/logs/ + - .syncrclone/backups/ + + +## ~/bin/sharemouse + + #!/usr/bin/env bash + #Maintained in linux-config.org + exec ssh -X ${1-192.168.2.100} x2x -east -to :0 + + +## ~/bin/wifi-toggle + + #!/usr/bin/env bash + #Maintained in linux-config.org + status="$(nmcli radio wifi)" + if [ "$status" = "enabled" ]; then + nmcli radio wifi off + echo "Wifi Off" + else + nmcli radio wifi on + echo "Wifi On" + fi + + +## ~/bin/enable-disable-wifi + + #!/usr/bin/env bash + #Maintained in linux-config.org + + if LANG=C nmcli dev | grep -q '\sethernet\s\+connected\s'; then + if [ -f "${HOME}"/.wifi-and-eth ]; then + echo "${HOME}/.wifi-and-eth exists so wifi on." + nmcli radio wifi on + else + echo "Turning wifi off" + nmcli radio wifi off + fi + else + echo "Turning wifi on" + nmcli radio wifi on + fi + + +## ~/bin/70-wifi-wired-exclusive.sh + + #!/usr/bin/env bash + #Maintained in linux-config.org + # https://askubuntu.com/a/1272865/232407 + export LC_ALL=C + + # This dispatcher script makes Wi-Fi mutually exclusive with wired networking. When a wired + # interface is connected, Wi-Fi will be set to airplane mode (rfkilled). When the wired + # interface is disconnected, Wi-Fi will be turned back on. Name this script e.g. + # 70-wifi-wired-exclusive.sh and put it into /etc/NetworkManager/dispatcher.d/ directory. + # See NetworkManager(8) manual page for more information about NetworkManager dispatcher + # scripts. + + if [ "$2" = "up" ]; then + enable-disable-wifi + fi + + if [ "$2" = "down" ]; then + enable-disable-wifi + fi + + +## ~/bin/upd + +update sw + + #!/usr/bin/env bash + # Maintained in linux-config.org + string="$(uname -r)" + if [[ $string == *"arch"* ]]; then + sudo pacman -Syu + else + export DEBIAN_FRONTEND=noninteractive + sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y + fi + + +## rclone + + + + +### ~/bin/syncrclone-gdrive-docs + + + + #!/usr/bin/env bash + # Maintained in linux-config.org + syncrclone "$HOME"/.syncrclone/gdrive-docs-config.py + + +### ~/bin/syncrclone-gdrive + + #!/usr/bin/env bash + # Maintained in linux-config.org + syncrclone "$HOME"/.syncrclone/gdrive-config.py + + +### ~/bin/hetzner-du + + #!/usr/bin/env bash + # Maintained in linux-config.org + echo "df -h" | sftp u377059@u377059.your-storagebox.de + + +### ~/bin/rclone-mount + + #!/usr/bin/env bash + # Maintained in linux-config.org + remote=${1:-"hetzner"} + if [ -d ~/$remote ]; then + umount ~/${remote} + rmdir ~/${remote} + echo "Closed ~/${remote}" + else + mkdir -p ~/${remote} + rclone mount $( [ "$2" != "rw" ] && echo "--read-only") ${remote}: ~/${remote} &> /dev/null & + echo "Mounted ~/${remote}" + fi + + +### ~/bin/gdrive-mount + + #!/usr/bin/env bash + # Maintained in linux-config.org + rclone-mount gdrive "$1" + + +### ~/bin/hetzner-mount + + #!/usr/bin/env bash + # Maintained in linux-config.org + rclone-mount hetzner "$1" + + +### ~/bin/syncrclone-htop + + #!/usr/bin/env bash + # Maintained in linux-config.org + htop -F "syncrclone" + + +### ~/bin/syncrclone-once + + #!/usr/bin/env bash + # Maintained in linux-config.org + if ! network-online; then + echo "offline" + exit 1 + fi + if pgrep -x "rclone" > /dev/null; then + echo "syncrclone already running" + exit 1 + else + if [[ -z $SYNC_CRON ]]; then + syncrclone | mail -s "syncrclone manual : $(date)" $USER + else + syncrclone + fi + exit 0 + fi + + +## cloud rsync between machines + + #Maintained in linux-config.org + cloud/.syncrclone/ + Documents/.syncrclone/ + OpenAudible/aax/ + OpenAudible/books/ + + +## Google Translate Helpers + + sudo apt install translate-shell + + +### ~/bin/google-trans + + #!/usr/bin/env bash + #Maintained in linux-config.org + src=$1;shift; + dst=$1;shift; + txt=$@; + trans -e google -s ${src} -t ${dst} -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$txt" + + +### ~/bin/google-trans-de-en + + #!/usr/bin/env bash + #Maintained in linux-config.org + trans -e google -s de -t en -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$@" + + +### ~/bin/google-trans-en-de + + #!/usr/bin/env bash + #Maintained in linux-config.org + trans -e google -s en -t de -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$@" + + +## Security/Locking/GPG + + +### ~/bin/gpg-cache + + #!/usr/bin/env bash + #Maintained in linux-config.org + if ! pidof gpg-agent; then + cachefile="${1:-"${HOME}/.gnupg/auth/cache-keys"}" + if [ -f "$cachefile" ]; then + p=$(zenity --password --title "Password for SSH") + if [ ! -z "$p" ]; then + while IFS= read -r k; do + [ ! -z "$p" ] && echo "$p" | /usr/lib/gnupg2/gpg-preset-passphrase --preset "$k" + done < "$cachefile" + fi + fi + fi + +\#+end\_src + + +### ~/bin/pre-lock + + #!/usr/bin/env bash + #Maintained in linux-config.org + [ -f "${HOME}"/.pre-lock ] && . "${HOME}"/.pre-lock + +1. Sample .pre-lock + + #!/usr/bin/env bash + xmg-neo-rgb-kbd-lights sleep + + +### ~/bin/post-lock + + #!/usr/bin/env bash + #Maintained in linux-config.org + [ -f "${HOME}"/.post-lock ] && . "${HOME}"/.post-lock + +1. Sample .post-lock + + #!/usr/bin/env bash + xmg-neo-rgb-kbd-lights wake + + +### ~/bin/pre-blank + + #!/usr/bin/env bash + #Maintained in linux-config.org + command -v brightnessctl && brightnessctl -s + [ -f ~/.pre-blank ] && . ~/.pre-blank + + +### ~/bin/post-blank + + #!/usr/bin/env bash + #Maintained in linux-config.org + [ -f ~/.post-blank ] && . ~/.post-blank + command -v brightnessctl && brightnessctl -r + + +# AIS + +out of date + + #!/usr/bin/env bash + #Maintained in linux-config.org + TMUX= tmux new -A -s "AIS" AIScatcher + + #!/usr/bin/env bash + #Maintained in linux-config.org + if ! pgrep AIS-catcher >/dev/null + then + echo "`date`: AIS-catcher down. Restarting." >> "${HOME}/.AISStatus" + "${HOME}/bin/AIScatcher" &> /dev/null & + fi + + #!/usr/bin/env bash + #Maintained in linux-config.org + "${HOME}/bin/AIS-catcher" -d:0 -u 127.0.0.1 2345 + + +# tailends + + +## ~/.bash\_profile + + + [ -f "${HOME}/.bash_profile.local" ] && . "${HOME}/.bash_profile.local" + [ -f "${HOME}/.cargo/env" ] && . "$HOME/.cargo/env" + sway-autostart + + +## ~/.profile + + # fix for java apps in sway + export _JAVA_AWT_WM_NONREPARENTING=1 + pgrep emacs > /dev/null || (emacs --daemon="general" > /dev/null 2>&1 & ) + [ -f "${HOME}/.profile.local" ] && . "${HOME}/.profile.local" + + +## sway config + + include /etc/sway/config.d/* + include config-vars.d/* + diff --git a/directories/bin/.projectile b/directories/bin/.projectile new file mode 100644 index 00000000..e69de29b diff --git a/directories/bin/70-wifi-wired-exclusive.sh b/directories/bin/70-wifi-wired-exclusive.sh new file mode 100755 index 00000000..5a6f80fe --- /dev/null +++ b/directories/bin/70-wifi-wired-exclusive.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +# https://askubuntu.com/a/1272865/232407 +export LC_ALL=C + +# This dispatcher script makes Wi-Fi mutually exclusive with wired networking. When a wired +# interface is connected, Wi-Fi will be set to airplane mode (rfkilled). When the wired +# interface is disconnected, Wi-Fi will be turned back on. Name this script e.g. +# 70-wifi-wired-exclusive.sh and put it into /etc/NetworkManager/dispatcher.d/ directory. +# See NetworkManager(8) manual page for more information about NetworkManager dispatcher +# scripts. + +if [ "$2" = "up" ]; then + enable-disable-wifi +fi + +if [ "$2" = "down" ]; then + enable-disable-wifi +fi diff --git a/directories/bin/AIS b/directories/bin/AIS new file mode 100755 index 00000000..aa063801 --- /dev/null +++ b/directories/bin/AIS @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +TMUX= tmux new -A -s "AIS" AIScatcher diff --git a/directories/bin/AIScatcher b/directories/bin/AIScatcher new file mode 100755 index 00000000..96f12546 --- /dev/null +++ b/directories/bin/AIScatcher @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +"${HOME}/bin/AIS-catcher" -d:0 -u 127.0.0.1 2345 diff --git a/directories/bin/AIScheck b/directories/bin/AIScheck new file mode 100755 index 00000000..c699972c --- /dev/null +++ b/directories/bin/AIScheck @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if ! pgrep AIS-catcher >/dev/null +then + echo "`date`: AIS-catcher down. Restarting." >> "${HOME}/.AISStatus" + "${HOME}/bin/AIScatcher" &> /dev/null & +fi diff --git a/directories/bin/bluetooth-headphone-controls b/directories/bin/bluetooth-headphone-controls new file mode 100755 index 00000000..812c0816 --- /dev/null +++ b/directories/bin/bluetooth-headphone-controls @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +pkill mpris-proxy +mpris-proxy diff --git a/directories/bin/build-emacs b/directories/bin/build-emacs new file mode 100755 index 00000000..fe6b6b18 --- /dev/null +++ b/directories/bin/build-emacs @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +cd ~/development/projects/emacs/emacs || return +./configure --prefix=/home/rgr/.emacs.d/bin +make -j"$(nproc)" && make install diff --git a/directories/bin/discharge-suspend b/directories/bin/discharge-suspend new file mode 100755 index 00000000..a85c5cde --- /dev/null +++ b/directories/bin/discharge-suspend @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +# +# +pollCycle=${BAT_POWER_POLL_CYCLE:-600} +while true; do + sleep "$pollCycle" + if [ ! -f ~/.BAT_POWER_SUSPEND_SUSPEND ];then + mapfile -t batStats< <(cat /sys/class/power_supply/BAT0/{status,capacity}) + status=${batStats[0]} + level=${batStats[1]} + if [ "$status" = "Discharging" ]; then + if [ "$level" -le "${BAT_POWER_SUSPEND_LEVEL:-30}" ]; then + if [ -f ~/.BAT_POWER_LOW ]; then + notify-send "** SUSPENDING in 15 SECONDS **" + beep + sleep 15 + rm ~/.BAT_POWER_LOW + systemctl suspend + else + touch ~/.BAT_POWER_LOW + notify-send "**WARNING**" "Battery low. Suspending in ${pollCycle} seconds." + beep + fi + fi + else + rm -f ~/.BAT_POWER_LOW + fi + fi +done diff --git a/directories/bin/edit b/directories/bin/edit new file mode 100755 index 00000000..a6166d54 --- /dev/null +++ b/directories/bin/edit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +${VISUAL:-${EDITOR:-vi}} "${@}" diff --git a/directories/bin/eman b/directories/bin/eman new file mode 100755 index 00000000..74c392d7 --- /dev/null +++ b/directories/bin/eman @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +mp="${1:-man}" +if pidof emacs; then + emacsclient -c -e "(manual-entry \"-a ${mp}\")" &> /dev/null & +else + sway-oneterminal random-man "man $mp" +fi diff --git a/directories/bin/enable-disable-wifi b/directories/bin/enable-disable-wifi new file mode 100755 index 00000000..45bdbf75 --- /dev/null +++ b/directories/bin/enable-disable-wifi @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org + +if LANG=C nmcli dev | grep -q '\sethernet\s\+connected\s'; then + if [ -f "${HOME}"/.wifi-and-eth ]; then + echo "${HOME}/.wifi-and-eth exists so wifi on." + nmcli radio wifi on + else + echo "Turning wifi off" + nmcli radio wifi off + fi +else + echo "Turning wifi on" + nmcli radio wifi on +fi diff --git a/directories/bin/expert-advice b/directories/bin/expert-advice new file mode 100755 index 00000000..0e812232 --- /dev/null +++ b/directories/bin/expert-advice @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +f=$(command -v fortune &>/dev/null && fortune || echo "I don't need to study a subject to have my own truths. Because own truths ARE a thing in 2020.") +if [ "$1" = "t" ] +then + echo $f | xclip -i -selection clipboard +fi +echo $f diff --git a/directories/bin/extract-debug-info b/directories/bin/extract-debug-info new file mode 100755 index 00000000..a690d7a8 --- /dev/null +++ b/directories/bin/extract-debug-info @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +scriptdir=`dirname ${0}` +scriptdir=`(cd ${scriptdir}; pwd)` +scriptname=`basename ${0}` + +set -e + +function errorexit() +{ + errorcode=${1} + shift + echo $@ + exit ${errorcode} +} + +function usage() +{ + echo "USAGE ${scriptname} " +} + +tostripdir=`dirname "$1"` +tostripfile=`basename "$1"` + + +if [ -z ${tostripfile} ] ; then + usage + errorexit 0 "tostrip must be specified" +fi + +cd "${tostripdir}" + +debugdir=.debug +debugfile="${tostripfile}.debug" + +if [ ! -d "${debugdir}" ] ; then + echo "creating dir ${tostripdir}/${debugdir}" + mkdir -p "${debugdir}" +fi +echo "stripping ${tostripfile}, putting debug info into ${debugfile}" +objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}" +strip --strip-debug "${tostripfile}" +#objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}" +chmod -x "${debugdir}/${debugfile}" diff --git a/directories/bin/gdb-scripts/tmux-pane-tty.py b/directories/bin/gdb-scripts/tmux-pane-tty.py new file mode 100755 index 00000000..b84c00e0 --- /dev/null +++ b/directories/bin/gdb-scripts/tmux-pane-tty.py @@ -0,0 +1,12 @@ +import os + + class TmuxPaneTTY (gdb.Command): + """return the tty value in use for a certain session and pane""" + + def__init__(self): + super(TmuxPaneTTY, self).__init__("tmux-pane-tty", gdb.COMMAND_USER) + + def invoke(self, arg, from_tty): + os.system("tmux-pane-tty voltron 4") + + TMuxPaneTTY() diff --git a/directories/bin/gdrive-mount b/directories/bin/gdrive-mount new file mode 100755 index 00000000..593f5959 --- /dev/null +++ b/directories/bin/gdrive-mount @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +rclone-mount gdrive "$1" diff --git a/directories/bin/getmails b/directories/bin/getmails new file mode 100755 index 00000000..35b8807d --- /dev/null +++ b/directories/bin/getmails @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if [ $# -eq 0 ] +then + mbsync -a +else + mbsync "$@" +fi +pidof mu &> /dev/null || mu index diff --git a/directories/bin/google-trans b/directories/bin/google-trans new file mode 100755 index 00000000..8a56954a --- /dev/null +++ b/directories/bin/google-trans @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +src=$1;shift; +dst=$1;shift; +txt=$@; +trans -e google -s ${src} -t ${dst} -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$txt" diff --git a/directories/bin/google-trans-de-en b/directories/bin/google-trans-de-en new file mode 100755 index 00000000..b828f913 --- /dev/null +++ b/directories/bin/google-trans-de-en @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +trans -e google -s de -t en -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$@" diff --git a/directories/bin/google-trans-en-de b/directories/bin/google-trans-en-de new file mode 100755 index 00000000..dc11c1c0 --- /dev/null +++ b/directories/bin/google-trans-en-de @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +trans -e google -s en -t de -show-original y -show-original-phonetics y -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary y -show-dictionary y -show-alternatives y "$@" diff --git a/directories/bin/gpg-cache b/directories/bin/gpg-cache new file mode 100755 index 00000000..d8903329 --- /dev/null +++ b/directories/bin/gpg-cache @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if ! pidof gpg-agent; then + cachefile="${1:-"${HOME}/.gnupg/auth/cache-keys"}" + if [ -f "$cachefile" ]; then + p=$(zenity --password --title "Password for SSH") + if [ ! -z "$p" ]; then + while IFS= read -r k; do + [ ! -z "$p" ] && echo "$p" | /usr/lib/gnupg2/gpg-preset-passphrase --preset "$k" + done < "$cachefile" + fi + fi +fi diff --git a/directories/bin/hetzner-du b/directories/bin/hetzner-du new file mode 100755 index 00000000..f5d849f6 --- /dev/null +++ b/directories/bin/hetzner-du @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +echo "df -h" | sftp u377059@u377059.your-storagebox.de diff --git a/directories/bin/hetzner-mount b/directories/bin/hetzner-mount new file mode 100755 index 00000000..19d346c3 --- /dev/null +++ b/directories/bin/hetzner-mount @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +rclone-mount hetzner "$1" diff --git a/directories/bin/htop-regexp b/directories/bin/htop-regexp new file mode 100755 index 00000000..ec7e5e7a --- /dev/null +++ b/directories/bin/htop-regexp @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +filter="${1:-"$(zenity --entry --text "HTop filter" --title "htop regexp")"}" +[ -z "$filter" ] && exit 1 +session="${2:-"htop-filter-${filter//[^[:alnum:]]/}"}" +pids=$(ps aux | awk '/'"${filter}"'/ {print $2}' | xargs | sed -e 's/ /,/g') +if tmux has-session -t "${session}"; then + tmux kill-session -t "${session}" + sleep 0.1 +fi +tmux new-session -d -s "${session}" "htop -p $pids" +sleep 0.1 +ONETERM_TITLE="filtered htop:${filter}" sway-oneterminal "${session}" diff --git a/directories/bin/llvm/disassembly_mode.py b/directories/bin/llvm/disassembly_mode.py new file mode 100755 index 00000000..56afb72a --- /dev/null +++ b/directories/bin/llvm/disassembly_mode.py @@ -0,0 +1,51 @@ +""" Adds the 'toggle-disassembly' command to switch you into a disassembly only mode """ +import lldb + +class DisassemblyMode: + def __init__(self, debugger, unused): + self.dbg = debugger + self.interp = debugger.GetCommandInterpreter() + self.store_state() + self.mode_off = True + + def store_state(self): + self.dis_count = self.get_string_value("stop-disassembly-count") + self.dis_display = self.get_string_value("stop-disassembly-display") + self.before_count = self.get_string_value("stop-line-count-before") + self.after_count = self.get_string_value("stop-line-count-after") + + def get_string_value(self, setting): + result = lldb.SBCommandReturnObject() + self.interp.HandleCommand("settings show " + setting, result) + value = result.GetOutput().split(" = ")[1].rstrip("\n") + return value + + def set_value(self, setting, value): + result = lldb.SBCommandReturnObject() + self.interp.HandleCommand("settings set " + setting + " " + value, result) + + def __call__(self, debugger, command, exe_ctx, result): + print("About to break") + breakpoint() + print("Back from break.") + if self.mode_off: + self.mode_off = False + self.store_state() + self.set_value("stop-disassembly-display","always") + self.set_value("stop-disassembly-count", "8") + self.set_value("stop-line-count-before", "0") + self.set_value("stop-line-count-after", "0") + result.AppendMessage("Disassembly mode on.") + else: + self.mode_off = True + self.set_value("stop-disassembly-display",self.dis_display) + self.set_value("stop-disassembly-count", self.dis_count) + self.set_value("stop-line-count-before", self.before_count) + self.set_value("stop-line-count-after", self.after_count) + result.AppendMessage("Disassembly mode off.") + + def get_short_help(self): + return "Toggles between a disassembly only mode and normal source mode\n" + +def __lldb_init_module(debugger, unused): + debugger.HandleCommand("command script add -c disassembly_mode.DisassemblyMode toggle-disassembly") diff --git a/directories/bin/llvm/lldb-ui b/directories/bin/llvm/lldb-ui new file mode 100755 index 00000000..44320b10 --- /dev/null +++ b/directories/bin/llvm/lldb-ui @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +directory="${1:-`pwd`}" +session="$(lldb-ui-session "${directory}" "$2")" +ONETERM_TITLE="dbg:lldb-$session" sway-oneterminal "$session" diff --git a/directories/bin/llvm/lldb-ui-session b/directories/bin/llvm/lldb-ui-session new file mode 100755 index 00000000..79cc2a65 --- /dev/null +++ b/directories/bin/llvm/lldb-ui-session @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + +# create a lldb debug session unless it already exists. +# the -d to new session says "dont attach to current terminal" +# there is a bug where the splt panes split that of a tmux session in the terminal +# we issue the command from. No idea why or how. +# directory="$(realpath -s "${1:-`pwd`}")" +directory="${1:-`pwd`}" +session="${2:-"voltron-$(basename "$directory")"}" +if ! TMUX= tmux has-session -t "$session" &> /dev/null; then + + tmux new-session -d -c "$directory" -s "$session" 'voltron-source 32' + firstPane=$(tmux display-message -p "#{pane_id}") + firstWindow=$(tmux display-message -p "#{window_id}") + + srcPane="$firstPane" + + tmux splitw -h -p 70 -t "$srcPane" voltron-disassembly-mixed + disassPane=$(tmux display-message -p "#{pane_id}") + + + tmux splitw -v -p 30 -t "$srcPane" voltron-locals + localsPane=$(tmux display-message -p "#{pane_id}") + + tmux new-window voltron-disassembly &> /dev/null + sourcePane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -v -p 30 -t "$sourcePane" voltron-locals + localsPane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -h -p 70 -t "$sourcePane" voltron-registers + registersPane=$(tmux display-message -p "#{pane_id}") + + tmux splitw -h -p 70 -t "$localsPane" voltron-backtrace + backTracePane=$(tmux display-message -p "#{pane_id}") + + tmux select-window -t "$firstWindow" + tmux select-pane -t "$firstPane" + +fi +echo "$session" diff --git a/directories/bin/llvm/voltron-backtrace b/directories/bin/llvm/voltron-backtrace new file mode 100755 index 00000000..b523d230 --- /dev/null +++ b/directories/bin/llvm/voltron-backtrace @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'thread backtrace' diff --git a/directories/bin/llvm/voltron-breakpoints b/directories/bin/llvm/voltron-breakpoints new file mode 100755 index 00000000..5b9f0258 --- /dev/null +++ b/directories/bin/llvm/voltron-breakpoints @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'breakpoint list' diff --git a/directories/bin/llvm/voltron-disassembly b/directories/bin/llvm/voltron-disassembly new file mode 100755 index 00000000..93474798 --- /dev/null +++ b/directories/bin/llvm/voltron-disassembly @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'disassemble --pc --context '"${1:-4}"' --count '"${2:-4}"'' diff --git a/directories/bin/llvm/voltron-disassembly-mixed b/directories/bin/llvm/voltron-disassembly-mixed new file mode 100755 index 00000000..7d3a2116 --- /dev/null +++ b/directories/bin/llvm/voltron-disassembly-mixed @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'disassemble --mixed --pc --context '"${1:-1}"' --count '"${2:-32}"'' diff --git a/directories/bin/llvm/voltron-locals b/directories/bin/llvm/voltron-locals new file mode 100755 index 00000000..3ca729ef --- /dev/null +++ b/directories/bin/llvm/voltron-locals @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'frame variable' --lexer c diff --git a/directories/bin/llvm/voltron-registers b/directories/bin/llvm/voltron-registers new file mode 100755 index 00000000..94b69227 --- /dev/null +++ b/directories/bin/llvm/voltron-registers @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v registers diff --git a/directories/bin/llvm/voltron-source b/directories/bin/llvm/voltron-source new file mode 100755 index 00000000..ef1d6d9e --- /dev/null +++ b/directories/bin/llvm/voltron-source @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v c 'source list -a $rip -c '"${1:-32}"'' diff --git a/directories/bin/llvm/voltron-stack b/directories/bin/llvm/voltron-stack new file mode 100755 index 00000000..699aec05 --- /dev/null +++ b/directories/bin/llvm/voltron-stack @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +voltron v stack diff --git a/directories/bin/make-compile_commands b/directories/bin/make-compile_commands new file mode 100755 index 00000000..8921c384 --- /dev/null +++ b/directories/bin/make-compile_commands @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +make --always-make --dry-run \ + | grep -wE 'gcc|g++' \ + | grep -w '\-c' \ + | jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$").string[1:]}]' \ + > compile_commands.json diff --git a/directories/bin/md-read b/directories/bin/md-read new file mode 100755 index 00000000..33a1f43a --- /dev/null +++ b/directories/bin/md-read @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + #Maintained in linux-config.org +[ -z $(command -v lynx) ] && echo "install lynx" && exit 1 +[ -z $(command -v pandoc) ] && echo "install pandoc" && exit 1 +pandoc "$1" | lynx -stdin diff --git a/directories/bin/network-online b/directories/bin/network-online new file mode 100755 index 00000000..146d03ac --- /dev/null +++ b/directories/bin/network-online @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +wget -q --spider http://google.com diff --git a/directories/bin/post-blank b/directories/bin/post-blank new file mode 100755 index 00000000..ece09c8a --- /dev/null +++ b/directories/bin/post-blank @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +[ -f ~/.post-blank ] && . ~/.post-blank +command -v brightnessctl && brightnessctl -r diff --git a/directories/bin/post-lock b/directories/bin/post-lock new file mode 100755 index 00000000..a9aab576 --- /dev/null +++ b/directories/bin/post-lock @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +[ -f "${HOME}"/.post-lock ] && . "${HOME}"/.post-lock diff --git a/directories/bin/pre-blank b/directories/bin/pre-blank new file mode 100755 index 00000000..5e400973 --- /dev/null +++ b/directories/bin/pre-blank @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +command -v brightnessctl && brightnessctl -s +[ -f ~/.pre-blank ] && . ~/.pre-blank diff --git a/directories/bin/pre-lock b/directories/bin/pre-lock new file mode 100755 index 00000000..e077008e --- /dev/null +++ b/directories/bin/pre-lock @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +[ -f "${HOME}"/.pre-lock ] && . "${HOME}"/.pre-lock diff --git a/directories/bin/random-man-page b/directories/bin/random-man-page new file mode 100755 index 00000000..aaabd962 --- /dev/null +++ b/directories/bin/random-man-page @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +page="$(find /usr/share/man/man1 -type f | sort -R | head -n1)" +eman "$page" diff --git a/directories/bin/rclone-mount b/directories/bin/rclone-mount new file mode 100755 index 00000000..5b84c7ea --- /dev/null +++ b/directories/bin/rclone-mount @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +remote=${1:-"hetzner"} +if [ -d ~/$remote ]; then + umount ~/${remote} + rmdir ~/${remote} + echo "Closed ~/${remote}" +else + mkdir -p ~/${remote} + rclone mount $( [ "$2" != "rw" ] && echo "--read-only") ${remote}: ~/${remote} &> /dev/null & + echo "Mounted ~/${remote}" +fi diff --git a/directories/bin/remove-broken-symlinks b/directories/bin/remove-broken-symlinks new file mode 100755 index 00000000..495f5cf8 --- /dev/null +++ b/directories/bin/remove-broken-symlinks @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +find -L . -name . -o -type d -prune -o -type l -exec rm {} + diff --git a/directories/bin/remove-conflicted-copies b/directories/bin/remove-conflicted-copies new file mode 100755 index 00000000..a1587462 --- /dev/null +++ b/directories/bin/remove-conflicted-copies @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if [ "$1" == "--f" ]; then + find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -exec rm -f {} \; + find ~/Dropbox/ -path "*(*s in Konflikt stehende Kopie [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -exec rm -f {} \; + +else + echo "add --f to force deletion of conflicted copies" + find ~/Dropbox/ -path "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -print + find ~/Dropbox/ -path "*(*s in Konflikt stehende Kopie [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*" -print +fi diff --git a/directories/bin/resgithub.sh b/directories/bin/resgithub.sh new file mode 120000 index 00000000..b567049c --- /dev/null +++ b/directories/bin/resgithub.sh @@ -0,0 +1 @@ +/home/rgr/development/projects/utilities/resgithub/resgithub.sh \ No newline at end of file diff --git a/directories/bin/rsnapshot-if-mounted b/directories/bin/rsnapshot-if-mounted new file mode 100755 index 00000000..1ed7e078 --- /dev/null +++ b/directories/bin/rsnapshot-if-mounted @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +mountpoint=${1:-"/media/rsnapshot"}; +rsnapshottype=${2:-"alpha"}; +if $(/usr/bin/mountpoint -q $mountpoint); then + echo "$mountpoint is mounted"; + /usr/bin/rsnapshot -v "$rsnapshottype"; +else + echo "$mountpoint not mounted"; +fi; diff --git a/directories/bin/stm32cubeide-uninstall b/directories/bin/stm32cubeide-uninstall new file mode 100755 index 00000000..1c6b983d --- /dev/null +++ b/directories/bin/stm32cubeide-uninstall @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +version="${1:-${STM32CUBEIDE_VERSION:-"1.9.0"}}" +echo "Removing st-stm32cubeide-${version}" +sudo dpkg -r st-stm32cubeide-"$version" +sudo dpkg -r st-stlink-server +sudo dpkg -r st-stlink-udev-rules +sudo dpkg -r segger-jlink-udev-rules diff --git a/directories/bin/sway/my-i3b-bluetooth b/directories/bin/sway/my-i3b-bluetooth new file mode 100755 index 00000000..94b89de0 --- /dev/null +++ b/directories/bin/sway/my-i3b-bluetooth @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +case $BLOCK_BUTTON in + 1) sway-bluetooth +esac + +get_from_file() { + dev=$1 + name= + if [ ! -f /tmp/bt-devices.txt ]; then + touch /tmp/bt-devices.txt + echo "" + return + fi + for i in `cat /tmp/bt-devices.txt`; do + d=`echo $i | awk -F:: '{print $1}'` + if [ $d = $dev ]; then + name=`echo $i | awk -F:: '{print $2}'` + fi + done + echo "${name}" +} + +store_file() { + dev=$1 + name="${2}" + echo "$dev::${name}" >> /tmp/bt-devices.txt +} + +connections=`hcitool con | sed -n 2p` +if [ ! -z "$connections" ]; then + # We have a connection, we want to get the name from a file if we've had + # it from there before because getting the name of the device connected + # is very slow and costly. + dev=`echo $connections | awk '{print $3}'` + name=`get_from_file $dev` + if [ -z "$name" ]; then + name=`hcitool name $dev | awk '{print $1}'` + if [ ! -z "${name}" ]; then + store_file $dev "${name}" + fi + fi + echo "οŠ” $name" + echo "οŠ” $name" + echo "#83AF40\n" + # echo "#859900\n" +else + echo "οŠ”" + echo "οŠ”" +fi diff --git a/directories/bin/sway/sway-active-monitor-ids b/directories/bin/sway/sway-active-monitor-ids new file mode 100755 index 00000000..373c1daa --- /dev/null +++ b/directories/bin/sway/sway-active-monitor-ids @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +swaymsg -t get_outputs | jq -r 'sort_by(.rect.x) | .[] | select(.dpms and .active) | .name' diff --git a/directories/bin/sway/sway-active-monitor-names b/directories/bin/sway/sway-active-monitor-names new file mode 100755 index 00000000..14f369ce --- /dev/null +++ b/directories/bin/sway/sway-active-monitor-names @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + swaymsg -t get_outputs | jq -r 'sort_by(.rect.x) | .[] | select(.dpms and .active)|(.make + " " + .model + " " + .serial)' diff --git a/directories/bin/sway/sway-active-monitors-count b/directories/bin/sway/sway-active-monitors-count new file mode 100755 index 00000000..d5ae5153 --- /dev/null +++ b/directories/bin/sway/sway-active-monitors-count @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length' diff --git a/directories/bin/sway/sway-autostart b/directories/bin/sway/sway-autostart new file mode 100755 index 00000000..5f788f9f --- /dev/null +++ b/directories/bin/sway/sway-autostart @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if [ -f "${HOME}/.SWAY_START" ] && [ -z "$SSH_CONNECTION" ]; then + if [ "$(hostname)" = "xmgneo" ];then + sway --my-next-gpu-wont-be-nvidia & + else + sway & + fi +fi diff --git a/directories/bin/sway/sway-blank b/directories/bin/sway/sway-blank new file mode 100755 index 00000000..5972707f --- /dev/null +++ b/directories/bin/sway/sway-blank @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-lock-utils blank diff --git a/directories/bin/sway/sway-bluetooth b/directories/bin/sway/sway-bluetooth new file mode 100755 index 00000000..494cc217 --- /dev/null +++ b/directories/bin/sway/sway-bluetooth @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +exec sway-oneterminal "bluetoothctl" "bluetoothctl" diff --git a/directories/bin/sway/sway-brightness-notify b/directories/bin/sway/sway-brightness-notify new file mode 100755 index 00000000..ed1f237f --- /dev/null +++ b/directories/bin/sway/sway-brightness-notify @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-notify "☼:$(printf "%.0f" `brightnessctl g`)" diff --git a/directories/bin/sway/sway-chrome b/directories/bin/sway/sway-chrome new file mode 100755 index 00000000..da425838 --- /dev/null +++ b/directories/bin/sway/sway-chrome @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + google-chrome --ozone-platform=wayland --hide-crash-restore-bubble --new-window "$@" & diff --git a/directories/bin/sway/sway-clipboard-history-clear b/directories/bin/sway/sway-clipboard-history-clear new file mode 100755 index 00000000..d3508658 --- /dev/null +++ b/directories/bin/sway/sway-clipboard-history-clear @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +clipman clear -a +sway-notify "Clipboard history cleared." diff --git a/directories/bin/sway/sway-clipboard-history-select b/directories/bin/sway/sway-clipboard-history-select new file mode 100755 index 00000000..1de0f25a --- /dev/null +++ b/directories/bin/sway/sway-clipboard-history-select @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if ! (clipman pick --tool="wofi" --max-items=30); then + sway-notify "Clipboard History Is Empty" + exit 1 +else + exit 0 +fi diff --git a/directories/bin/sway/sway-display-swap b/directories/bin/sway/sway-display-swap new file mode 100755 index 00000000..54e41826 --- /dev/null +++ b/directories/bin/sway/sway-display-swap @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + +DISPLAY_CONFIG=($(swaymsg -t get_outputs | jq -r '.[]|"\(.name):\(.current_workspace)"')) + +for ROW in "${DISPLAY_CONFIG[@]}" +do + IFS=':' + read -ra CONFIG <<< "${ROW}" + if [ "${CONFIG[0]}" != "null" ] && [ "${CONFIG[1]}" != "null" ]; then + echo "moving ${CONFIG[1]} right..." + swaymsg -- workspace --no-auto-back-and-forth "${CONFIG[1]}" + swaymsg -- move workspace to output right + fi +done diff --git a/directories/bin/sway/sway-do-tool b/directories/bin/sway/sway-do-tool new file mode 100755 index 00000000..b9cdcdd9 --- /dev/null +++ b/directories/bin/sway/sway-do-tool @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + +# NB ths is currently lazy. It uses brute force, and i need to do some get_tree jq stuff instead to +# get the app_id/class instance instead. But.. it works. +id="$1" +script="$2" +[ -z "$id" ] && echo "usage: sway-do-tool id" && exit 1 +if swaymsg "[title=${id}] focus" &> /dev/null; then + : +else + if swaymsg "[class=${id}] focus" &> /dev/null; then + : + else + if swaymsg "[app_id=${id}] focus" &> /dev/null; then + : + else + if [ ! -z "$script" ]; then + eval "$script" & + else + exit 1 + fi + fi + fi +fi +exit 0 diff --git a/directories/bin/sway/sway-dpms b/directories/bin/sway/sway-dpms new file mode 100755 index 00000000..6823ee73 --- /dev/null +++ b/directories/bin/sway/sway-dpms @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +DPMS="${1:-on}" +DISP="${2:-*}" +currentDPMS="$(swaymsg -t get_outputs | jq -r '.[0]'.dpms)" +[ "$dpms" != "$currentDPMS" ] && swaymsg "output $DISP DPMS $DPMS" diff --git a/directories/bin/sway/sway-editor b/directories/bin/sway/sway-editor new file mode 100755 index 00000000..7e8e154f --- /dev/null +++ b/directories/bin/sway/sway-editor @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-do-tool "Emacs-general" || emacsclient -s "general" -n -c && sleep 1 && sway-do-tool "Emacs-general" diff --git a/directories/bin/sway/sway-email b/directories/bin/sway/sway-email new file mode 100755 index 00000000..deda3b89 --- /dev/null +++ b/directories/bin/sway/sway-email @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +MOZ_ENABLE_WAYLAND=1 firefox --name=wwwemail --new-window "https://www.gmail.com" & diff --git a/directories/bin/sway/sway-firefox b/directories/bin/sway/sway-firefox new file mode 100755 index 00000000..71583a6b --- /dev/null +++ b/directories/bin/sway/sway-firefox @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +MOZ_ENABLE_WAYLAND=1 firefox --new-window "$1" &>/dev/null & diff --git a/directories/bin/sway/sway-htop b/directories/bin/sway/sway-htop new file mode 100755 index 00000000..fe86651c --- /dev/null +++ b/directories/bin/sway/sway-htop @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +exec sway-oneterminal "Processes" btop diff --git a/directories/bin/sway/sway-idle b/directories/bin/sway/sway-idle new file mode 100755 index 00000000..7e869caa --- /dev/null +++ b/directories/bin/sway/sway-idle @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +pkill swayidle +exec swayidle -w \ + timeout 1 '' \ + resume 'sway-lock-utils unblank' \ + timeout 10 'pidof swaylock && sway-lock-utils blank' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_BLANK:-3600} 'sway-lock-utils blank' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_LOCK:-14400} 'sway-lock-utils lock' \ + resume 'sway-lock-utils unblank' \ + timeout ${SWAYIDLEHOOK_SUSPEND:-0} 'sway-lock-utils suspend' \ + resume 'sway-lock-utils unblank' \ + lock 'sway-lock-utils lock' \ + unlock 'sway-lock-utils unblank' \ + before-sleep 'sway-lock-utils lock' diff --git a/directories/bin/sway/sway-kanshi b/directories/bin/sway/sway-kanshi new file mode 100755 index 00000000..1da5c8bc --- /dev/null +++ b/directories/bin/sway/sway-kanshi @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +# pidof kanshi && echo "kanshi process $(pidof kanshi) already running. Exiting." && exit 0 +pkill kanshi +config="${HOME}/.config/kanshi/config-$(hostname)" +if [ -f "$config" ]; then + echo "kanshi -c $config" + kanshi -c "$config" +else + echo "kanshi default config" + kanshi +fi diff --git a/directories/bin/sway/sway-laptop-id b/directories/bin/sway/sway-laptop-id new file mode 100755 index 00000000..caeda98d --- /dev/null +++ b/directories/bin/sway/sway-laptop-id @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +id="${LAPTOP_ID:-'eDP-1'}" +id=$( swaymsg -t get_outputs | jq -r ".[] | select (.name == \"${id}\") | .name") +if [ -z "$id" ];then + id=$(swaymsg -t get_outputs | jq -r '.[-1].name') +fi +echo $id diff --git a/directories/bin/sway/sway-launcher b/directories/bin/sway/sway-launcher new file mode 100755 index 00000000..6b7f6fdd --- /dev/null +++ b/directories/bin/sway/sway-launcher @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-launcher-fzf diff --git a/directories/bin/sway/sway-launcher-fzf b/directories/bin/sway/sway-launcher-fzf new file mode 100755 index 00000000..f86bbe81 --- /dev/null +++ b/directories/bin/sway/sway-launcher-fzf @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +exec kitty --title "sway-launcher" -e bash -c "dmenu_path | fzf | xargs swaymsg exec" diff --git a/directories/bin/sway/sway-launcher-rofi b/directories/bin/sway/sway-launcher-rofi new file mode 100755 index 00000000..867cb883 --- /dev/null +++ b/directories/bin/sway/sway-launcher-rofi @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +exec rofi -combi-modi window,drun,ssh,run -show combi -show-icons diff --git a/directories/bin/sway/sway-launcher-ulauncher b/directories/bin/sway/sway-launcher-ulauncher new file mode 100755 index 00000000..69b34ba7 --- /dev/null +++ b/directories/bin/sway/sway-launcher-ulauncher @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if ! pgrep "ulauncher"; then + ulauncher +else + ulauncher-toggle +fi diff --git a/directories/bin/sway/sway-launcher-wofi b/directories/bin/sway/sway-launcher-wofi new file mode 100755 index 00000000..293282e9 --- /dev/null +++ b/directories/bin/sway/sway-launcher-wofi @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +exec dmenu_path | wofi --show drun,dmenu -i | xargs swaymsg exec -- diff --git a/directories/bin/sway/sway-lock b/directories/bin/sway/sway-lock new file mode 100755 index 00000000..ed44dde1 --- /dev/null +++ b/directories/bin/sway/sway-lock @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-lock-utils lock diff --git a/directories/bin/sway/sway-lock-utils b/directories/bin/sway/sway-lock-utils new file mode 100755 index 00000000..19556448 --- /dev/null +++ b/directories/bin/sway/sway-lock-utils @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +lock() { + pidof swaylock || swaylock -f -i ~/Pictures/LockScreen/current -s fill -c 000000 + sway-notify "unlocked" +} + +lock_gpg_clear() { + [ "$1" = gpg_clear ] && (echo RELOADAGENT | gpg-connect-agent &>/dev/null ) + lock +} + +case "$1" in + lock) + lock + ;; + lock_gpg_clear) + lock_gpg_clear + ;; + logout) + swaymsg exit + ;; + suspend) + systemctl suspend + ;; + hibernate) + systemctl hibernate + ;; + reboot) + systemctl reboot + ;; + shutdown) + systemctl poweroff + ;; + blank) + sway-dpms off + [ -f "${HOME}/.screen-blank.local" ] && . "${HOME}/.screen-blank.local" + ;; + unblank) + sway-dpms on + [ -f "${HOME}/.screen-unblank.local" ] && . "${HOME}/.screen-unblank.local" + ;; + *) + lock + ;; +esac + +exit 0 diff --git a/directories/bin/sway/sway-make-wayland b/directories/bin/sway/sway-make-wayland new file mode 100755 index 00000000..d1f126ef --- /dev/null +++ b/directories/bin/sway/sway-make-wayland @@ -0,0 +1,25 @@ +mkdir -p ${HOME}/development/projects/wayland/clones +export WLD=${HOME}/development/projects/wayland +export LD_LIBRARY_PATH=$WLD/lib +export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/ +export PATH=$WLD/bin:$PATH + +cd ${HOME}/development/projects/wayland/clones + +git clone https://gitlab.freedesktop.org/wayland/wayland.git +cd wayland +meson build/ --prefix=$WLD +ninja -C build/ install +cd .. + +git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git +cd wayland-protocols +meson build/ --prefix=$WLD +ninja -C build/ install +cd .. + +git clone https://gitlab.freedesktop.org/wayland/weston.git +cd weston +meson build/ --prefix=$WLD -Dbackend-wayland=true -Dcolor-management-colord=false -Dremoting=false +ninja -C build/ install +cd .. diff --git a/directories/bin/sway/sway-notify b/directories/bin/sway/sway-notify new file mode 100755 index 00000000..3ad437a7 --- /dev/null +++ b/directories/bin/sway/sway-notify @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +notify-send -t ${2:-5000} "${1}" || true diff --git a/directories/bin/sway/sway-nvidia b/directories/bin/sway/sway-nvidia new file mode 100755 index 00000000..1027b711 --- /dev/null +++ b/directories/bin/sway/sway-nvidia @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway --my-next-gpu-wont-be-nvidia "$@" diff --git a/directories/bin/sway/sway-oneterminal b/directories/bin/sway/sway-oneterminal new file mode 100755 index 00000000..21d9cbbd --- /dev/null +++ b/directories/bin/sway/sway-oneterminal @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org + +sessionname="${1:-`pwd`}" +title="${ONETERM_TITLE:-${sessionname}}" +script="${2}" +if ! sway-do-tool "$title"; then + kitty --title "${title}" -e tmux new-session -A -s ${sessionname} ${script} & +else + if ! tmux has-session -t "${sessionname}"; then + tmux attach -t "${sessionname}" + fi +fi +exit 0 diff --git a/directories/bin/sway/sway-scratch-terminal b/directories/bin/sway/sway-scratch-terminal new file mode 100755 index 00000000..db5af771 --- /dev/null +++ b/directories/bin/sway/sway-scratch-terminal @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +swaymsg "[title=ScratchTerminal] scratchpad show " || (sway-notify "created new scratchpad terminal" && kitty --title "ScratchTerminal" -e tmux new-session -A -s ScratchTerminal) diff --git a/directories/bin/sway/sway-screen b/directories/bin/sway/sway-screen new file mode 100755 index 00000000..4cca4fd0 --- /dev/null +++ b/directories/bin/sway/sway-screen @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +m="${2:-$(swaymsg -t get_outputs | jq -r '.[0].name')}" +c="${1:-enable}" +[ "$c" = "disable" ] && [ "$(sway-active-monitors-count)" = "1" ] && sway-notify "Not turning off single display $m" && exit 1 +swaymsg "output ${m} ${c}" +(sleep 2 && sway-notify "${m}:${c}") & diff --git a/directories/bin/sway/sway-screen-menu b/directories/bin/sway/sway-screen-menu new file mode 100755 index 00000000..54de5163 --- /dev/null +++ b/directories/bin/sway/sway-screen-menu @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +m=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled") +if [ ! -z "$m" ]; then + c="$(zenity --list --title "Enable ${m}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)" + if [ ! -z "$c" ]; then + sway-screen $c $m + fi +fi +exit 0 diff --git a/directories/bin/sway/sway-screen-recorder b/directories/bin/sway/sway-screen-recorder new file mode 100755 index 00000000..dd925e46 --- /dev/null +++ b/directories/bin/sway/sway-screen-recorder @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if pgrep -x "wf-recorder"; then + sway-notify "stopping wf-recorder" + # sigint + kill -2 $(pgrep wf-recorder) +else + sway-notify "starting wf-recorder" + wf-recorder -f ${HOME}/tmp/output.mkv -g "$(slurp)" +fi diff --git a/directories/bin/sway/sway-screenshot b/directories/bin/sway/sway-screenshot new file mode 100755 index 00000000..7445c915 --- /dev/null +++ b/directories/bin/sway/sway-screenshot @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +# thanks to: https://www.reddit.com/r/linuxmasterrace/comments/k1bjkp/i_wrote_a_trivial_wrapper_for_taking_screenshots/ + +DIR=${HOME}/tmp/Screenshots + +mkdir -p "${DIR}" + +FILENAME="screenshot-$(date +%F-%T).png" +sway-notify "use the mouse to select region.." +region="$(slurp)" +if [ ! -z "$region" ]; then + sway-notify "Taking pic in 5s.." + sleep 5 + grim -g "$region" "${DIR}"/"${FILENAME}" || exit 1 + #Create a link, so don't have to search for the newest + ln -sf "${DIR}"/"${FILENAME}" "${DIR}"/screenshot-latest.png + sway-notify "Done! see ${DIR}/screenshot-latest.png" +fi diff --git a/directories/bin/sway/sway-volume-notify b/directories/bin/sway/sway-volume-notify new file mode 100755 index 00000000..2c16a404 --- /dev/null +++ b/directories/bin/sway/sway-volume-notify @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if [[ "$1" = "0" ]]; then + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +elif [[ "$1" = "+" ]]; then + wpctl set-volume @DEFAULT_AUDIO_SINK@ "0.1+" +elif [[ "$1" = "-" ]]; then + wpctl set-volume @DEFAULT_AUDIO_SINK@ "0.1-" +fi + + +volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) +volumep=$(echo $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | tr -dc '0-9')| sed 's/^0*//') +if [[ -z $volumep ]]; then + volumep="0" +elif [[ $volumep -gt "150" ]];then + volumep="150" + wpctl set-volume @DEFAULT_AUDIO_SINK@ 1 +fi +if [[ "$volume" == *"MUTED"* ]]; then + sway-notify "πŸ”Š MUTED (${volumep}%) " +else + sway-notify "πŸ”Š${volumep}%" +fi diff --git a/directories/bin/sway/sway-weather b/directories/bin/sway/sway-weather new file mode 100755 index 00000000..8ffa20d4 --- /dev/null +++ b/directories/bin/sway/sway-weather @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-www "https://www.accuweather.com/en/de/gr%C3%B6mitz/23743/hourly-weather-forecast/176248" diff --git a/directories/bin/sway/sway-wifi b/directories/bin/sway/sway-wifi new file mode 100755 index 00000000..349b75d2 --- /dev/null +++ b/directories/bin/sway/sway-wifi @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-oneterminal "wifi" "nmtui" &>/dev/null diff --git a/directories/bin/sway/sway-workspace-populate b/directories/bin/sway/sway-workspace-populate new file mode 100755 index 00000000..0252b47c --- /dev/null +++ b/directories/bin/sway/sway-workspace-populate @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +swaymsg "workspace 8; layout stacking;sleep 0.3;" +sway-www "https://web.whatsapp.com/" +sway-www "https://web.telegram.org/k/" +sway-www "https://reddit.com/" +sway-www "https://mail.google.com/mail/u/0/#inbox" +sleep 0.3 diff --git a/directories/bin/sway/sway-workspace-populate-conditional b/directories/bin/sway/sway-workspace-populate-conditional new file mode 100755 index 00000000..74efd396 --- /dev/null +++ b/directories/bin/sway/sway-workspace-populate-conditional @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if [ -f "${HOME}/.sway-workspace-populate" ]; then + sway-workspace-populate +elif [ -f "${HOME}/.sway-workspace-populate-user" ]; then + source "${HOME}/.sway-workspace-populate-user" +# else +# emacsclient -c -a "" & +fi diff --git a/directories/bin/sway/sway-workspace-position b/directories/bin/sway/sway-workspace-position new file mode 100755 index 00000000..90859ec4 --- /dev/null +++ b/directories/bin/sway/sway-workspace-position @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +mapfile -t outputs < <( sway-active-monitor-ids ) +export leftOutput=${outputs[0]} +export rightOutput=${outputs[1]} +export rightMostOutput=${outputs[2]} + +rightOutput=${rightOutput:-${leftOutput}} +rightMostOutput=${rightMostOutput:-${rightOutput}} + +sway-notify "Left:${leftOutput}, Right:${rightOutput}, Rightmost: ${rightMostOutput}" +curr=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .name') + +# swaymsg "output * bg ~/Pictures/Wallpapers/current fill" +swaybg -o $leftOutput -i ${HOME}/Pictures/Wallpapers/s1 -m fill & + +if [ "$leftOutput" != "$rightOutput" ]; then + swaybg -o ${rightOutput} -i ${HOME}/Pictures/Wallpapers/s2 -m fill & + if [ "$rightOutput" != "${rightMostOutput}" ]; then + swaybg -o ${rightMostOutput} -i ${HOME}/Pictures/Wallpapers/s3 -m fill & + fi +fi + +swaymsg " + workspace 1; move workspace to output $leftOutput; + workspace 2; move workspace to output $rightOutput; + workspace 3; move workspace to output $leftOutput; + workspace 4; move workspace to output $rightOutput; + workspace 5; move workspace to output $rightOutput; + workspace 6; move workspace to output $rightMostOutput; + workspace 7; move workspace to output $rightMostOutput; + workspace 8; move workspace to output $rightMostOutput; + workspace $curr; + " diff --git a/directories/bin/sway/sway-www b/directories/bin/sway/sway-www new file mode 100755 index 00000000..8bdaebc9 --- /dev/null +++ b/directories/bin/sway/sway-www @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sway-firefox "$@" & diff --git a/directories/bin/sway/waybar-bluetooth b/directories/bin/sway/waybar-bluetooth new file mode 100755 index 00000000..4462e2de --- /dev/null +++ b/directories/bin/sway/waybar-bluetooth @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org + +get_from_file() { + dev=$1 + name= + if [ ! -f /tmp/bt-devices.txt ]; then + touch /tmp/bt-devices.txt + echo "" + return + fi + for i in `cat /tmp/bt-devices.txt`; do + d=`echo $i | awk -F:: '{print $1}'` + if [ $d = $dev ]; then + name=`echo $i | awk -F:: '{print $2}'` + fi + done + echo "${name}" +} + +store_file() { + dev=$1 + name="${2}" + echo "$dev::${name}" >> /tmp/bt-devices.txt +} + +connections=`hcitool con | sed -n 2p` +if [ ! -z "$connections" ]; then + # We have a connection, we want to get the name from a file if we've had + # it from there before because getting the name of the device connected + # is very slow and costly. + dev=`echo $connections | awk '{print $3}'` + name=`get_from_file $dev` + if [ -z "$name" ]; then + name=`hcitool name $dev | awk '{print $1}'` + if [ ! -z "${name}" ]; then + store_file $dev "${name}" + fi + fi + echo "πŸ’‘$name" +else + echo "πŸ”Œ" +fi diff --git a/directories/bin/sway/waybar-dropbox-json b/directories/bin/sway/waybar-dropbox-json new file mode 100755 index 00000000..235cad78 --- /dev/null +++ b/directories/bin/sway/waybar-dropbox-json @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if ( ! dropbox running ); then + fullstat="$(dropbox status)" + stat="$(sed -n 1p <<< $fullstat)" +else + fullstat="" + if [ -f "${HOME}/.RESTART_DROPBOX" ];then + stat="Restarting Dropbox.." + sway-notify "$stat" + dropbox start &> /dev/null + else + stat="click to restart DB" + fi +fi + +jq --unbuffered --compact-output -n \ + --arg text "$stat" \ + --arg tooltip "$fullstat" \ + --arg class "dropbox-status" \ + '{text: $text, tooltip: $tooltip, class: $class}' diff --git a/directories/bin/sway/waybar-dropbox-status b/directories/bin/sway/waybar-dropbox-status new file mode 100755 index 00000000..39d210b1 --- /dev/null +++ b/directories/bin/sway/waybar-dropbox-status @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if pidof dropbox &> /dev/null ; then + stat=$(dropbox status | sed -n 1p) + echo "${stat}"; echo ""; +else + if command -v dropbox > /dev/null; then + echo "⇄Restarting Dropbox.." + dropbox start &> /dev/null & + fi +fi diff --git a/directories/bin/sway/waybar-ip-info-json b/directories/bin/sway/waybar-ip-info-json new file mode 100755 index 00000000..c377f3a9 --- /dev/null +++ b/directories/bin/sway/waybar-ip-info-json @@ -0,0 +1,18 @@ +ifname="${1:-$(printf '%s' /sys/class/net/*/wireless | cut -d/ -f5)}" +[ -z "$ifname" ] && exit 1 +pubip="$(curl -s -m 1 ipinfo.io/ip)" +pubip="$([ -z "$pubip" ] && echo "Offline" || echo "$pubip")" +lip=$(ip -j address | jq -r '.[] | select (.ifname=='\"$ifname\"').addr_info[] | select(.family=="inet").local') +lip="$([ -z "$lip" ] && echo -n "Offline" || echo -n "$lip")" +ssid="$(/sbin/iwconfig $ifname | grep 'ESSID:' | awk '{print $4}' | sed 's/ESSID://g' | sed 's/"//g')" +jq --unbuffered --compact-output -n \ + --arg text "πŸ“Ά $ssid" \ + --arg alt "$ifname:🌎$pubip,πŸ”Œ$lip" \ + --arg tooltip "$ifname:🌎$pubip,πŸ”Œ$lip" \ + --arg class "" \ + --arg percentage "1" \ + --arg ifname "$ifname" \ + --arg ssid "$ssid" \ + --arg public_ip "$pubip" \ + --arg ippadr "$lip" \ + '{text: $text, alt: $alt, tooltip: $tooltip, class: $class, percentage: $percentage, ifname: $ifname, ssid: $ssid, public_ip: $public_ip, ipaddr: $ippadr}' diff --git a/directories/bin/sway/waybar-monitors b/directories/bin/sway/waybar-monitors new file mode 100755 index 00000000..f10ce3d7 --- /dev/null +++ b/directories/bin/sway/waybar-monitors @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') +o=$(swaymsg -t get_outputs | jq -r '. | map(.name) | join(",")') +t="" +for i in `seq $l`; do t="${t} βƒ’ ";done +text="{\"text\":\""$t"\",\"tooltip\":\""$o"\"}" +echo $text diff --git a/directories/bin/sway/waybar-network-applet b/directories/bin/sway/waybar-network-applet new file mode 100755 index 00000000..10a755fa --- /dev/null +++ b/directories/bin/sway/waybar-network-applet @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +if command -v iwgtk 2>&1 >/dev/null +then + pgrep iwgtk || iwgtk -i & +else + pgrep nm-applet || nm-applet & +fi diff --git a/directories/bin/sway/waybar-power-draw b/directories/bin/sway/waybar-power-draw new file mode 100755 index 00000000..467733b1 --- /dev/null +++ b/directories/bin/sway/waybar-power-draw @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +awk '{print $1*10^-6 "W "}' /sys/class/power_supply/BAT0/power_now diff --git a/directories/bin/sway/waybar-weather-json b/directories/bin/sway/waybar-weather-json new file mode 100755 index 00000000..fa755642 --- /dev/null +++ b/directories/bin/sway/waybar-weather-json @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +sleep 5 +WTTR_LOCATION="${1:-"GrΓΆmitz,DE"}" waybar-wttr diff --git a/directories/bin/sway/waybar-wttr b/directories/bin/sway/waybar-wttr new file mode 100755 index 00000000..9c896cdf --- /dev/null +++ b/directories/bin/sway/waybar-wttr @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# Maintained in linux-config.org + +import json +import requests +from datetime import datetime + +WEATHER_CODES = { + '113': 'β˜€οΈ', + '116': '⛅️', + '119': '☁️', + '122': '☁️', + '143': '🌫', + '176': '🌦', + '179': '🌧', + '182': '🌧', + '185': '🌧', + '200': 'β›ˆ', + '227': '🌨', + '230': '❄️', + '248': '🌫', + '260': '🌫', + '263': '🌦', + '266': '🌦', + '281': '🌧', + '284': '🌧', + '293': '🌦', + '296': '🌦', + '299': '🌧', + '302': '🌧', + '305': '🌧', + '308': '🌧', + '311': '🌧', + '314': '🌧', + '317': '🌧', + '320': '🌨', + '323': '🌨', + '326': '🌨', + '329': '❄️', + '332': '❄️', + '335': '❄️', + '338': '❄️', + '350': '🌧', + '353': '🌦', + '356': '🌧', + '359': '🌧', + '362': '🌧', + '365': '🌧', + '368': '🌨', + '371': '❄️', + '374': '🌧', + '377': '🌧', + '386': 'β›ˆ', + '389': '🌩', + '392': 'β›ˆ', + '395': '❄️' +} + +data = {} + + +weather = requests.get("https://wttr.in/?format=j1").json() + + +def format_time(time): + return time.replace("00", "").zfill(2) + + +def format_temp(temp): + return (hour['FeelsLikeC']+"Β°").ljust(3) + + +def format_chances(hour): + chances = { + "chanceoffog": "Fog", + "chanceoffrost": "Frost", + "chanceofovercast": "Overcast", + "chanceofrain": "Rain", + "chanceofsnow": "Snow", + "chanceofsunshine": "Sunshine", + "chanceofthunder": "Thunder", + "chanceofwindy": "Wind" + } + + conditions = [] + for event in chances.keys(): + if int(hour[event]) > 0: + conditions.append(chances[event]+" "+hour[event]+"%") + return ", ".join(conditions) + + +data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ + " "+weather['current_condition'][0]['FeelsLikeC']+"Β°" + +data['tooltip'] = f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}Β°\n" +data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}Β°\n" +data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" +data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" +for i, day in enumerate(weather['weather']): + data['tooltip'] += f"\n" + if i == 0: + data['tooltip'] += "Today, " + if i == 1: + data['tooltip'] += "Tomorrow, " + data['tooltip'] += f"{day['date']}\n" + data['tooltip'] += f"⬆️ {day['maxtempC']}Β° ⬇️ {day['mintempC']}Β° " + data['tooltip'] += f"πŸŒ… {day['astronomy'][0]['sunrise']} πŸŒ‡ {day['astronomy'][0]['sunset']}\n" + for hour in day['hourly']: + if i == 0: + if int(format_time(hour['time'])) < datetime.now().hour-2: + continue + data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" + + +print(json.dumps(data)) diff --git a/directories/bin/syncrclone-gdrive b/directories/bin/syncrclone-gdrive new file mode 100755 index 00000000..e4736a25 --- /dev/null +++ b/directories/bin/syncrclone-gdrive @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +syncrclone "$HOME"/.syncrclone/gdrive-config.py diff --git a/directories/bin/syncrclone-gdrive-docs b/directories/bin/syncrclone-gdrive-docs new file mode 100755 index 00000000..8ecbe748 --- /dev/null +++ b/directories/bin/syncrclone-gdrive-docs @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +syncrclone "$HOME"/.syncrclone/gdrive-docs-config.py diff --git a/directories/bin/syncrclone-htop b/directories/bin/syncrclone-htop new file mode 100755 index 00000000..c557e731 --- /dev/null +++ b/directories/bin/syncrclone-htop @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +htop -F "syncrclone" diff --git a/directories/bin/syncrclone-once b/directories/bin/syncrclone-once new file mode 100755 index 00000000..33a170c8 --- /dev/null +++ b/directories/bin/syncrclone-once @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +if ! network-online; then + echo "offline" + exit 1 +fi +if pgrep -x "rclone" > /dev/null; then + echo "syncrclone already running" + exit 1 +else + if [[ -z $SYNC_CRON ]]; then + syncrclone | mail -s "syncrclone manual : $(date)" $USER + else + syncrclone + fi + exit 0 +fi diff --git a/directories/bin/tmux-current-session b/directories/bin/tmux-current-session new file mode 100755 index 00000000..6771f2b7 --- /dev/null +++ b/directories/bin/tmux-current-session @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +echo "$(tmux list-panes -t "$TMUX_PANE" -F '#S' | head -n1)" diff --git a/directories/bin/tmux-pane-tty b/directories/bin/tmux-pane-tty new file mode 100755 index 00000000..37ac7632 --- /dev/null +++ b/directories/bin/tmux-pane-tty @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +session="${1:-""}" +[ -z ${session} ] && exit 1 +pane_index="${2:-0}" +window="${3:-0}" +tmux list-panes -t "${session}:${window}" -F 'pane_index:#{pane_index} #{pane_tty}' | awk '/pane_index:'"${pane_index}"'/ {print $2 }' diff --git a/directories/bin/upd b/directories/bin/upd new file mode 100755 index 00000000..b92367d4 --- /dev/null +++ b/directories/bin/upd @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Maintained in linux-config.org +string="$(uname -r)" +if [[ $string == *"arch"* ]]; then + sudo pacman -Syu +else + export DEBIAN_FRONTEND=noninteractive + sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y +fi diff --git a/directories/bin/wifi-toggle b/directories/bin/wifi-toggle new file mode 100755 index 00000000..cc8c6e49 --- /dev/null +++ b/directories/bin/wifi-toggle @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +#Maintained in linux-config.org +status="$(nmcli radio wifi)" +if [ "$status" = "enabled" ]; then + nmcli radio wifi off + echo "Wifi Off" +else + nmcli radio wifi on + echo "Wifi On" +fi diff --git a/directories/development/projects/javascript/scratchpad/execjs.html b/directories/development/projects/javascript/scratchpad/execjs.html new file mode 100644 index 00000000..7e745458 --- /dev/null +++ b/directories/development/projects/javascript/scratchpad/execjs.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/dot-config/alacritty/alacritty.toml b/dot-config/alacritty/alacritty.toml new file mode 100644 index 00000000..4fa07a35 --- /dev/null +++ b/dot-config/alacritty/alacritty.toml @@ -0,0 +1,5 @@ +[font] +size = 10.0 + +[window] +decorations = "none" diff --git a/dot-config/alacritty/alacritty.yml b/dot-config/alacritty/alacritty.yml new file mode 100644 index 00000000..7b3ca9c3 --- /dev/null +++ b/dot-config/alacritty/alacritty.yml @@ -0,0 +1,913 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty itself. +#env: + # TERM variable + # + # This value is used to set the `$TERM` environment variable for + # each instance of Alacritty. If it is not present, alacritty will + # check the local terminfo database and use `alacritty` if it is + # available, otherwise `xterm-256color` is used. + #TERM: alacritty + +window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + #dimensions: + # columns: 0 + # lines: 0 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + #padding: + # x: 0 + # y: 0 + + # Spread additional padding evenly around the terminal content. + #dynamic_padding: false + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background and no title bar buttons + decorations: none + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + #opacity: 1.0 + + # Startup Mode (changes require restart) + # + # Values for `startup_mode`: + # - Windowed + # - Maximized + # - Fullscreen + # + # Values for `startup_mode` (macOS only): + # - SimpleFullscreen + #startup_mode: Windowed + + # Window title + #title: Alacritty + + # Allow terminal applications to change Alacritty's window title. + #dynamic_title: true + + # Window class (Linux/BSD only): + #class: + # Application instance name + #instance: Alacritty + # General application class + #general: Alacritty + + # Decorations theme variant + # + # Override the variant of the System theme/GTK theme/Wayland client side + # decorations. Commonly supported values are `Dark`, `Light`, and `None` for + # auto pick-up. Set this to `None` to use the default theme variant. + #decorations_theme_variant: None + + # Resize increments + # + # Prefer resizing window by discrete steps equal to cell dimensions. + #resize_increments: false + + # Make `Option` key behave as `Alt` (macOS only): + # - OnlyLeft + # - OnlyRight + # - Both + # - None (default) + #option_as_alt: None + +#scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + #history: 10000 + + # Scrolling distance multiplier. + #multiplier: 3 + +# Font configuration +font: + # Point size + size: 10.0 + # Normal (roman) font face + #normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + #family: monospace + + # The `style` can be specified to pick a specific face. + #style: Regular + + # Bold font face + #bold: + # Font family + # + # If the bold family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + #style: Bold + + # Italic font face + #italic: + # Font family + # + # If the italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + #style: Italic + + # Bold italic font face + #bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: monospace + + # The `style` can be specified to pick a specific face. + #style: Bold Italic + + # Point size + #size: 11.0 + + # Offset is the extra space around each character. `offset.y` can be thought + # of as modifying the line spacing, and `offset.x` as modifying the letter + # spacing. + #offset: + # x: 0 + # y: 0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + #glyph_offset: + # x: 0 + # y: 0 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + #builtin_box_drawing: true + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +#colors: + # Default colors + #primary: + # background: '#1d1f21' + # foreground: '#c5c8c6' + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not + # present. If the bright foreground color is not set, or + # `draw_bold_text_with_bright_colors` is `false`, the normal foreground + # color will be used. + #dim_foreground: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #cursor: + # text: CellBackground + # cursor: CellForeground + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #vi_mode_cursor: + # text: CellBackground + # cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + #search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #matches: + # foreground: '#000000' + # background: '#ffffff' + #focused_match: + # foreground: '#ffffff' + # background: '#000000' + + # Keyboard hints + #hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #start: + # foreground: '#1d1f21' + # background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #end: + # foreground: '#e9ff5e' + # background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + #footer_bar: + # background: '#c5c8c6' + # foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #selection: + # text: CellBackground + # background: CellForeground + + # Normal colors + #normal: + # black: '#1d1f21' + # red: '#cc6666' + # green: '#b5bd68' + # yellow: '#f0c674' + # blue: '#81a2be' + # magenta: '#b294bb' + # cyan: '#8abeb7' + # white: '#c5c8c6' + + # Bright colors + #bright: + # black: '#666666' + # red: '#d54e53' + # green: '#b9ca4a' + # yellow: '#e7c547' + # blue: '#7aa6da' + # magenta: '#c397d8' + # cyan: '#70c0b1' + # white: '#eaeaea' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '#131415' + # red: '#864343' + # green: '#777c44' + # yellow: '#9e824c' + # blue: '#556a7d' + # magenta: '#75617b' + # cyan: '#5b7d78' + # white: '#828482' + + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + #duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +#selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + #semantic_escape_chars: ",β”‚`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + #save_to_clipboard: false + +#cursor: + # Cursor style + #style: + # Cursor shape + # + # Values for `shape`: + # - β–‡ Block + # - _ Underline + # - | Beam + #shape: Block + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + #blinking: Off + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + #vi_mode_style: None + + # Cursor blinking interval in milliseconds. + #blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + #blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + #unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + #thickness: 0.15 + +# Live config reload (changes require restart) +#live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/zsh +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Offer IPC using `alacritty msg` (unix only) +#ipc_socket: true + +#mouse: + # Click settings + # + # The `double_click` and `triple_click` settings control the time + # alacritty should wait for accepting multiple clicks as one double + # or triple click. + #double_click: { threshold: 300 } + #triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + #hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +#hints: + # Keys used for the hint labels. + #alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + #enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # hyperlinks: true + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +#mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } +# - { mouse: Middle, mode: ~Vi, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - ToggleMaximized +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +#key_bindings: + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: CreateNewWindow } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Renderer override. + # - glsl3 + # - gles2 + # - gles2_pure + #renderer: None + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false diff --git a/dot-config/i3blocks/config b/dot-config/i3blocks/config new file mode 100644 index 00000000..c50d0d9c --- /dev/null +++ b/dot-config/i3blocks/config @@ -0,0 +1,74 @@ +[dropbox] +interval=15 +command=my-i3b-db-status +color=#ffd700 + +[kernel] +label=🐧 +command=my-i3b-kernel +interval=once +color=#ffffff + +[uptime] + +command=my-i3b-uptime +interval=60 + +[cpu_usage] +markup=pango +command=my-i3b-cpu +interval=1 + +[temperature] +label=🌑 +command=my-i3b-temperature +interval=60 + +[battery] +markup=pango +command=my-i3b-battery-status +interval=60 + +# [power_draw] +# label=⚑ +# command=echo "$(awk '{print $1*10^-6 " W"}' /sys/class/power_supply/BAT0/power_now)" +# interval=5 +# color=#00ff00 + +[weather] +markup=pango +command=my-i3b-weather +interval=300 + +# [weather] +# command=curl -s 'wttr.in/{GrΓΆmitz}?format=%l:+%c+%t' +# interval=900 +# color=#A4C2F4 + +[brightness] +command=my-i3b-brightness +interval=2 + +[monitors] +command=my-i3b-monitors +interval=5 + +[volume] +markup=pango +command=my-i3b-volume +interval=2 +color=#FFD700 + +[bluetooth] +command=my-i3b-bluetooth +interval=60 +color=#4d4dff + +[wifi] +markup=pango +command=my-i3b-wifi +interval=60 + +[time] +command=my-i3b-date-cal +interval=60 diff --git a/dot-config/i3status/config b/dot-config/i3status/config new file mode 100644 index 00000000..19b79498 --- /dev/null +++ b/dot-config/i3status/config @@ -0,0 +1,54 @@ +# Maintained in linux-init-files.org +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { +colors = true +interval = 5 +} + +order += "wireless _first_" +# order += "ipv6" +# order += "ethernet _first_" +order += "battery all" +order += "disk /" +order += "load" +order += "memory" +order += "tztime local" + +wireless _first_ { +format_up = "WiFi:(%essid)%ip" +format_down = "WiFi: down" +} + +ethernet _first_ { +format_up = "E: %ip (%speed)" +format_down = "E: down" +} + +battery all { +format = "%status %percentage %remaining" +} + +disk "/" { +format = "%avail" +} + +load { +format = "%1min" +} + +memory { +format = "%used | %available" +threshold_degraded = "1G" +format_degraded = "MEMORY < %available" +} + +tztime local { +format = "%Y-%m-%d %H:%M:%S" +} diff --git a/dot-config/kanshi/config b/dot-config/kanshi/config new file mode 100755 index 00000000..6f56da8d --- /dev/null +++ b/dot-config/kanshi/config @@ -0,0 +1,3 @@ +profile { +output eDP-1 enable position 0,0 +} diff --git a/dot-config/kanshi/config-t14s b/dot-config/kanshi/config-t14s new file mode 100755 index 00000000..64b04052 --- /dev/null +++ b/dot-config/kanshi/config-t14s @@ -0,0 +1,14 @@ +profile home-dp{ +output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 +output 'Synaptics Inc Non-PnP 0x00BC614E' mode 1920x1080 position 2560,0 +output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080 +} +profile home-hdmi{ +output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 +output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0 +output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080 +} +profile home-no-lap{ +output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0 +output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0 +} diff --git a/dot-config/kanshi/config-thinkpadt460 b/dot-config/kanshi/config-thinkpadt460 new file mode 100755 index 00000000..fa5d669e --- /dev/null +++ b/dot-config/kanshi/config-thinkpadt460 @@ -0,0 +1,8 @@ +profile { +output eDP-1 enable mode 1366Γ—768 position 0,0 +} + +profile { +output eDP-1 enable mode 1366Γ—768 position 1920,0 +output DP-4 enable mode 1920x1080 position 0,0 +} diff --git a/dot-config/kanshi/config-um690 b/dot-config/kanshi/config-um690 new file mode 100755 index 00000000..311dab47 --- /dev/null +++ b/dot-config/kanshi/config-um690 @@ -0,0 +1,4 @@ +{ +output HDMI-A-1 enable mode 2560x1440 position 0,0 +output HDMI-A-2 enable mode 1920x1080 position 2560,116 +} diff --git a/dot-config/kanshi/config-x13amdg4 b/dot-config/kanshi/config-x13amdg4 new file mode 100755 index 00000000..3d8d618c --- /dev/null +++ b/dot-config/kanshi/config-x13amdg4 @@ -0,0 +1,3 @@ +profile { +output eDP-1 enable mode 1920x1200 position 0,0 +} diff --git a/dot-config/kanshi/config-x1c6 b/dot-config/kanshi/config-x1c6 new file mode 100755 index 00000000..e27f5470 --- /dev/null +++ b/dot-config/kanshi/config-x1c6 @@ -0,0 +1,13 @@ +profile { +output eDP-1 enable mode 1920x1080 position 0,0 +} + +profile { +output eDP-1 disable +output DP-1 enable mode 2560x1440 position 0,0 +} + +profile { +output eDP-1 disable +output HDMI-A-1 enable mode 2560x1440 position 0,0 +} diff --git a/dot-config/kanshi/config-x270 b/dot-config/kanshi/config-x270 new file mode 100755 index 00000000..223b0e0a --- /dev/null +++ b/dot-config/kanshi/config-x270 @@ -0,0 +1,8 @@ +{ +output eDP-1 enable mode 1920x1080 position 0,0 +} + +{ +output eDP-1 disable +output HDMI-A-2 enable mode 2560x1440 position 0,0 +} diff --git a/dot-config/kanshi/config-xmgneo b/dot-config/kanshi/config-xmgneo new file mode 100755 index 00000000..c094a17f --- /dev/null +++ b/dot-config/kanshi/config-xmgneo @@ -0,0 +1,13 @@ +{ +output eDP-1 enable enable mode 2560x1440 position 0,0 +} + +{ +output eDP-1 enable mode 2560x1440 position 2560,0 +output HDMI-A-1 enable mode 2560x1440 position 0,0 +} + +{ +output eDP-1 enable mode 2560x1440 position 2560,0 +output DP-1 enable mode 2560x1440 position 0,0 +} diff --git a/dot-config/mako/config b/dot-config/mako/config new file mode 100644 index 00000000..e1b7c1f8 --- /dev/null +++ b/dot-config/mako/config @@ -0,0 +1 @@ +default-timeout=10000 diff --git a/dot-config/polybar/config b/dot-config/polybar/config new file mode 100644 index 00000000..5bdf9891 --- /dev/null +++ b/dot-config/polybar/config @@ -0,0 +1,409 @@ +[colors] +;background = ${xrdb:color0:#222} +background = #222 +background-alt = #444 +;foreground = ${xrdb:color7:#222} +foreground = #dfdfdf +foreground-alt = #555 +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +[bar/example] +;monitor = ${env:MONITOR:HDMI-1} +width = 100% +height = 27 +;offset-x = 1% +;offset-y = 1% +radius = 6.0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = #f00 + +border-size = 4 +border-color = #00000000 + +padding-left = 0 +padding-right = 2 + +module-margin-left = 1 +module-margin-right = 2 + +font-0 = fixed:pixelsize=10;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = siji:pixelsize=10;1 + +modules-left = bspwm i3 +modules-center = mpd +modules-right = filesystem backlight-acpi alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu + +tray-position = right +tray-padding = 2 +;tray-background = #0063ff + +;wm-restack = bspwm +;wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +[module/xwindow] +type = internal/xwindow +label = %title:0:30:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = "ξ‰― " +format-prefix-foreground = ${colors.foreground-alt} +format-prefix-underline = ${colors.secondary} + +label-layout = %layout% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm + +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +; Separator in between workspaces +; label-separator = | + +[module/i3] +type = internal/i3 +format = +index-sort = true +wrapping-scroll = false + +; Only show workspaces on the same output as the bar +;pin-workspaces = true + +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +; unfocused = Inactive workspace on any monitor +label-unfocused = %index% +label-unfocused-padding = 2 + +; visible = Active workspace on unfocused monitor +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %index% +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +; Separator in between workspaces +; label-separator = | + + +[module/mpd] +type = internal/mpd +format-online = + +icon-prev = ξ‚– +icon-stop = ξ‚™ +icon-play = ξ‚š +icon-pause = ξ‚› +icon-next = ξ‚œ + +label-song-maxlen = 25 +label-song-ellipsis = true + +[module/xbacklight] +type = internal/xbacklight + +format =