{"id":13495937,"url":"https://github.com/rileyrg/linux-init","last_synced_at":"2025-04-10T02:41:03.136Z","repository":{"id":138319496,"uuid":"287632021","full_name":"rileyrg/linux-init","owner":"rileyrg","description":"Emacs org-file based suite of Linux config files and scripts","archived":false,"fork":false,"pushed_at":"2025-03-25T06:59:18.000Z","size":410,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T07:35:16.419Z","etag":null,"topics":["configuration","debian-linux","dotfiles-linux","emacs-configuration","org","org-babel","startx","xsession","xsessionrc"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rileyrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-14T22:01:08.000Z","updated_at":"2025-03-03T16:09:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"838b9430-cb0b-4235-82e9-50bd911d7f52","html_url":"https://github.com/rileyrg/linux-init","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rileyrg%2Flinux-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rileyrg%2Flinux-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rileyrg%2Flinux-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rileyrg%2Flinux-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rileyrg","download_url":"https://codeload.github.com/rileyrg/linux-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144895,"owners_count":21055005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","debian-linux","dotfiles-linux","emacs-configuration","org","org-babel","startx","xsession","xsessionrc"],"created_at":"2024-07-31T19:01:39.925Z","updated_at":"2025-04-10T02:41:03.119Z","avatar_url":"https://github.com/rileyrg.png","language":"Shell","readme":"\n\n# Introduction\n\n\n## Status\n\nWork in progress!!\nKeep most  config and scripts in a single org file for documentation. Use org tangling for exporting them.\n\n\n## GIT\n\n\n### ~/.config/git/config\n\nglobal git settings\nNB - NOT Exported as lots of things want to update it\n\n    [user]\n            name = rileyrg\n            email = rileyrg@gmx.de\n    [push]\n            default = current\n    [github]\n            user = rileyrg\n    [pull]\n            rebase = false\n\n\n### master branch, no commit\n\n    #!/bin/sh\n    branch=\"$(git rev-parse --abbrev-ref HEAD)\"\n    if [ \"$branch\" = \"master\" ]; then\n        echo \"You can't commit directly to master branch\"\n        exit 1\n    fi\n\n\n# Basic shell things\n\n\n## X/Sway common\n\n    ! Maintained in linux-config.org\n    ! Use a truetype font and size.\n    *.font: -*-JetBrainsMono Nerd Font-*-*-*-*-14-*-*-*-*-*-*\n    Xft.autohint: 0\n    Xft.antialias: 1\n    Xft.hinting: true\n    Xft.hintstyle: hintslight\n    Xft.dpi: 96\n    Xft.rgba: rgb\n    Xft.lcdfilter: lcddefault\n    \n    ! Fonts {{{\n    #ifdef SRVR_t460\n    Xft.dpi:       104\n    #endif\n    #ifdef SRVR_intelnuc\n    Xft.dpi:       108\n    #endif\n    #ifdef SRVR_x270\n    Xft.dpi:       96\n    #endif\n    #ifdef SRVR_t14s\n    Xft.dpi:       96\n    #endif\n    #ifdef SRVR_x1c6\n    Xft.dpi:       96\n    #endif\n    #ifdef SRVR_x13amdg4\n    Xft.dpi:       96\n    #endif\n    #ifdef SRVR_xmgneo\n    Xft.dpi:       188\n    #endif\n    ! }}}\n\n\n## Bash Startup Files\n\n\n### ~/.profile\n\n    # Maintained in linux-config.org\n    logger -t \"startup-initfile\"  PROFILE\n    \n    # ~/.profile: executed by the command interpreter for login shells.\n    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login\n    # exists.\n    # see /usr/share/doc/bash/examples/startup-files for examples.\n    # the files are located in the bash-doc package.\n    \n    # the default umask is set in /etc/profile; for setting the umask\n    # for ssh logins, install and configure the libpam-umask package.\n    #umask 022\n    \n    export DOT_PROFILE_SOURCED=1\n    \n    export PRINTER=\"Canon_TR8500_series\"\n    \n    export PROMPT_COMMAND='history -a'\n    \n    export ALTERNATE_EDITOR=\"\"\n    export EDITOR=\"emacsclient -t\"\n    export VISUAL=\"emacsclient -r\"\n    # export EAT_SHELL_INTEGRATION_DIR=\"$HOME/.emacs.d/straight/build/eat/integration\"\n    \n    \n    export HISTSIZE=2056\n    export HISTCONTROL=ignoreboth:erasedups\n    \n    # export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig\n    \n    export ARDUINO_SDK_PATH=\"${HOME}\"/cloud/homefiles/development/arduino/arduinoSDK\n    export CMAKE_EXPORT_COMPILE_COMMANDS=1\n    \n    export RIPGREP_CONFIG_PATH=\"${HOME}\"/.ripgreprc\n    \n    # OBS recording studio\n    # export QT_QPA_PLATFORM=wayland\n    export QT_QPA_PLATFORM=\"xcb\"\n    \n    #alias man=eman\n    \n    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}\"\n    \n    export SSH_AUTH_SOCK=\"$(gpgconf --list-dirs agent-ssh-socket)\"\n    export USE_GPG_FOR_SSH=\"yes\" # used in xsession\n    \n    if [ -z \"$XDG_CONFIG_HOME\" ]\n    then\n        export XDG_CONFIG_HOME=\"${HOME}/.config\"\n    fi\n    \n    # for sway waybar tray\n    export XDG_CURRENT_DESKTOP=sway\n    export XDG_SESSION_DESKTOP=sway\n    \n    export GRIM_DEFAULT_DIR=\"${HOME}/tmp\"\n    \n    systemctl start --user mbsync.timer\n    \n    #homebrew\n    test -d ~/.linuxbrew \u0026\u0026 eval \"$(~/.linuxbrew/bin/brew shellenv)\"\n\n\n### ~/.bash\\_profile\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    logger -t \"startup-initfile\"  BASH_PROFILE\n    [ -f ~/.profile ] \u0026\u0026 . ~/.profile || true\n    [ -f ~/.bashrc ] \u0026\u0026 . ~/.bashrc || true\n    #emacs --bg-daemon  \u0026\u003e /dev/null \u0026\n\n\n### ~/.bashrc\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    logger -t \"startup-initfile\"  BASHRC\n    # ~/.bashrc: executed by bash(1) for non-login shells.\n    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)\n    # for examples\n    \n    # If not running interactively, don't do anything\n    [ -z \"$PS1\" ] \u0026\u0026 return\n    \n    # check the window size after each command and, if necessary,\n    # update the values of LINES and COLUMNS.\n    shopt -s checkwinsize\n    \n    # set variable identifying the chroot you work in (used in the prompt below)\n    if [ -z \"$debian_chroot\" ] \u0026\u0026 [ -r /etc/debian_chroot ]; then\n        debian_chroot=$(cat /etc/debian_chroot)\n    fi\n    \n    # set a fancy prompt (non-color, unless we know we \"want\" color)\n    case \"$TERM\" in\n        dumb) color_prompt=no;;\n        xterm-256color) color_prompt=no;;\n        *) color_prompt=no\n           ;;\n    esac\n    \n    if [ -n \"$force_color_prompt\" ]; then\n        if [ -x /usr/bin/tput ] \u0026\u0026 tput setaf 1 \u003e\u0026/dev/null; then\n            # We have color support; assume it's compliant with Ecma-48\n            # (ISO/IEC-6429). (Lack of such support is extremely rare, and such\n            # a case would tend to support setf rather than setaf.)\n            color_prompt=yes\n        else\n            color_prompt=no\n        fi\n    fi\n    \n    if [ -f /etc/bash_completion ]; then\n        . /etc/bash_completion\n    fi\n    \n    stty -ixon\n    \n    GPG_TTY=$(tty)\n    export GPG_TTY\n    # Set up fzf key bindings and fuzzy completion\n    eval \"$(fzf --bash)\"\n\n1.  bash git prompt\n\n        if [ -f \"${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh\" ]; then\n            GIT_PROMPT_ONLY_IN_REPO=1\n            source \"${HOME}/bin/thirdparty/bash-git-prompt/gitprompt.sh\"\n        fi\n\n\n## ZSH Related\n\n\n### ~/.config/zsh/.zshrc\n\n    # Maintained in linux-config.org\n    logger -t \"startup-initfile\"  ZSHRC\n    [[ $TERM == \"dumb\" ]] \u0026\u0026 unsetopt zle \u0026\u0026 PS1='$ ' \u0026\u0026 return\n    export TERM=\"kitty\"\n    # Path to your oh-my-zsh installation.\n    export ZSH=\"${XDG_CONFIG_HOME}/zsh/oh-my-zsh\"\n    \n    if [ -n \"$SSH_CLIENT\" ] || [ -n \"$SSH_TTY\" ]; then\n        ZSH_TMUX_AUTOSTART=true\n    else\n        ZSH_TMUX_AUTOSTART=false\n    fi\n    \n    # ZSH_TMUX_\n    AUTOSTART_ONCE=true\n    ZSH_TMUX_AUTOCONNECT=true\n    ZSH_TMUX_AUTOQUIT=true\n    \n    # Set name of the theme to load --- if set to \"random\", it will\n    # load a random theme each time oh-my-zsh is loaded, in which case,\n    # to know which specific one was loaded, run: echo $RANDOM_THEME\n    # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes\n    \n    ZSH_THEME=robbyrussell\n    \n    # ZSH_THEME=\"agnoster\"\n    \n    # Set list of themes to pick from when loading at random\n    # Setting this variable when ZSH_THEME=random will cause zsh to load\n    # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/\n    # If set to an empty array, this variable will have no effect.\n    # ZSH_THEME_RANDOM_CANDIDATES=( \"robbyrussell\" \"agnoster\" )\n    \n    # Uncomment the following line to use case-sensitive completion.\n    # CASE_SENSITIVE=\"true\"\n    \n    # Uncomment the following line to use hyphen-insensitive completion.\n    # Case-sensitive completion must be off. _ and - will be interchangeable.\n    # HYPHEN_INSENSITIVE=\"true\"\n    \n    # Uncomment the following line to disable bi-weekly auto-update checks.\n    # DISABLE_AUTO_UPDATE=\"true\"\n    \n    # Uncomment the following line to change how often to auto-update (in days).\n    # export UPDATE_ZSH_DAYS=13\n    \n    # Uncomment the following line to disable colors in ls.\n    # DISABLE_LS_COLORS=\"true\"\n    \n    # Uncomment the following line to disable auto-setting terminal title.\n    # DISABLE_AUTO_TITLE=\"true\"\n    \n    # Uncomment the following line to enable command auto-correction.\n    # ENABLE_CORRECTION=\"true\"\n    \n    # Uncomment the following line to display red dots whilst waiting for completion.\n    # COMPLETION_WAITING_DOTS=\"true\"\n    \n    # Uncomment the following line if you want to disable marking untracked files\n    # under VCS as dirty. This makes repository status check for large repositories\n    # much, much faster.\n    DISABLE_UNTRACKED_FILES_DIRTY=\"true\"\n    \n    # Uncomment the following line if you want to change the command execution time\n    # stamp shown in the history command output.\n    # You can set one of the optional three formats:\n    # \"mm/dd/yyyy\"|\"dd.mm.yyyy\"|\"yyyy-mm-dd\"\n    # or set a custom format using the strftime function format specifications,\n    # see 'man strftime' for details.\n    # HIST_STAMPS=\"mm/dd/yyyy\"\n    \n    # Would you like to use another custom folder than $ZSH/custom?\n    # ZSH_CUSTOM=/path/to/new-custom-folder\n    \n    # Which plugins would you like to load?\n    # Standard plugins can be found in ~/.oh-my-zsh/plugins/*\n    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/\n    # Example format: plugins=(rails git textmate ruby lighthouse)\n    # Add wisely, as too many plugins slow down shell startup.\n    plugins=(\n        zsh-autosuggestions\n        dotenv\n        chucknorris\n        vi-mode\n        tmux\n        safe-paste\n        colored-man-pages\n        zsh-syntax-highlighting\n    )\n    export HISTFILE=${XDG_CONFIG_HOME}/zsh/.zsh_history_$HOST\n    \n    setopt EXTENDED_HISTORY\n    setopt SHARE_HISTORY\n    setopt HIST_IGNORE_SPACE\n    setopt HIST_FIND_NO_DUPS\n    setopt HIST_BEEP\n    \n    \n    source $ZSH/oh-my-zsh.sh\n    \n    # User configuration\n    setopt extended_glob\n    bindkey \"^[[5~\" history-beginning-search-backward\n    bindkey \"^[[6~\" history-beginning-search-forward\n    \n    # Set personal aliases, overriding those provided by oh-my-zsh libs,\n    # plugins, and themes. Aliases can be placed here, though oh-my-zsh\n    # users are encouraged to define aliases within the ZSH_CUSTOM folder.\n    # For a full list of active aliases, run `alias`.\n    #\n    # Example aliases\n    # alias zshconfig=\"mate ~/.zshrc\"\n    # alias ohmyzsh=\"mate ~/.oh-my-zsh\"\n    #\n    # GREP_OPTIONS=\"--color=never\"\n    POWERLEVEL9K_SHORTEN_DIR_LENGTH=1\n    # DEFAULT_USER means we dont show user and host in normal shell prompt\n    DEFAULT_USER=$USER\n    # Set up fzf key bindings and fuzzy completion\n    source \u003c(fzf --zsh)\n    command -v \"fdfind\" \u003e\u003e /dev/null \u0026\u0026 export FZF_DEFAULT_COMMAND=\"fdfind . $HOME\"\n    \n    [ -n \"$EAT_SHELL_INTEGRATION_DIR\" ] \u0026\u0026 \\\n        source \"$EAT_SHELL_INTEGRATION_DIR/zsh\"\n    \n    xhost +local: \u003e /dev/null 2\u003e\u00261\n\n\n### ~/.config/zsh/.zlogin\n\n    # Maintained in linux-config.org\n    logger -t \"startup-initfile\"  ZLOGIN\n    # [ -s \"${HOME}/.rvm/scripts/rvm\" ] \u0026\u0026 source \"${HOME}/.rvm/scripts/rvm\" # Load RVM into a shell session *as a function*\n    if [[ -z $DOT_PROFILE_SOURCED ]]; then\n        if [ -f ~/.profile ]; then\n            emulate sh -c '. ~/.profile'\n        fi\n    fi\n    if [ \"$(tty)\" = \"/dev/tty1\" ];then\n        chuck\n        sway-autostart\n    fi\n\n\n### zprofile\n\n    # Maintained in linux-config.org\n\n\n### ~/.zshenv\n\n    # Maintained in linux-config.org\n    if [ -z \"$XDG_CONFIG_HOME\" ] \u0026\u0026 [ -d \"${HOME}/.config\" ]\n    then\n        export XDG_CONFIG_HOME=\"${HOME}/.config\"\n    fi\n    \n    xhost +SI:localuser:root \u0026\u003e /dev/null\n    \n    ZDOTDIR=$HOME/.config/zsh\n    [ -f \"${HOME}/.cargo/env\" ] \u0026\u0026 . \"${HOME}/.cargo/env\"\n\n\n### Oh-My-Zsh Related\n\nDirectory is [here](.oh-my-zsh/).\n\n1.  Aliases ~/.config/zsh/oh-my-zsh/custom/aliases.zsh\n\n        # Maintained in linux-config.org\n        alias grep=\"grep -n --color\"\n        alias hg='history|grep'\n        alias vi='vim'\n\n2.  Functions ~/.config/zsh/oh-my-zsh/custom/functions.zsh\n\n        mkc () {\n            mkdir -p \"$@\" \u0026\u0026 cd \"$@\" #create full path and cd to it\n        \n        }\n\n\n## Tmux     :tmux:\n\n\n### ~/.profile\n\n    export FZF_TMUX_OPTS=1\n    export FZF_TMUX_OPTS=\"-d 40%\"\n\n\n### .config/tmux/tmux.conf\n\n    # Maintained in linux-config.org\n    # Change the prefix key to C-a\n    set-option -g status on\n    set-option -g status-interval 1\n    set-option -g status-justify centre\n    set-option -g status-keys vi\n    set-option -g status-position bottom\n    set-option -g status-style fg=colour136,bg=colour235\n    set-option -g status-left-length 20\n    set-option -g status-left-style default\n    set-option -g status-left \"#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r)#[default]\"\n    set-option -g status-right-length 140\n    set-option -g status-right-style default\n    set-option -g status-right \"#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) \"\n    set-option -ag status-right \"#[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',') \"\n    set-option -ag status-right \" #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d\"\n    set-window-option -g window-status-style fg=colour244\n    set-window-option -g window-status-style bg=default\n    set-window-option -g window-status-current-style fg=colour166\n    set-window-option -g window-status-current-style bg=default\n    \n    set-option -g default-shell /bin/zsh\n    set-option -ga update-environment SWAYSOCK\n    \n    set -g prefix C-a\n    \n    unbind C-b\n    bind C-a send-prefix\n    \n    set -g pane-border-format \"#{pane_index} #{pane_title} tty:#{pane_tty}\"\n    set -g pane-border-status bottom\n    \n    # reload tmux config\n    bind r source-file ~/.config/tmux/tmux.conf \\; display-message \"Config reloaded...\"\n    \n    # To copy, left click and drag to highlight text in yellow,\n    # once you release left click yellow text will disappear and will automatically be available in clibboard\n    # # Use vim keybindings in copy mode\n    setw -g mode-keys vi\n    \n    bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel \"xclip -i -f -selection primary | xclip -i -selection clipboard\"\n    bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel \"xclip -i -f -selection primary | xclip -i -selection clipboard\"\n    bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel \"xclip -i -f -selection primary | xclip -i -selection clipboard\"\n    \n    # Some extra key bindings to select higher numbered windows\n    bind F1 selectw -t:10\n    bind F2 selectw -t:11\n    bind F3 selectw -t:12\n    bind F4 selectw -t:13\n    bind F5 selectw -t:14\n    bind F6 selectw -t:15\n    bind F7 selectw -t:16\n    bind F8 selectw -t:17\n    bind F9 selectw -t:18\n    bind F10 selectw -t:19\n    bind F11 selectw -t:20\n    bind F12 selectw -t:21\n    \n    # A key to toggle between smallest and largest sizes if a window is visible in\n    # multiple places\n    bind F set -w window-size\n    \n    # Keys to toggle monitoring activity in a window and the synchronize-panes option\n    bind m set monitor-activity\n    bind y set synchronize-panes\\; display 'synchronize-panes #{?synchronize-panes,on,off}'\n    \n    bind K kill-session\n    bind x kill-pane\n    bind X kill-pane -a\n    bind c command-prompt -p \"window name:\" \"new-window; rename-window '%%'\"\n    bind + new-window\n    new -d -s0\n    # neww -d -nemacs 'exec emacsclient -nw ~/.emacs.d/linux-init/inits.org'\n    # setw -t0:1 aggressive-resize on\n    # neww -d  -nhtop 'exec htop'\n    \n    # Use Alt-arrow keys without prefix key to switch panes\n    bind -n M-Left select-pane -L\n    bind -n M-Right select-pane -R\n    bind -n M-Up select-pane -U\n    bind -n M-Down select-pane -D\n    \n    set -g mouse on\n    set -g @yank_selection 'clipboard' # 'primary' or 'secondary' or 'clipboard'\n    set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'\n    # List of plugins\n    set -g @plugin 'tmux-plugins/tpm'\n    set -g @plugin 'tmux-plugins/tmux-sensible'\n    set -g @plugin 'tmux-plugins/tmux-yank'\n    set -g @plugin 'tmux-plugins/tmux-resurrect'\n    set -g @plugin 'sainnhe/tmux-fzf'\n    \n    run -b '~/.config/tmux/plugins/tpm/tpm'\n\n\n### ~/bin/tmux-current-session\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    echo \"$(tmux list-panes -t \"$TMUX_PANE\" -F '#S' | head -n1)\"\n\n\n### ~/bin/tmux-pane-tty\n\nWritten to find the tty for a pane in order to redirect gef context source to a voltron pane\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    session=\"${1:-\"\"}\"\n    [ -z ${session} ] \u0026\u0026 exit 1\n    pane_index=\"${2:-0}\"\n    window=\"${3:-0}\"\n    tmux list-panes -t \"${session}:${window}\" -F 'pane_index:#{pane_index} #{pane_tty}' | awk '/pane_index:'\"${pane_index}\"'/ {print $2 }'\n\n\n# Power Related\n\nCaveat - for my thinkpads.\nScript that checks for a .BATTERY\\_POWER\\_LOW file and if its there and\nwe're discharging, it suspends the laptop. If it's there and we're\ncharging it deletes it. If its not there and we're below a certain\nthreshold and we're discharging, create. It runs as a looping bash\nscript kicked off in **.profile** as cron jobs cant escalate systemctl\npriviliges. Or something.\n\n\n## requirements\n\nLinux sys directory ***sys/class/power\\_supply/BAT0*** is\nthere. **notify-send** and **beep** are installed.\n\n\n## ~/bin/discharge-suspend\n\nIf you want to stop the suspend then create file\n**~/.BAT\\_POWER\\_SUSPEND\\_SUSPEND**. This defaults to 30% battery level as\nthe suspend threshold but you can set an ENV variable\n**BAT\\_POWER\\_SUSPEND\\_LEVEL** to override it. The polling period is every\nten minutes which can be overridden with the ENV\n**.BAT\\_POWER\\_POLL\\_SUSPEND\\_CYCLE**.\n\nI launch it from my **.profile**. see below.\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    \n    # loop and check power levels every BAT_POWER_SUSPEND_POLL_CYCLE seconds. When a certain\n    # threshold, BAT_POWER_SUSPEND_LEVEL, is reached then, unless there is\n    # a check file ~/.BAT_POWER_SUSPEND_SUSPEND, in which case we just repeat\n    # warnings, suspend in BAT_POWER_SUSPEND_TIME seconds. Calling the sister scriptdir\n    # discharge-suspend-toggle toggles suspend process.\n    \n    if [ ! -f /sys/class/power_supply/BAT0/status ];then\n        exit 1\n    fi\n    \n    rm -f ~/.BAT_POWER_SUSPEND_SUSPEND\n    BAT_POWER_SUSPEND_POLL_CYCLE=${BAT_POWER_SUSPEND_POLL_CYCLE:-60}\n    BAT_POWER_SUSPEND_LEVEL=${BAT_POWER_SUSPEND_LEVEL:-25}\n    BAT_POWER_SUSPEND_TIME=${BAT_POWER_SUSPEND_TIME:-600}\n    BAT_POWER_SUSPEND_CRITICAL_LEVEL=${BAT_POWER_SUSPEND_CRITICAL_LEVEL:-5}\n    \n    BAT_POWER_SUSPEND_SUSPENDING=false\n    # if suspend is suspended only warn every five minutes or so...\n    BAT_POWER_SUSPEND_SUSPEND_WARN_PERIOD=${BAT_POWER_SUSPEND_SUSPEND_WARN_PERIOD:-300}\n    \n    LASTWARN=0\n    \n    while true;  do\n        sleep ${BAT_POWER_SUSPEND_POLL_CYCLE}\n        mapfile -t batStats\u003c \u003c(cat /sys/class/power_supply/BAT0/{status,capacity})\n        status=${batStats[0]}\n        level=${batStats[1]}\n        if [ ${status} = \"Discharging\" ]; then\n            CRITICAL=FALSE\n            if ((${level} \u003c= ${BAT_POWER_SUSPEND_LEVEL})); then\n                if ((${level} \u003c= ${BAT_POWER_SUSPEND_CRITICAL_LEVEL}));then\n                    #if at a critical level then time to call it a day and suspend\n                    rm -f ~/.BAT_POWER_SUSPEND_SUSPEND\n                    BAT_POWER_SUSPEND_SUSPENDING=true\n                    notify-send \"**CRITICIAL**\" \"LOW BATTERY\"\n                    CRITICAL=true\n                    [ ! -f ~/.BAT_POWER_SUSPEND_SILENT ] \u0026\u0026 beepy\n                fi\n                # unless we're overriding the auto suspend then check if we should\n                if [ ! -f ~/.BAT_POWER_SUSPEND_SUSPEND ]; then\n                    #if we're already in the process of suspending see if its time to suspend\n                    if [ ${BAT_POWER_SUSPEND_SUSPENDING} = true ]; then\n                        if [ ${CRITICAL} = true ] || ((${SECONDS} \u003e= ${BAT_POWER_SUSPEND_TIME}));then\n                            notify-send \"**SUSPENDING**\" \"in 10 SECONDS\"\n                            [ ! -f ~/.BAT_POWER_SUSPEND_SILENT ] \u0026\u0026 beepy\n                            sleep 10\n                            systemctl suspend\n                            BAT_POWER_SUSPEND_SUSPENDING=false\n                        else\n                            notify-send \"**WARNING**\" \"Battery low: suspending in about $((${BAT_POWER_SUSPEND_TIME}-${SECONDS}))s\"\n                        fi\n                    else\n                        # initiate the suspending period\n                        BAT_POWER_SUSPEND_SUSPENDING=true\n                        SECONDS=0\n                        notify-send \"**WARNING**\" \"Battery low: suspending in ${BAT_POWER_SUSPEND_TIME}s\"\n                        [ ! -f ~/.BAT_POWER_SUSPEND_SILENT ] \u0026\u0026 beepy\n                    fi\n                else\n                    # since suspend is being overridden, just warn of low battery\n                    BAT_POWER_SUSPEND_SUSPENDING=false\n                    if (( ${BAT_POWER_SUSPEND_SUSPEND_WARN_PERIOD} + ${LASTWARN}  \u003c ${SECONDS} )); then\n                        notify-send \"**WARNING**\" \"Battery low: ${level}%\"\n                        LASTWARN=${SECONDS}\n                    fi\n                fi\n            fi\n        else\n            # we're not discharging so cancel any suspend operations\n            if [ ${BAT_POWER_SUSPEND_SUSPENDING} = true ]; then\n                notify-send \"**Charging detected**\" \"Suspending cancelled\"\n                BAT_POWER_SUSPEND_SUSPENDING=false\n                SECONDS=0\n            fi\n        fi\n    done\n\n\n## ~/bin/discharge-suspend-toggle\n\ntoggle existence of **~/.BAT\\_POWER\\_SUSPEND\\_SUSPEND**\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if [ -f ~/.BAT_POWER_SUSPEND_SUSPEND ];then\n        rm ~/.BAT_POWER_SUSPEND_SUSPEND;\n        sway-notify \"Auto suspend re-enabled\"\n        beepy\n    else\n        touch ~/.BAT_POWER_SUSPEND_SUSPEND;\n        sway-notify \"Auto suspend disabled\"\n    fi\n\n\n## ENV SET\n\n    # export BAT_POWER_SUSPEND_LEVEL=30\n    # export BAT_POWER_SUSPEND_POLL_CYCLE=300\n\n\n## exec discharge-suspend\n\nthis goes into my .profile\n\n    if [ -z \"$SSH_CONNECTION\" ]; then\n        (pgrep -f \"discharge-suspend\" \u003e /dev/null ||  discharge-suspend \u0026) 2\u003e\u00261\n    fi\n\n\n# syncing\n\n\n## sync-to\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    set -x\n    rsync -avx --exclude-from \"${HOME}/cloud/.rsync-ignore\" --delete ~/cloud/ ${1:-richiehh}:cloud/\n    set +x\n\n\n## sync-from\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    set -x\n    cwd=$(pwd)\n    rsync -avx --exclude-from \"${HOME}/cloud/.rsync-ignore\" --delete ${1:-richiehh}:cloud/ ${HOME}/cloud/\n    cd ${HOME}\n    ln -sf ${HOME}/cloud/homefiles/DotFiles/.* .\n    cd ${HOME}/.config\n    ln -sf ~/cloud/homefiles/dot-config/* .\n    cd ${cwd}\n    set +x\n\n\n# Network\n\n\n## ~/bin/network-online\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    wget -q --spider http://google.com\n\n\n# Editors\n\n\n## emacs\n\n\n### sway-editor\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-do-tool \"Emacs-general\" || emacsclient -s \"general\" -n -c \u0026\u0026 sleep 1 \u0026\u0026 sway-do-tool \"Emacs-general\"\n\n\n## Vim\n\n\n### ~/.vimrc\n\n    \" Maintained in linux-config.org\n    set nocompatible              \" be iMproved, required\n    filetype off                  \" required\n    \n    call plug#begin('~/.vim/plugged')\n    \n    Plug 'scrooloose/nerdtree'\n    Plug 'Xuyuanp/nerdtree-git-plugin'\n    Plug 'airblade/vim-gitgutter'\n    Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }\n    Plug 'junegunn/fzf.vim'\n    Plug 'tpope/vim-fugitive'\n    Plug 'christoomey/vim-tmux-navigator'\n    Plug 'vim-scripts/mru.vim'\n    Plug 'doums/darcula'\n    \" Plug 'ervandew/supertab'\n    \n    call plug#end()\n    \n    set nonu nu ic is hls\n    \n    map ; :Files\u003cCR\u003e\n    \n    \" Mapping selecting mappings\n    nmap \u003cleader\u003e\u003ctab\u003e \u003cplug\u003e(fzf-maps-n)\n    xmap \u003cleader\u003e\u003ctab\u003e \u003cplug\u003e(fzf-maps-x)\n    omap \u003cleader\u003e\u003ctab\u003e \u003cplug\u003e(fzf-maps-o)\n    \n    nnoremap  \u003csilent\u003e   \u003ctab\u003e  :if \u0026modifiable \u0026\u0026 !\u0026readonly \u0026\u0026 \u0026modified \u003cCR\u003e :write\u003cCR\u003e :endif\u003cCR\u003e:bnext\u003cCR\u003e\n    nnoremap  \u003csilent\u003e \u003cs-tab\u003e  :if \u0026modifiable \u0026\u0026 !\u0026readonly \u0026\u0026 \u0026modified \u003cCR\u003e :write\u003cCR\u003e :endif\u003cCR\u003e:bprevious\u003cCR\u003e\n    \n    \" Insert mode completion\n    imap \u003cc-x\u003e\u003cc-k\u003e \u003cplug\u003e(fzf-complete-word)\n    imap \u003cc-x\u003e\u003cc-f\u003e \u003cplug\u003e(fzf-complete-path)\n    imap \u003cc-x\u003e\u003cc-j\u003e \u003cplug\u003e(fzf-complete-file-ag)\n    imap \u003cc-x\u003e\u003cc-l\u003e \u003cplug\u003e(fzf-complete-line)\n    \n    cnoreabbrev \u003cexpr\u003e tn getcmdtype() == \":\" \u0026\u0026 getcmdline() == 'tn' ? 'tabnew' : 'tn'\n    cnoreabbrev \u003cexpr\u003e th getcmdtype() == \":\" \u0026\u0026 getcmdline() == 'th' ? 'tabp' : 'th'\n    cnoreabbrev \u003cexpr\u003e tl getcmdtype() == \":\" \u0026\u0026 getcmdline() == 'tl' ? 'tabn' : 'tl'\n    cnoreabbrev \u003cexpr\u003e te getcmdtype() == \":\" \u0026\u0026 getcmdline() == 'te' ? 'tabedit' : 'te'\n    \n    nnoremap \u003cF5\u003e :buffers\u003cCR\u003e:buffer\u003cSpace\u003e\n    \n    map \u003cC-o\u003e :NERDTreeToggle\u003cCR\u003e\n    \n    set shortmess+=A\n    set splitbelow\n    set splitright\n    \n    colorscheme darcula\n\n\n# ripgrep\n\n\n## ~/.ignore\n\n    # Maintained in linux-config.org\n    *~\n    .git\n    cache\n    .cache\n\n\n## ~/.ripgreprc\n\n    \n    # Maintained in linux-config.org\n    # Don't let ripgrep vomit really long lines to my terminal, and show a preview.\n    --max-columns=150\n    \n    # Set the colors.\n    --color=never\n    --colors=line:none\n    --colors=line:style:bold\n    \n    # Because who cares about case!?\n    --smart-case\n    \n    #ignore .gitignore\n    # --no-ignore-vcs\n\n\n# Sway Wayland Compositing Tile Manager     :i3:swaywm:sway:\n\nSway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11.\nIt works with your existing i3 configuration and supports most of i3's features, plus a few extras.\n\n\n## xkb keyboard\n\nSet keyboard layout.\nOverride in .profile.local\n\n    export XKB_DEFAULT_LAYOUT=de\n    export XKB_DEFAULT_OPTIONS=ctrl:nocaps\n\n\n## SwayWM config\n\n\n### general\n\n    # Maintained in linux-config.org\n    \n    # Logo key. Use Mod1 for Alt.\n    set $mod Mod4\n    set $super Mod4\n    \n    # Home row direction keys, like vim\n    set $left h\n    set $down j\n    set $up k\n    set $right l\n    \n    \n    set $term 'kitty'\n    set $menu 'sway-launcher'\n    set $editor 'sway-editor'\n    set $wallpaper '~/Pictures/Wallpapers/current '\n    \n    # Font  for window titles. Will also be used by the bar unless a different font\n    # is used in the bar {} block below.\n    font pango: \"JetBrainsMono Nerd Font 6\"\n    #DejaVu Sans Mono, Terminus Bold Semi-Condensed 11\n    \n    mouse_warping output\n    \n    bar {\n    swaybar_command waybar\n    }\n    \n    bindsym $mod+b exec killall -SIGUSR1 waybar\n    \n    set $mode_system System (b) blank (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown\n    mode \"$mode_system\" {\n    bindsym b exec sway-lock-utils blank, mode \"default\"\n    bindsym l exec sway-lock-utils lock, mode \"default\"\n    bindsym e exec sway-lock-utils logout, mode \"default\"\n    bindsym s exec sway-lock-utils suspend, mode \"default\"\n    bindsym h exec sway-lock-utils hibernate, mode \"default\"\n    bindsym r exec sway-lock-utils reboot, mode \"default\"\n    bindsym Shift+s exec sway-lock-utils shutdown, mode \"default\"\n    # back to normal: Enter or Escape\n    bindsym Return mode \"default\"\n    bindsym Escape mode \"default\"\n    }\n    \n    bindsym $mod+Control+q exec command -v wlogout \u0026\u0026 wlogout || swaymsg 'mode \"$mode_system\"'\n    \n    #\n    # Resizing containers:\n    #\n    mode \"resize\" {\n    # left will shrink the containers width\n    # right will grow the containers width\n    # up will shrink the containers height\n    # down will grow the containers height\n    # bindsym $left resize shrink width 10px\n    # bindsym $down resize grow height 10px\n    # bindsym $up resize shrink height 10px\n    # bindsym $right resize grow width 10px\n    \n    # Ditto, with arrow keys\n    bindsym Left resize shrink width 10px\n    bindsym Down resize grow height 10px\n    bindsym Up resize shrink height 10px\n    bindsym Right resize grow width 10px\n    \n    # # Return to default mode\n    bindsym Return mode \"default\"\n    bindsym Escape mode \"default\"\n    }\n    \n    bindsym $mod+r mode \"resize\"\n    \n    ### Key bindings\n    #\n    # Basics:\n    #\n    # Kill focused window\n    bindsym $mod+Shift+q kill\n    bindsym $mod+q kill\n    \n    # Start your launcher\n    bindsym $mod+d exec $menu\n    \n    # Start your editor\n    bindsym $mod+Shift+e exec $editor\n    \n    # Drag floating windows by holding down $mod and left mouse button.\n    # Resize them with right mouse button + $mod.\n    # Despite the name, also works for non-floating windows.\n    # Change normal to inverse to use left mouse button for resizing and right\n    # mouse button for dragging.\n    floating_modifier $mod normal\n    \n    # Reload the configuration file\n    bindsym $mod+Control+c reload\n    \n    # Exit sway (logs you out of your Wayland session)\n    # 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'\n    \n    #\n    # Moving around:\n    #\n    # Move your focus around\n    # bindsym $mod+$left focus left\n    # bindsym $mod+$down focus down\n    # bindsym $mod+$up focus up\n    # bindsym $mod+$right focus right\n    # # Or use $mod+[up|down|left|right]\n    bindsym $mod+Left focus left\n    bindsym $mod+Down focus down\n    bindsym $mod+Up focus up\n    bindsym $mod+Right focus right\n    \n    # Move the focused window\n    # bindsym $mod+Shift+$right move right\n    # bindsym $mod+Shift+$left move left\n    # bindsym $mod+Shift+$down move down\n    # bindsym $mod+Shift+$up move up\n    # Ditto, with arrow keys\n    bindsym $mod+Shift+Left move left\n    bindsym $mod+Shift+Down move down\n    bindsym $mod+Shift+Up move up\n    bindsym $mod+Shift+Right move right\n    # #\n    # # Workspaces:\n    #\n    # Switch to workspace\n    bindsym $mod+1 workspace 1\n    bindsym $mod+2 workspace 2\n    bindsym $mod+3 workspace 3\n    bindsym $mod+4 workspace 4\n    bindsym $mod+5 workspace 5\n    bindsym $mod+6 workspace 6\n    bindsym $mod+7 workspace 7\n    bindsym $mod+8 workspace 8\n    bindsym $mod+9 workspace 9\n    bindsym $mod+0 workspace 10\n    # Move focused container to workspace\n    bindsym $mod+Shift+1 move container to workspace 1\n    bindsym $mod+Shift+2 move container to workspace 2\n    bindsym $mod+Shift+3 move container to workspace 3\n    bindsym $mod+Shift+4 move container to workspace 4\n    bindsym $mod+Shift+5 move container to workspace 5\n    bindsym $mod+Shift+6 move container to workspace 6\n    bindsym $mod+Shift+7 move container to workspace 7\n    bindsym $mod+Shift+8 move container to workspace 8\n    bindsym $mod+Shift+9 move container to workspace 9\n    bindsym $mod+Shift+0 move container to workspace 10\n    # Note: workspaces can have any name you want, not just numbers.\n    # We just use 1-10 as the default.\n    \n    # bindsym $mod+control+shift+$right move workspace to output right\n    # bindsym $mod+control+shift+$left move workspace to output left\n    # bindsym $mod+control+$right move container to output right\n    # bindsym $mod+control+$left move container to output left\n    bindsym $mod+control+shift+right move workspace to output right; #focus output right;\n    bindsym $mod+control+shift+left move workspace to output left; # focus output left;\n    bindsym $mod+control+shift+down move workspace to output down; #focus output down;\n    bindsym $mod+control+shift+up move workspace to output up; focus #output up;\n    \n    bindsym $mod+control+right move container to output right; focus output right;\n    bindsym $mod+control+left move container to output left; focus output left;\n    bindsym $mod+control+down move container to output down; focus output down;\n    bindsym $mod+control+up move container to output up; focus output up;\n    \n    bindsym $mod+Control+m exec sway-display-swap\n    bindsym $mod+Tab workspace back_and_forth\n    \n    #\n    # Layout stuff:\n    \n    bindsym $mod+h splith\n    bindsym $mod+v splitv\n    \n    # Switch the current container between different layout styles\n    bindsym $mod+s layout stacking\n    bindsym $mod+w layout tabbed\n    bindsym $mod+e layout toggle split\n    \n    # Make the current focus fullscreen\n    bindsym $mod+f fullscreen\n    \n    # Toggle the current focus between tiling and floating mode\n    bindsym $mod+Shift+space floating toggle\n    \n    # Swap focus between the tiling area and the floating area\n    bindsym $mod+space focus mode_toggle\n    \n    # Move focus to the parent container\n    bindsym $mod+a focus parent\n    \n    #\n    # Scratchpad:\n    #\n    # Sway has a \"scratchpad\", which is a bag of holding for windows.\n    # You can send windows there and get them back later.\n    bindsym $mod+Return exec sway-scratch-terminal\n    # Move the currently focused window to the scratchpad\n    bindsym $mod+Shift+minus move scratchpad\n    # Show the next scratchpad window or hide the focused scratchpad window.\n    # If there are multiple scratchpad windows, this command cycles through them.\n    bindsym $mod+minus scratchpad show\n\n\n### host specific     :scale:scaling:\n\n    include \"${HOME}/.config/sway/host-config-$(hostname)\"\n\n1.  Thinkpad T14s\n\n    1.  scaling\n    \n            #Maintained in linux-config.org\n            output eDP-1 mode 1920x1080@60hz scale 1.0\n\n2.  XMG Neo\n\n    1.  scaling\n    \n            #Maintained in linux-config.org\n            output eDP-1 mode 2560x1440@165hz scale 1.15\n\n\n### launcher\n\n    for_window [title=\"sway-launcher\"] floating enable\n\n\n### display\n\n1.  wallpaper\n\n        # done in sway-workspace-init\n        # output * bg  $wallpaper fill\n\n2.  transparency\n\n        set $trans 0.7\n        set $alphamark \"α\"\n        for_window [con_mark=$alphamark] opacity set $trans\n        bindsym $mod+Control+a mark --toggle \"$alphamark\" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans\n\n3.  lid     :lid:clamshell:\n\n        set $laptop-id `sway-laptop-id`\n        bindswitch lid:on exec \"sway-screen disable $laptop-id\"\n        bindswitch lid:off exec \"sway-screen enable $laptop-id\"\n\n4.  brightness     :brightness:\n\n        bindsym --locked XF86MonBrightnessUp exec --no-startup-id brightnessctl set +${BRIGHTNESS_DELTA:-15} \u0026\u0026 sway-brightness-notify\n        bindsym --locked XF86MonBrightnessDown exec --no-startup-id brightnessctl set ${BRIGHTNESS_DELTA:-15}- \u0026\u0026 sway-brightness-notify\n\n5.  gaps\n\n        gaps inner  1\n        gaps outer  0\n\n\n### scratchpad terminal\n\n$term is set to \"sway-scratch-terminal\n\n    for_window [title=ScratchTerminal] mark \"$alphamark\", move to scratchpad; [title=ScratchTerminal] scratchpad show\n\n1.  ~/bin/sway/sway-scratch-terminal\n\n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        swaymsg \"[title=ScratchTerminal] scratchpad show \" ||  (sway-notify \"created new scratchpad terminal\" \u0026\u0026 kitty --title \"ScratchTerminal\" -e tmux new-session -A -s ScratchTerminal)\n\n\n### navigation                                  :navigation\n\n\n### clipboard\n\n1.  clipman and wofi\n\n    A basic [clipboard manager](https://github.com/yory8/clipman) for Wayland, with support for persisting copy buffers after an application exits.\n    \n        set $clipboard \"~/.local/share/clipman.json\"\n        exec wl-paste -t text --watch clipman store\n        exec wl-paste -p -t text --watch clipman store -P --histpath=\"~/.local/share/clipman-primary.json\"\n        bindsym $mod+y exec sway-clipboard-history-select\n        bindsym $mod+Control+y exec sway-clipboard-history-clear\n    \n    1.  sway-clipboard-history-select\n    \n            #!/usr/bin/env bash\n            # Maintained in linux-config.org\n            if ! (clipman pick --tool=\"wofi\" --max-items=30); then\n                sway-notify \"Clipboard History Is Empty\"\n                exit 1\n            else\n                exit 0\n            fi\n    \n    2.  sway-clipboard-history-clear\n    \n            #!/usr/bin/env bash\n            # Maintained in linux-config.org\n            clipman clear -a\n            sway-notify \"Clipboard history cleared.\"\n    \n    3.  Wofi Config\n    \n    4.  ~/.config/wofi/config\n    \n        [Configuration](http://manpages.ubuntu.com/manpages/impish/man5/wofi.5.html) file\n        \n            # Maintained in linux-config.org\n            dynamic_lines=true\n            gtk_dark=true\n            terminal=kitty\n    \n    5.  ~/.config/wofi/style.css\n    \n            /* Maintained in linux-config.org */\n            window {\n                margin: 0px;\n                border: 1px solid #c0c0c0;\n                background-color: #282a36;\n            }\n            \n            #input {\n                margin: 2 px;\n                border: none;\n                color: #222222;\n                background-color: #eeeeee;\n            }\n            \n            #inner-box {\n                margin: 2px;\n                border: none;\n                background-color: #282a36;\n            }\n            \n            #outer-box {\n                margin: 2px;\n                border: none;\n                background-color: #282a36;\n            }\n            \n            #scroll {\n                margin: 0px;\n                border: none;\n            }\n            \n            #text {\n                margin: 2px;\n                border: none;\n                color: #f8f8f2;\n            }\n            \n            #entry:selected {\n                background-color: #44475a;\n            }\n            #entry {\n                border-bottom-style: solid;\n                border-width: 1px;\n                border-color: #d4af37;\n            }\n\n\n### audio     :audio:\n\n1.  volume     :volume:\n\n        \n        bindsym XF86AudioMute exec  sway-volume-notify \"0\"\n        bindsym $mod+XF86AudioMute exec  pavucontrol\n        bindsym XF86AudioRaiseVolume exec sway-volume-notify \"+\"\n        bindsym XF86AudioLowerVolume exec sway-volume-notify \"-\"\n        # bindsym XF86AudioRaiseVolume exec pulse-volume \"+5%\" \u0026\u0026 sway-volume-notify\n        # bindsym XF86AudioLowerVolume exec pulse-volume \"-5%\" \u0026\u0026 sway-volume-notify\n        bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle \u0026\u0026 sway-volume-notify\n\n2.  pavucontrol\n\n        for_window [app_id=\"pavucontrol\"] floating enable\n        bindsym $mod+Control+Shift+a exec pulse-restart\n\n\n### wifi     :wifi:\n\n    bindsym --locked XF86Wlan exec sleep 1 \u0026\u0026 sway-notify \"WLAN is $(nmcli radio wifi).\"\n\n\n### apps default workspace\n\n    # assign [title=\"dbg:\"] 3\n    #assign [app_id=\"Alacritty\"] 1\n    #assign [class=\"Ardour\"] 6\n    assign [class=\"Code\"] 3\n    assign [class=\"Signal\"] 8\n    assign [class=\"jetbrains-studio\"] 3\n    assign [class=\"Hexchat\"] 8\n    assign [app_id=\"telegram\"] 8\n    assign [class=\"discord\"] 8\n    assign [class=\"Steam\"] 9\n\n\n### apps default appearance\n\n    for_window [title=\"wifi\"] floating enable\n    for_window [title=\"bluetoothctl\"] floating enable\n    # for_window [title=\"YouTube\"] move container to workspace  7\n\n\n### apps keybindings\n\n    \n    bindsym $mod+g exec \"goldendict \\\\\"`xclip -o -selection clipboard`\\\\\"\"\n    \n    bindsym $mod+Print exec sway-screenshot -i\n    bindsym $mod+Control+Print exec sway-screen-recorder\n    \n    bindsym $mod+Shift+f exec \"sway-chrome\"\n    bindsym $mod+Shift+m exec sway-do-tool \"wwwemail\" \"sway-email\"\n    bindsym $mod+Shift+a exec sway-do-tool \"android-studio\" \"studio.sh\"\n    bindsym $mod+Control+Shift+s exec sway-do-tool \"Steam\" \"steam\"\n    bindsym $mod+Control+i exec sway-do-tool \"Emacs-irc\" || emacsclient -s \"irc\" -c -n  \u0026\u0026 sleep 0.5 \u0026\u0026 sway-do-tool \"Emacs-irc\"\n    bindsym $mod+Control+d exec sway-do-tool \"Emacs-dired\" || emacsclient -s \"dired\" -n -c  \u0026\u0026 sleep 0.5  \u0026\u0026 sway-do-tool \"Emacs-dired\"\n    bindsym $mod+Control+e exec sway-do-tool \"Emacs-email\" || emacsclient -s \"email\" -n -c  \u0026\u0026 sleep 0.5  \u0026\u0026 sway-do-tool \"Emacs-email\"\n    bindsym $mod+Control+Shift+d exec sway-screen-menu\n    bindsym $mod+Control+f exec command -v thunar \u0026\u0026 thunar || nautilus\n    bindsym $mod+Control+p exec sway-htop\n    bindsym $mod+Control+Shift+p exec htop-regexp\n    bindsym $mod+Control+f10 exec sway-notify \"Opening NEW terminal instance\" \u0026\u0026 kitty\n    bindsym $mod+Control+t exec sway-notify \"Opening NEW tmux terminal instance\" \u0026\u0026 kitty tmux new\n    bindsym $mod+Control+w exec sway-workspace-position\n    bindsym $mod+Control+shift+u exec sway-workspace-populate\n\n\n### \n\n\n### sway startup processes\n\n    #   exec mako\n    #  exec bluetooth-headphone-controls\n      exec sway-idle\n      exec sway-kanshi\n      exec blueman-applet \u0026\u003e/dev/null\n      exec waybar-network-applet\n      # exec gpg-cache\n      exec 'sway-workspace-populate-conditional; [ -f \"${HOME}/.sway.login\" ]  \u0026\u0026 . \"${HOME}/.sway.login\" \u0026\u0026 (sleep 1 \u0026\u0026 sway-notify \"~/.sway.login processed\"); sway-workspace-position; swaymsg workspace 1; '\n\n\n## waybar config\n\n\u003chttps://github.com/Alexays/Waybar/wiki/Configuration\u003e\n\n    \n    {\n        \"layer\": \"top\",\n        \"mode\": \"hide\",\n        \"position\": \"top\",\n        \"height\": 22,\n        \"width\": 0,\n    \n        \"modules-left\": [\n            \"sway/workspaces\",\n            \"cpu\",\n            \"temperature\",\n            \"memory\"\n        ],\n    \n        \"modules-center\": [\n            \"custom/weather\",\n            \"custom/clock\",\n            \"idle_inhibitor\",\n            \"custom/monitors\"\n        ],\n    \n        \"modules-right\": [\n            \"pulseaudio\",\n            \"backlight\",\n            \"battery\",\n            \"power-profiles-daemon\",\n            \"custom/power-draw\", \n            \"tray\"\n        ],\n        \"network\": {\n            \"format-wifi\": \"\u003cspan color='#589df6'\u003e\u003c/span\u003e \u003cspan color='gray'\u003e{signalStrength}%\u003c/span\u003e\" ,\n            \"format-ethernet\": \"{ifname}: {ipaddr}/{cidr} \",\n            \"format-linked\": \"{ifname} (No IP) \",\n            \"format-disconnected\": \" \",\n            \"format-alt\": \"\u003cspan color='gray'\u003e{essid}\u003c/span\u003e \u003cspan color='green'\u003e⬇\u003c/span\u003e{bandwidthDownBits} \u003cspan color='green'\u003e⬆\u003c/span\u003e{bandwidthUpBits}\",\n            \"interval\": 60,\n            \"tooltip-format\": \"{ifname}  {ipaddr}\",\n            \"on-click\": \"sway-wifi\"\n        },\n    \n    \n        \"sway/workspaces\": {\n            \"persistent_workspaces\": {\n                \"1\": [\"DP-4\"],\n                \"2\": [\"DP-4\"],\n                \"3\": [],\n                \"4\": [\"DP-3\"],\n                \"5\": [],\n                \"6\": [],\n                \"7\": [],\n                \"8\": [],\n                \"9\": [],\n                \"10\": []\n            },\n            \"disable-scroll\": true,\n            \"all-outputs\": false,\n            \"format\": \"({name}){icon}\",\n            \"format-icons\": {\n                \"1\": \"⌨ Edit\",\n                \"2\": \"🔍 Research\",\n                \"3\": \"👷 IDE\",\n                \"4\": \"🪲 Debug\",\n                \"5\": \"📁 Files\",\n                \"6\": \"🎧 Music\",\n                \"7\": \"⏵ Video\",\n                \"8\": \"🗨 IRC\",\n                \"9\": \"Steam\",\n                \"10\":\"Scratch\",\n            },\n        },\n    \n        \"sway/mode\": {\n            \"format\": \"{}\"\n        },\n    \n        \"backlight\": {\n            //\t\t\"device\": \"acpi_video1\",\n            \"format\": \"{icon} {percent}%\",\n            \"format-icons\": [\"\", \"\"]\n        },\n    \n        \"battery\": {\n            \"states\": {\n                // \"good\": 95,\n                \"warning\": 20,\n                \"critical\": 10\n            },\n            \"format\": \"\u003cspan color='gold'\u003e{icon}\u003c/span\u003e {capacity}%\",\n    \n            \"format-charging\": \"\u003cspan color='gold'\u003e \u003c/span\u003e {capacity}% ({time})\",\n            \"format-plugged\":  \"\u003cspan color='gold'\u003e{icon}  \u003c/span\u003e {capacity}%\",\n            //\t\t\"format-good\": \"\", // An empty format will hide the module\n            \"format-discharging\": \"\u003cspan color='yellow'\u003e{icon}\u003c/span\u003e {capacity}% ({time})\",\n            \"format-icons\": [\"\", \"\", \"\", \"\", \"\"],\n            \"on-click\" : \"sway-htop\"\n        },\n    \n        \"custom/clock\": {\n            \"interval\": 60,\n            \"exec\": \"date +'%a, %d %b: %H:%M'\",\n            \"format\": \"{} \",\n            \"max-length\": 25\n        },\n    \n        \"cpu\": {\n            \"interval\": 5,\n            \"format\": \"\u003cspan color='#eb8a60'\u003e {usage}% ({load})\u003c/span\u003e\",\n            \"states\": {\n                \"warning\": 70,\n                \"critical\": 90\n            },\n            \"on-click\" : \"hardinfo\"\n        },\n    \n        \"idle_inhibitor\": {\n            \"format\": \"\u003cspan color='GOLD'\u003e{icon}\u003c/span\u003e\",\n            \"format-icons\": {\n                \"activated\": \"📀ﰌ\",\n                \"deactivated\": \"😴\"\n            },\n            \"on-click-right\": \"discharge-suspend-toggle\"\n        },\n        \"pulseaudio\": {\n            \"format\": \"{icon} {volume}% {format_source}\",\n            \"format-muted\": \"🔇 {format_source}\",\n            \"format-bluetooth\": \"{icon} {volume}% {format_source}\",\n            \"format-bluetooth-muted\": \"🔇 {format_source}\",\n    \n            \"format-source\": \" {volume}%\",\n            \"format-source-muted\": \"\",\n    \n            \"format-icons\": {\n                \"headphones\": \"\",\n                \"handsfree\": \"\",\n                \"headset\": \"\",\n                \"phone\": \"\",\n                \"portable\": \"\",\n                \"car\": \"\",\n                \"default\": [\"🔈\", \"🔉\", \"🔊\"]\n            },\n            \"on-click\": \"pulse-volume toggle\",\n            \"on-click-right\": \"pavucontrol\"\n        },\n    \n        \"tray\": {\n            \"icon-size\": 21,\n            \"spacing\": 5\n        },\n    \n        \"custom/weather\": {\n            \"format\": \"{} \",\n            \"tooltip\": true,\n            \"interval\": 3600,\n            \"exec\": \"waybar-weather-json\",\n            \"return-type\": \"json\"\n        },\n    \n        \"custom/uptime\": {\n            \"format\": \"\u003cspan color='white'\u003e⌛{}\u003c/span\u003e\",\n            \"interval\": 60,\n            \"exec\": \"uptime -p\"\n        },\n    \n        \"custom/monitors\": {\n            \"format\": \"\u003cspan color='gold'\u003e{}\u003c/span\u003e\",\n            \"return-type\" : \"json\",\n            \"interval\": 10,\n            \"exec\": \"waybar-monitors\",\n            \"tooltip\": \"true\",\n            \"on-click\": \"sway-screen-menu\"\n        },\n        \"custom/bluetooth\": {\n            \"format\": \"\u003cspan color='white'\u003e  \u003c/span\u003e\",\n            \"interval\": 30,\n            \"exec\": \"waybar-bluetooth\",\n            \"tooltip\": \"false\",\n            \"on-click\": \"blueman-manager\"\n        },\n        \"custom/power-draw\": {\n            \"format\": \"\u003cspan color='gold'\u003e⚡{}🔋\u003c/span\u003e\",\n            \"interval\": 5,\n            \"exec\": \"waybar-power-draw\",\n            \"tooltip\": \"false\"\n        },\n        \"power-profiles-daemon\": {\n            \"format\": \" {icon}{profile} \",\n            \"tooltip-format\": \"Power profile: {profile}\\nDriver: {driver}\",\n            \"tooltip\": true,\n            \"format-icons\": {\n                \"default\": \"\",\n                \"performance\": \"\",\n                \"balanced\": \"\",\n                \"power-saver\": \"\"\n            }\n        },\n        \"wlr/taskbar\": {\n            \"format\": \"{icon}\",\n            \"icon-size\": 14,\n            \"icon-theme\": \"Numix-Circle\",\n            \"tooltip-format\": \"{title}\",\n            \"on-click\": \"activate\",\n            \"on-click-middle\": \"close\"\n        },\n    \n        \"custom/mynetwork\": {\n            \"format\":  \"{}\",\n            \"format-wifi\":  \"📶{ssid}\",\n            \"format-ipaddr\": \"{ipaddr}\",\n            \"format-ssid\": \"xx{ssid}xx\",\n            \"format-alt\": \"{alt}:{}\",\n            \"exec\": \"waybar-ip-info-json\",\n            \"return-type\": \"json\",\n            \"interval\": 60,\n            \"on-click-right\": \"sway-wifi\",\n            \"tooltip-format\": \"{ssid}\",\n            \"tooltip\": \"true\"\n        }\n    \n    }\n\n\n### ~/.config/waybar/style.css\n\n    *{\n        border: none;\n        background: rgba(28, 28, 28, 0.6);\n        border-radius: 0;\n        font-family: \"JetBrainsMono Nerd Font\";\n        font-size: 10pt;\n        min-height: 0;\n    }\n    \n    #waybar {\n        background: rgba(28, 28, 28, 0.6);\n        color: #e4e4e4;\n    }\n    \n    #window {\n        color: #e4e4e4;\n        font-weight: bold;\n    }\n    \n    #workspaces {\n        font-size: 8px;\n        /*\tpadding: 0 2px;*/\n        margin-left: 8px;\n        margin-right: 8px;\n        padding-left: 0px;\n        padding-right: 0px;\n        border-top-left-radius: 10px;\n        border-bottom-left-radius: 10px;\n        border-top-right-radius: 10px;\n        border-bottom-right-radius: 10px;\n        background: rgba(28, 28, 28, 0.6);\n    }\n    \n    #workspaces button {\n        padding: 0 5px;\n        /*\tbackground: rgba(28, 28, 28, 0.9);*/\n        color: #888888;\n        /*\tmargin: 0 1px;*/\n    }\n    #workspaces button:hover {\n        box-shadow: inherit;\n        text-shadow: inherit;\n    \n    }\n    \n    #workspaces button.visible {\n        padding: 0 5px;\n        border-radius: 10px;\n        color: #ff0000;\n        margin: 0 0px;\n    }\n    \n    #workspaces button.focused {\n        color: #00ff00;\n    \n    }\n    #workspaces button.urgent {\n        background: #5555ff;\n    \n    }\n    \n    #workspaces button.urgent {\n        background: #af005f;\n        color: #1b1d1e;\n    }\n    \n    #mode {\n        background: #af005f;\n    }\n    \n    #custom-bluetooth,#custom-power-draw,#custom-dropbox,#clock, #temperature, #cpu, #memory, #network, #backlight, #pulseaudio, #battery, #tray, #idle_inhibitor {\n        padding: 0 3px;\n    }\n    \n    #idle_inhibitor{\n        font-size:16px\n    }\n    \n    #clock {\n        border-top-left-radius: 10px;\n        border-bottom-left-radius: 10px;\n    }\n    \n    @keyframes blink {\n        to {\n            background-color: darkred;\n        }\n    }\n    \n    #battery.warning:not(.charging) {\n        background-color: #ff8700;\n        color: #1b1d1e;\n    }\n    #battery.critical:not(.charging) {\n        color: white;\n        animation-name: blink;\n        animation-duration: 0.5s;\n        animation-timing-function: linear;\n        animation-iteration-count: infinite;\n        animation-direction: alternate;\n    }\n    #battery,#battery_icon,#battery.charging {\n        color:gold\n    }\n    \n    \n    #cpu {\n    }\n    \n    #memory {\n    }\n    \n    #network {\n    }\n    \n    #network.disconnected {\n        background: #f53c3c;\n    }\n    \n    #pulseaudio {\n    }\n    \n    #pulseaudio.muted {\n    }\n    \n    #custom-weather {\n        font-size:12px;\n    }\n    \n    #tray {\n        margin-left: 1px;\n    }\n\n\n### waybar utility scripts\n\n1.  ~/bin/sway/waybar-bluetooth\n\n        #!/usr/bin/env bash\n        # Maintained in linux-config.org\n        \n        get_from_file() {\n            dev=$1\n            name=\n            if [ ! -f /tmp/bt-devices.txt ]; then\n                touch /tmp/bt-devices.txt\n                echo \"\"\n                return\n            fi\n            for i in `cat /tmp/bt-devices.txt`; do\n                d=`echo $i | awk -F:: '{print $1}'`\n                if [ $d = $dev ]; then\n                    name=`echo $i | awk -F:: '{print $2}'`\n                fi\n            done\n            echo \"${name}\"\n        }\n        \n        store_file() {\n            dev=$1\n            name=\"${2}\"\n            echo \"$dev::${name}\" \u003e\u003e /tmp/bt-devices.txt\n        }\n        \n        connections=`hcitool con | sed -n 2p`\n        if [ ! -z \"$connections\" ]; then\n            # We have a connection, we want to get the name from a file if we've had\n            # it from there before because getting the name of the device connected\n            # is very slow and costly.\n            dev=`echo $connections | awk '{print $3}'`\n            name=`get_from_file $dev`\n            if [ -z \"$name\" ]; then\n                name=`hcitool name $dev | awk '{print $1}'`\n                if [ ! -z \"${name}\" ]; then\n                    store_file $dev \"${name}\"\n                fi\n            fi\n            echo \"💡$name\"\n        else\n            echo \"🔌\"\n        fi\n\n2.  ~/bin/sway/waybar-dropbox-json\n\n        #!/usr/bin/env bash\n        # Maintained in linux-config.org\n        if ( ! dropbox running ); then\n            fullstat=\"$(dropbox status)\"\n            stat=\"$(sed -n 1p \u003c\u003c\u003c $fullstat)\"\n        else\n            fullstat=\"\"\n            if [ -f \"${HOME}/.RESTART_DROPBOX\" ];then\n                stat=\"Restarting Dropbox..\"\n                sway-notify \"$stat\"\n                dropbox start \u0026\u003e /dev/null\n            else\n                stat=\"click to restart DB\"\n            fi\n        fi\n        \n        jq --unbuffered --compact-output -n \\\n           --arg text \"$stat\" \\\n           --arg tooltip \"$fullstat\" \\\n           --arg class \"dropbox-status\" \\\n           '{text: $text, tooltip: $tooltip, class: $class}'\n\n3.  ~/bin/sway/waybar-dropbox-status\n\n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        if pidof dropbox \u0026\u003e /dev/null ; then\n            stat=$(dropbox status | sed -n 1p)\n            echo \"${stat}\"; echo \"\";\n        else\n            if command -v dropbox \u003e /dev/null; then\n                echo \"⇄Restarting Dropbox..\"\n                dropbox start \u0026\u003e /dev/null \u0026\n            fi\n        fi\n\n4.  ~/bin/sway/waybar-ip-info-json\n\n        ifname=\"${1:-$(printf '%s' /sys/class/net/*/wireless | cut -d/ -f5)}\"\n        [ -z \"$ifname\" ] \u0026\u0026 exit 1\n        pubip=\"$(curl -s -m 1 ipinfo.io/ip)\"\n        pubip=\"$([ -z \"$pubip\" ] \u0026\u0026 echo \"Offline\" || echo \"$pubip\")\"\n        lip=$(ip -j address | jq -r '.[] | select (.ifname=='\\\"$ifname\\\"').addr_info[] | select(.family==\"inet\").local')\n        lip=\"$([ -z \"$lip\" ] \u0026\u0026 echo -n \"Offline\" || echo -n \"$lip\")\"\n        ssid=\"$(/sbin/iwconfig $ifname | grep 'ESSID:' | awk '{print $4}' | sed 's/ESSID://g' | sed 's/\"//g')\"\n        jq --unbuffered --compact-output -n \\\n           --arg text \"📶 $ssid\" \\\n           --arg alt \"$ifname:🌎$pubip,🔌$lip\" \\\n           --arg tooltip \"$ifname:🌎$pubip,🔌$lip\" \\\n           --arg class \"\" \\\n           --arg percentage \"1\" \\\n           --arg ifname \"$ifname\" \\\n           --arg ssid \"$ssid\" \\\n           --arg public_ip \"$pubip\" \\\n           --arg ippadr \"$lip\" \\\n           '{text: $text, alt: $alt, tooltip: $tooltip, class: $class, percentage: $percentage, ifname: $ifname, ssid: $ssid, public_ip: $public_ip, ipaddr: $ippadr}'\n\n5.  ~/bin/sway/waybar-monitors\n\n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        l=$(swaymsg -t get_outputs | jq  -r '[ .[] | select(.dpms and .active) ] | length')\n        o=$(swaymsg -t get_outputs | jq  -r '. | map(.name) | join(\",\")')\n        t=\"\"\n        for i in `seq $l`; do t=\"${t} ⃢ \";done\n        text=\"{\\\"text\\\":\\\"\"$t\"\\\",\\\"tooltip\\\":\\\"\"$o\"\\\"}\"\n        echo $text\n\n6.  ~/bin/sway/waybar-network-applet\n\n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        if command -v iwgtk 2\u003e\u00261 \u003e/dev/null\n        then\n            pgrep iwgtk || iwgtk -i \u0026\n        else\n            pgrep nm-applet || nm-applet \u0026\n        fi\n\n7.  ~/bin/sway/waybar-power-draw\n\n        #!/usr/bin/env bash\n        # Maintained in linux-config.org\n        awk '{print $1*10^-6 \"W \"}' /sys/class/power_supply/BAT0/power_now\n\n8.  ~/bin/sway/waybar-weather-json\n\n        #!/usr/bin/env bash\n        # Maintained in linux-config.org \n        sleep 5\n        WTTR_LOCATION=\"${1:-\"Grömitz,DE\"}\"  waybar-wttr\n\n9.  ~/bin/sway/waybar-wttr\n\n        #!/usr/bin/env python\n        # Maintained in linux-config.org\n        \n        import json\n        import requests\n        from datetime import datetime\n        \n        WEATHER_CODES = {\n            '113': '☀️',\n            '116': '⛅️',\n            '119': '☁️',\n            '122': '☁️',\n            '143': '🌫',\n            '176': '🌦',\n            '179': '🌧',\n            '182': '🌧',\n            '185': '🌧',\n            '200': '⛈',\n            '227': '🌨',\n            '230': '❄️',\n            '248': '🌫',\n            '260': '🌫',\n            '263': '🌦',\n            '266': '🌦',\n            '281': '🌧',\n            '284': '🌧',\n            '293': '🌦',\n            '296': '🌦',\n            '299': '🌧',\n            '302': '🌧',\n            '305': '🌧',\n            '308': '🌧',\n            '311': '🌧',\n            '314': '🌧',\n            '317': '🌧',\n            '320': '🌨',\n            '323': '🌨',\n            '326': '🌨',\n            '329': '❄️',\n            '332': '❄️',\n            '335': '❄️',\n            '338': '❄️',\n            '350': '🌧',\n            '353': '🌦',\n            '356': '🌧',\n            '359': '🌧',\n            '362': '🌧',\n            '365': '🌧',\n            '368': '🌨',\n            '371': '❄️',\n            '374': '🌧',\n            '377': '🌧',\n            '386': '⛈',\n            '389': '🌩',\n            '392': '⛈',\n            '395': '❄️'\n        }\n        \n        data = {}\n        \n        \n        weather = requests.get(\"https://wttr.in/?format=j1\").json()\n        \n        \n        def format_time(time):\n            return time.replace(\"00\", \"\").zfill(2)\n        \n        \n        def format_temp(temp):\n            return (hour['FeelsLikeC']+\"°\").ljust(3)\n        \n        \n        def format_chances(hour):\n            chances = {\n                \"chanceoffog\": \"Fog\",\n                \"chanceoffrost\": \"Frost\",\n                \"chanceofovercast\": \"Overcast\",\n                \"chanceofrain\": \"Rain\",\n                \"chanceofsnow\": \"Snow\",\n                \"chanceofsunshine\": \"Sunshine\",\n                \"chanceofthunder\": \"Thunder\",\n                \"chanceofwindy\": \"Wind\"\n            }\n        \n            conditions = []\n            for event in chances.keys():\n                if int(hour[event]) \u003e 0:\n                    conditions.append(chances[event]+\" \"+hour[event]+\"%\")\n            return \", \".join(conditions)\n        \n        \n        data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \\\n            \" \"+weather['current_condition'][0]['FeelsLikeC']+\"°\"\n        \n        data['tooltip'] = f\"\u003cb\u003e{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°\u003c/b\u003e\\n\"\n        data['tooltip'] += f\"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\\n\"\n        data['tooltip'] += f\"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\\n\"\n        data['tooltip'] += f\"Humidity: {weather['current_condition'][0]['humidity']}%\\n\"\n        for i, day in enumerate(weather['weather']):\n            data['tooltip'] += f\"\\n\u003cb\u003e\"\n            if i == 0:\n                data['tooltip'] += \"Today, \"\n            if i == 1:\n                data['tooltip'] += \"Tomorrow, \"\n            data['tooltip'] += f\"{day['date']}\u003c/b\u003e\\n\"\n            data['tooltip'] += f\"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° \"\n            data['tooltip'] += f\"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\\n\"\n            for hour in day['hourly']:\n                if i == 0:\n                    if int(format_time(hour['time'])) \u003c datetime.now().hour-2:\n                        continue\n                data['tooltip'] += f\"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\\n\"\n        \n        \n        print(json.dumps(data))\n\n\n## swaywm scripts     :sway:wayland:\n\n\n### ~/bin/sway-active-monitors-count\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    swaymsg -t get_outputs | jq  -r '[ .[] | select(.dpms and .active) ] | length'\n\n\n### ~/bin/sway/sway-active-monitor-ids\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    swaymsg -t get_outputs | jq  -r 'sort_by(.rect.x) | .[] | select(.dpms and .active) | .name'\n\n\n### ~/bin/sway/sway-active-monitor-names\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n     swaymsg -t get_outputs | jq  -r 'sort_by(.rect.x) | .[] |  select(.dpms and .active)|(.make + \" \" + .model + \" \" + .serial)'\n\n\n### ~/bin/sway/sway-autostart\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    if [ -f \"${HOME}/.SWAY_START\" ] \u0026\u0026 [ -z \"$SSH_CONNECTION\" ]; then\n        if  [ \"$(hostname)\" = \"xmgneo\" ];then\n            sway --my-next-gpu-wont-be-nvidia \u0026\n        else\n            sway \u0026\n        fi\n    fi\n\n\n### ~/bin/sway/sway-brightness-notify\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-notify \"☼:$(printf \"%.0f\" `brightnessctl g`)\"\n\n\n### ~/bin/sway/sway-bluetooth\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    exec sway-oneterminal \"bluetoothctl\" \"bluetoothctl\"\n\n\n### ~/bin/sway/sway-do-tool\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    \n    # NB ths is currently lazy. It uses brute force, and i need to do some get_tree jq stuff instead to\n    # get the app_id/class instance instead. But.. it works.\n    id=\"$1\"\n    script=\"$2\"\n    [ -z \"$id\" ] \u0026\u0026 echo \"usage: sway-do-tool id\" \u0026\u0026 exit 1\n    if swaymsg \"[title=${id}] focus\" \u0026\u003e /dev/null; then\n        :\n    else\n        if  swaymsg \"[class=${id}] focus\" \u0026\u003e /dev/null; then\n            :\n        else\n            if  swaymsg \"[app_id=${id}] focus\" \u0026\u003e /dev/null; then\n                :\n            else\n                if [ ! -z \"$script\" ]; then\n                    eval \"$script\" \u0026\n                else\n                    exit 1\n                fi\n            fi\n        fi\n    fi\n    exit 0\n\n\n### ~/bin/sway/sway-oneterminal\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    \n    sessionname=\"${1:-`pwd`}\"\n    title=\"${ONETERM_TITLE:-${sessionname}}\"\n    script=\"${2}\"\n    if ! sway-do-tool \"$title\"; then\n        kitty --title \"${title}\" -e tmux new-session -A -s ${sessionname} ${script} \u0026\n    else\n        if ! tmux has-session -t  \"${sessionname}\"; then\n            tmux attach -t \"${sessionname}\"\n        fi\n    fi\n    exit 0\n\n\n### ~/bin/sway/sway-dpms\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    DPMS=\"${1:-on}\"\n    DISP=\"${2:-*}\"\n    currentDPMS=\"$(swaymsg -t get_outputs | jq -r '.[0]'.dpms)\"\n    [ \"$dpms\" != \"$currentDPMS\" ] \u0026\u0026 swaymsg \"output $DISP DPMS $DPMS\"\n\n\n### ~/bin/sway/sway-htop\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    exec sway-oneterminal \"Processes\" btop\n\n\n### ~/bin/sway/sway-kanshi\n\nMonitor control with hotplug \u003chttps://github.com/emersion/kanshi\u003e\nLoad a host specific kanshi file if it exists\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    # pidof kanshi \u0026\u0026 echo \"kanshi process $(pidof kanshi) already running. Exiting.\" \u0026\u0026 exit 0\n    pkill kanshi\n    config=\"${HOME}/.config/kanshi/config-$(hostname)\"\n    if [ -f  \"$config\" ]; then\n        echo  \"kanshi -c $config\"\n        kanshi -c \"$config\"\n    else\n        echo \"kanshi default config\"\n        kanshi\n    fi\n\n1.  config\n\n        profile {\n        output eDP-1 enable position 0,0\n        }\n\n2.  config-um690\n\n        {\n        output HDMI-A-1  enable mode 2560x1440 position 0,0\n        output HDMI-A-2  enable mode 1920x1080 position 2560,116\n        }\n\n3.  config-t14s\n\n        profile home-dp{\n        output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0\n        output 'Synaptics Inc Non-PnP 0x00BC614E' mode 1920x1080 position 2560,0\n        output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080\n        }\n        profile home-hdmi{\n        output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0\n        output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0\n        output 'AU Optronics 0x573D Unknown' mode 1920x1080 position 3000,1080\n        }\n        profile home-no-lap{\n        output 'ASUSTek COMPUTER INC ASUS PB278QV 0x00030ADB' mode 2560x1440 position 0,0\n        output 'HKC OVERSEAS LIMITED 22N1 0000000000001' mode 1920x1080 position 2560,0\n        }\n\n4.  config-xmgneo\n\n        {\n        output eDP-1 enable enable mode 2560x1440  position 0,0\n        }\n        \n        {\n        output eDP-1 enable mode 2560x1440 position 2560,0\n        output HDMI-A-1  enable mode 2560x1440 position 0,0\n        }\n        \n        {\n        output eDP-1 enable mode 2560x1440 position 2560,0\n        output DP-1  enable mode 2560x1440 position 0,0\n        }\n\n5.  config-thinkpadt460\n\n        profile {\n        output eDP-1 enable mode 1366×768   position 0,0\n        }\n        \n        profile {\n        output eDP-1 enable mode 1366×768  position 1920,0\n        output DP-4 enable mode 1920x1080 position 0,0\n        }\n\n6.  config-x1c6\n\n        profile {\n        output eDP-1 enable mode 1920x1080  position 0,0\n        }\n        \n        profile {\n        output eDP-1 disable\n        output DP-1 enable mode 2560x1440 position 0,0\n        }\n        \n        profile {\n        output eDP-1 disable\n        output HDMI-A-1 enable mode 2560x1440 position 0,0\n        }\n\n7.  config-x13amdg4\n\n        profile {\n        output eDP-1 enable mode 1920x1200  position 0,0\n        }\n\n\n### ~/bin/sway/sway-lock-utils\n\nJust a gathering place of locky/suspendy type things\u0026#x2026;\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    lock() {\n        pidof swaylock || swaylock -f -i ~/Pictures/LockScreen/current -s fill -c 000000\n        sway-notify \"unlocked\"\n    }\n    \n    lock_gpg_clear() {\n        [ \"$1\" = gpg_clear ] \u0026\u0026  (echo RELOADAGENT | gpg-connect-agent \u0026\u003e/dev/null )\n        lock\n    }\n    \n    case \"$1\" in\n        lock)\n            lock\n            ;;\n        lock_gpg_clear)\n            lock_gpg_clear\n            ;;\n        logout)\n            swaymsg exit\n            ;;\n        suspend)\n            systemctl suspend\n            ;;\n        hibernate)\n            systemctl hibernate\n            ;;\n        reboot)\n            systemctl reboot\n            ;;\n        shutdown)\n            systemctl poweroff\n            ;;\n        blank)\n            sway-dpms off\n            [ -f \"${HOME}/.screen-blank.local\" ] \u0026\u0026 . \"${HOME}/.screen-blank.local\"\n            ;;\n        unblank)\n            sway-dpms on\n            [ -f \"${HOME}/.screen-unblank.local\" ] \u0026\u0026 . \"${HOME}/.screen-unblank.local\"\n            ;;\n        *)\n            lock\n            ;;\n    esac\n    \n    exit 0\n\n\n### swayidle, ~/bin/sway/sway-idle     :sleep:lock:idle:\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    pkill swayidle\n    exec swayidle -w \\\n         timeout 1 '' \\\n         resume 'sway-lock-utils unblank' \\\n         timeout 10 'pidof swaylock \u0026\u0026 sway-lock-utils blank' \\\n         resume 'sway-lock-utils unblank' \\\n         timeout ${SWAYIDLEHOOK_BLANK:-3600} 'sway-lock-utils blank' \\\n         resume 'sway-lock-utils unblank' \\\n         timeout ${SWAYIDLEHOOK_LOCK:-14400} 'sway-lock-utils lock' \\\n         resume 'sway-lock-utils unblank' \\\n         timeout ${SWAYIDLEHOOK_SUSPEND:-0} 'sway-lock-utils suspend' \\\n         resume 'sway-lock-utils unblank' \\\n         lock 'sway-lock-utils lock' \\\n         unlock 'sway-lock-utils unblank' \\\n         before-sleep 'sway-lock-utils lock'\n\n1.  SWAY-IDLE DEFAULTS\n\n    Not exported : add to .profile.local\n    \n        export SWAYIDLEHOOK_BLANK=300\n        export SWAYIDLEHOOK_LOCK=3600\n        export SWAYIDLEHOOK_SUSPEND=0\n\n\n### ~/bin/sway/sway-laptop-id\n\nHere 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`\nbut in both cases we check if it exists in the sway tree, and, if not, set it t the last\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    id=\"${LAPTOP_ID:-'eDP-1'}\"\n    id=$( swaymsg -t get_outputs | jq -r \".[] | select (.name == \\\"${id}\\\") | .name\")\n    if [ -z  \"$id\" ];then\n        id=$(swaymsg -t get_outputs | jq -r '.[-1].name')\n    fi\n    echo $id\n\n\n### ~/bin/sway/sway-lock\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-lock-utils lock\n\n\n### ~/bin/sway/sway-blank\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-lock-utils blank\n\n\n### ~/bin/sway/sway-notify\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    notify-send -t ${2:-5000} \"${1}\" || true\n\n\n\u003ca id=\"org54adcd1\"\u003e\u003c/a\u003e\n\n### ~/bin/sway/sway-screen\n\n`enable` or `disable`. Won't allow you to turn off the sole enabled display.\n\n:ID:       82455cae-1c48-48b2-a8b3-cb5d44eeaee9\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    m=\"${2:-$(swaymsg -t get_outputs | jq -r '.[0].name')}\"\n    c=\"${1:-enable}\"\n    [ \"$c\" = \"disable\" ] \u0026\u0026 [ \"$(sway-active-monitors-count)\" = \"1\" ] \u0026\u0026 sway-notify \"Not turning off single display $m\" \u0026\u0026 exit 1\n    swaymsg \"output ${m} ${c}\"\n    (sleep 2 \u0026\u0026 sway-notify \"${m}:${c}\") \u0026\n\n\n### ~/bin/sway/sway-workspace-position\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    mapfile -t outputs  \u003c \u003c( sway-active-monitor-ids )\n    export leftOutput=${outputs[0]}\n    export rightOutput=${outputs[1]}\n    export rightMostOutput=${outputs[2]}\n    \n    rightOutput=${rightOutput:-${leftOutput}}\n    rightMostOutput=${rightMostOutput:-${rightOutput}}\n    \n    sway-notify \"Left:${leftOutput}, Right:${rightOutput}, Rightmost: ${rightMostOutput}\"\n    curr=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .name')\n    \n    # swaymsg \"output * bg ~/Pictures/Wallpapers/current fill\"\n    swaybg -o $leftOutput -i ${HOME}/Pictures/Wallpapers/s1 -m fill \u0026\n    \n    if [ \"$leftOutput\" != \"$rightOutput\" ]; then\n        swaybg -o  ${rightOutput} -i ${HOME}/Pictures/Wallpapers/s2 -m fill \u0026\n        if [ \"$rightOutput\" != \"${rightMostOutput}\" ]; then\n            swaybg -o ${rightMostOutput} -i ${HOME}/Pictures/Wallpapers/s3 -m fill  \u0026\n        fi\n    fi\n    \n    swaymsg \"\n       workspace 1; move workspace to output $leftOutput;\n       workspace 2; move workspace to output $rightOutput;\n       workspace 3; move workspace to output $leftOutput;\n       workspace 4; move workspace to output $rightOutput;\n       workspace 5; move workspace to output $rightOutput;\n       workspace 6; move workspace to output $rightMostOutput;\n       workspace 7; move workspace to output $rightMostOutput;\n       workspace 8; move workspace to output $rightMostOutput;\n       workspace $curr;\n     \"\n\n\n### ~/bin/sway/sway-workspace-populate\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    swaymsg \"workspace 8; layout stacking;sleep 0.3;\"\n    sway-www \"https://web.whatsapp.com/\"\n    sway-www \"https://web.telegram.org/k/\"\n    sway-www \"https://reddit.com/\"\n    sway-www \"https://mail.google.com/mail/u/0/#inbox\"\n    sleep 0.3\n\n\n### ~/bin/sway/sway-workspace-populate-conditional\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if [ -f \"${HOME}/.sway-workspace-populate\" ]; then\n        sway-workspace-populate\n    elif [ -f \"${HOME}/.sway-workspace-populate-user\" ]; then\n        source \"${HOME}/.sway-workspace-populate-user\"\n    # else\n    #     emacsclient -c -a \"\" \u0026\n    fi\n\n\n### ~/bin/sway/sway-screen-menu\n\nGui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#org54adcd1).\n\n:ID:       82455cae-1c48-48b2-a8b3-cb5d44eeaee9\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    m=$(swaymsg -t get_outputs | jq -r '.[] |  \"\\(.name)\\n\\(.active)\"'  | zenity  --title \"Select Display\" --list  --text \"\" --column \"Monitor\" --column \"Enabled\")\n    if [ ! -z \"$m\" ]; then\n        c=\"$(zenity  --list  --title \"Enable ${m}?\" --text \"\" --radiolist  --column \"Pick\" --column \"Enabled\" TRUE enable FALSE disable)\"\n        if [ ! -z \"$c\" ]; then\n            sway-screen $c $m\n        fi\n    fi\n    exit 0\n\n\n### ~/bin/sway/sway-display-swap\n\n\u003chttps://i3wm.org/docs/user-contributed/swapping-workspaces.html\u003e\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    \n    DISPLAY_CONFIG=($(swaymsg -t get_outputs | jq -r '.[]|\"\\(.name):\\(.current_workspace)\"'))\n    \n    for ROW in \"${DISPLAY_CONFIG[@]}\"\n    do\n        IFS=':'\n        read -ra CONFIG \u003c\u003c\u003c \"${ROW}\"\n        if [ \"${CONFIG[0]}\" != \"null\" ] \u0026\u0026 [ \"${CONFIG[1]}\" != \"null\" ]; then\n            echo \"moving ${CONFIG[1]} right...\"\n            swaymsg -- workspace --no-auto-back-and-forth \"${CONFIG[1]}\"\n            swaymsg -- move workspace to output right\n        fi\n    done\n\n\n### ~/bin/sway/sway-launcher-wofi\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    exec dmenu_path | wofi --show drun,dmenu -i | xargs swaymsg exec --\n\n\n### ~/bin/sway/sway-launcher-rofi\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    exec rofi -combi-modi window,drun,ssh,run -show combi -show-icons\n\n\n### ~/bin/sway/sway-launcher-fzf\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    exec kitty --title \"sway-launcher\" -e bash -c \"dmenu_path | fzf | xargs swaymsg exec\"\n\n\n### ~/bin/sway/sway-launcher-ulauncher\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if ! pgrep \"ulauncher\"; then\n        ulauncher\n    else\n        ulauncher-toggle\n    fi\n\n\n### ~/bin/sway/sway-launcher\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-launcher-fzf\n\n\n### ~/bin/sway/sway-screenshot\n\nThanks: \u003chttps://www.reddit.com/r/linuxmasterrace/comments/k1bjkp/i_wrote_a_trivial_wrapper_for_taking_screenshots/\u003e\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    # thanks to: https://www.reddit.com/r/linuxmasterrace/comments/k1bjkp/i_wrote_a_trivial_wrapper_for_taking_screenshots/\n    \n    DIR=${HOME}/tmp/Screenshots\n    \n    mkdir -p \"${DIR}\"\n    \n    FILENAME=\"screenshot-$(date +%F-%T).png\"\n    sway-notify \"use the mouse to select region..\"\n    region=\"$(slurp)\"\n    if [ ! -z \"$region\" ]; then\n        sway-notify \"Taking pic in 5s..\"\n        sleep 5\n        grim -g \"$region\" \"${DIR}\"/\"${FILENAME}\" || exit 1\n        #Create a link, so don't have to search for the newest\n        ln -sf \"${DIR}\"/\"${FILENAME}\" \"${DIR}\"/screenshot-latest.png\n        sway-notify \"Done! see ${DIR}/screenshot-latest.png\"\n    fi\n\n\n### ~/bin/sway/sway-screen-recorder\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if pgrep -x \"wf-recorder\"; then\n        sway-notify \"stopping wf-recorder\"\n        # sigint\n        kill -2 $(pgrep wf-recorder)\n    else\n        sway-notify \"starting wf-recorder\"\n        wf-recorder -f ${HOME}/tmp/output.mkv -g \"$(slurp)\"\n    fi\n\n\n### ~/bin/sway/sway-volume-notify\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if [[ \"$1\" = \"0\" ]]; then\n        wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle\n    elif [[ \"$1\" =  \"+\" ]]; then\n        wpctl set-volume @DEFAULT_AUDIO_SINK@ \"0.1+\"\n    elif [[ \"$1\" = \"-\" ]]; then\n        wpctl set-volume @DEFAULT_AUDIO_SINK@ \"0.1-\"\n    fi\n    \n    \n    volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)\n    volumep=$(echo $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | tr -dc '0-9')| sed 's/^0*//')\n    if [[ -z $volumep ]]; then\n        volumep=\"0\"\n    elif [[ $volumep -gt \"150\" ]];then\n        volumep=\"150\"\n        wpctl set-volume @DEFAULT_AUDIO_SINK@ 1\n    fi\n    if [[ \"$volume\" == *\"MUTED\"* ]]; then\n        sway-notify \"🔊 MUTED (${volumep}%) \"\n    else\n        sway-notify \"🔊${volumep}%\"\n    fi\n\n\n### ~/bin/sway/sway-weather\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-www \"https://www.accuweather.com/en/de/gr%C3%B6mitz/23743/hourly-weather-forecast/176248\"\n\n\n### sway-nvidia     :nvidia:dgpu:\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway --my-next-gpu-wont-be-nvidia \"$@\"\n\n\n### ~/bin/sway/sway-www\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-chrome \"$@\" \u0026\n\n\n### ~/bin/sway/sway-email\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    MOZ_ENABLE_WAYLAND=1 firefox --name=wwwemail --new-window \"https://www.gmail.com\" \u0026\n\n\n### ~/bin/sway/sway-chrome\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n     google-chrome --hide-crash-restore-bubble --new-window \"$@\"  \u0026\n\n\n### ~/bin/sway/sway-firefox\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    MOZ_ENABLE_WAYLAND=1 firefox --new-window \"$1\" \u0026\u003e/dev/null \u0026\n\n\n### ~/bin/sway/sway-wifi\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sway-oneterminal \"wifi\" \"nmtui\"  \u0026\u003e/dev/null\n\n\n## wayland utils\n\n\n### mako notificiation\n\n    default-timeout=10000\n\n\n### wlogout\n\n1.  readme\n\n        Layout maintained in linux-config.org\n        https://github.com/ArtsyMacaw/wlogout/blob/master/layout\n\n2.  layout config\n\n        {\n        \"label\" : \"lock\",\n        \"action\" : \"sway-lock-utils lock\",\n        \"text\" : \"Lock(l)\",\n        \"keybind\" : \"l\"\n        }\n        {\n        \"label\" : \"blank\",\n        \"action\" : \"sway-lock-utils blank\",\n        \"text\" : \"Blank(b)\",\n        \"keybind\" : \"b\"\n        }\n        \n        {\n        \"label\" : \"logout\",\n        \"action\" : \"sway-lock-utils logout\",\n        \"text\" : \"Logout(e)\",\n        \"keybind\" : \"e\"\n        }\n        {\n        \"label\" : \"suspend\",\n        \"action\" : \"sway-lock-utils suspend\",\n        \"text\" : \"Suspend(s)\",\n        \"keybind\" : \"s\"\n        }\n        \n        {\n        \"label\" : \"reboot\",\n        \"action\" : \"sway-lock-utils reboot\",\n        \"text\" : \"Reboot(r)\",\n        \"keybind\" : \"r\"\n        }\n        {\n        \"label\" : \"shutdown\",\n        \"action\" : \"sway-lock-utils shutdown\",\n        \"text\" : \"Shutdown(S)\",\n        \"keybind\" : \"S\"\n        }\n\n3.  layout style\n\n        * {\n                background-image: none;\n                box-shadow: none;\n        }\n        \n        window {\n                background-color: rgba(12, 12, 12, 0.9);\n        }\n        \n        button {\n            border-radius: 0;\n            border-color: black;\n                text-decoration-color: #FFFFFF;\n            color: #FFFFFF;\n                background-color: #1E1E1E;\n                border-style: solid;\n                border-width: 1px;\n                background-repeat: no-repeat;\n                background-position: center;\n                background-size: 25%;\n        }\n        \n        /* button:focus, button:active, button:hover { */\n        /* \tbackground-color: #3700B3; */\n        /* \toutline-style: none; */\n        /* } */\n        \n        #lock {\n            background-image: image(url(\"/usr/share/wlogout/icons/lock.png\"), url(\"/usr/local/share/wlogout/icons/lock.png\"));\n        }\n        \n        #blank {\n            background-image: image(url(\"blank.png\"),url(\"blank.png\"));\n        }\n        \n        #logout {\n            background-image: image(url(\"/usr/share/wlogout/icons/logout.png\"), url(\"/usr/local/share/wlogout/icons/logout.png\"));\n        }\n        \n        #suspend {\n            background-image: image(url(\"/usr/share/wlogout/icons/suspend.png\"), url(\"/usr/local/share/wlogout/icons/suspend.png\"));\n        }\n        \n        #hibernate {\n            background-image: image(url(\"/usr/share/wlogout/icons/hibernate.png\"), url(\"/usr/local/share/wlogout/icons/hibernate.png\"));\n        }\n        \n        #shutdown {\n            background-image: image(url(\"/usr/share/wlogout/icons/shutdown.png\"), url(\"/usr/local/share/wlogout/icons/shutdown.png\"));\n        }\n        \n        #reboot {\n            background-image: image(url(\"/usr/share/wlogout/icons/reboot.png\"), url(\"/usr/local/share/wlogout/icons/reboot.png\"));\n        }\n\n\n# Programming Related     :programming:\n\n\n## clang-format\n\nclangd lsp formatting\n\n    # Maintained in linux-config.org\n    BasedOnStyle: Google\n    Language: Cpp\n    IndentWidth: 4\n    AllowShortBlocksOnASingleLine: false\n    AllowShortCaseLabelsOnASingleLine: false\n    AllowShortFunctionsOnASingleLine: false\n    AllowShortIfStatementsOnASingleLine: false\n    AllowShortLoopsOnASingleLine: false\n    AccessModifierOffset: -4\n    PointerAlignment: Left\n    ColumnLimit: 80\n    KeepEmptyLinesAtTheStartOfBlocks: true\n\n\n## dart/flutter     :dart:flutter:\n\n\u003chttps://dart.dev/get-dart#install-a-debian-package\u003e\n\u003chttps://docs.flutter.dev/get-started/install/linux\u003e\n\n\n### path\n\n    export PATH=\"${HOME}/bin/thirdparty/flutter/bin:$PATH\"\n\n\n## llvm     :llvm:\n\n\n### path\n\n    export PATH=\"${HOME}\"/bin/llvm:\"${HOME}\"/bin/llvm/build/bin:\"$PATH\"\n\n\n### lldb     :lldb:\n\n1.  ~/.lldbinit\n\n        # Maintained in linux-config.org\n        \n        #settings write -f .lldb-settings-local-start\n        #settings read  -f .lldb-settings-local\n        \n        settings set target.load-cwd-lldbinit true\n        settings set interpreter.prompt-on-quit false\n        settings set target.x86-disassembly-flavor intel\n        \n        command alias bfl breakpoint set -f %1 -l %2\n        command alias lv command script import \"~/bin/thirdparty/pyenv/versions/3.9.2/lib/python3.9/site-packages/voltron/entry.py\"\n        command alias sl source list -a $rip\n        command alias so thread step-out\n        #auto breaks  - annotate code with labels eg debug_inspect__var_of_interest\n        command alias b_inspect breakpoint set -p \"debug_inspect_\"\n        command alias b_call breakpoint set -p \"debug_call_\"\n        \n        # regexp break points arent pending/deferred\n        #b_inspect\n        #b_call\n        \n        command regex rlook 's/(.+)/image lookup -rn %1/'\n        \n        #breg X will break at *X* labels\n        command regex breg 's/(.+)/breakpoint set -p \"%1\"/'\n        #bdeb X will break at debug*X labels\n        command regex bdeb 's/(.+)/breakpoint set -p \"debug_(.+)%1\"/'\n        #bcall X will break at debug_call__X labels\n        command regex bcall 's/(.+)/breakpoint set -p \"debug_call__%1\"/'\n        #binsp X will break at debug_inspect__X labels\n        command regex binsp 's/(.+)/breakpoint set -p \"debug_inspect__%1\"/'\n        \n        command regex srcb 's/([0-9]+)/settings set stop-line-count-before %1/'\n        srcb 2\n        command regex srca 's/([0-9]+)/settings set stop-line-count-after %1/'\n        srca 3\n        \n        settings set stop-disassembly-display no-debuginfo\n        \n        #step into stl\n        settings set target.process.thread.step-avoid-regexp \"\"\n        \n        \n        #alias vtty = shell tmux-pane-tty voltron 4\n        \n        #define voltron-source-tty\n        #shell tmux-pane-tty\n        #end\n\n2.  scripts\n\n    1.  ~/bin/llvm/disassembly\\_mode.py\n    \n        [disassembly\\_mode.py](directories/bin/lldb/disassembly_mode.py)\n    \n    2.  ~/bin/llvm/lldb-ui-session\n    \n        Create a session but let someone else do the attach\n        \n            #!/usr/bin/env bash\n            # Maintained in linux-config.org\n            \n            # create a lldb debug session unless it already exists.\n            # the -d to new session says \"dont attach to current terminal\"\n            # there is a bug where the splt panes split that of a tmux session in the terminal\n            # we issue the command from. No idea why or how.\n            # directory=\"$(realpath -s \"${1:-`pwd`}\")\"\n            directory=\"${1:-`pwd`}\"\n            session=\"${2:-\"voltron-$(basename \"$directory\")\"}\"\n            if ! TMUX= tmux has-session -t \"$session\" \u0026\u003e /dev/null; then\n            \n                tmux new-session -d -c \"$directory\" -s \"$session\" 'voltron-source 32'\n                firstPane=$(tmux display-message -p \"#{pane_id}\")\n                firstWindow=$(tmux display-message -p \"#{window_id}\")\n            \n                srcPane=\"$firstPane\"\n            \n                tmux splitw -h -p 70 -t \"$srcPane\" voltron-disassembly-mixed\n                disassPane=$(tmux display-message -p \"#{pane_id}\")\n            \n            \n                tmux splitw -v -p 30 -t \"$srcPane\" voltron-locals\n                localsPane=$(tmux display-message -p \"#{pane_id}\")\n            \n                tmux new-window voltron-disassembly \u0026\u003e /dev/null\n                sourcePane=$(tmux display-message -p \"#{pane_id}\")\n            \n                tmux splitw -v -p 30 -t \"$sourcePane\" voltron-locals\n                localsPane=$(tmux display-message -p \"#{pane_id}\")\n            \n                tmux splitw -h -p 70 -t \"$sourcePane\" voltron-registers\n                registersPane=$(tmux display-message -p \"#{pane_id}\")\n            \n                tmux splitw -h -p 70 -t \"$localsPane\" voltron-backtrace\n                backTracePane=$(tmux display-message -p \"#{pane_id}\")\n            \n                tmux select-window -t \"$firstWindow\"\n                tmux select-pane -t \"$firstPane\"\n            \n            fi\n            echo \"$session\"\n    \n    3.  ~/bin/llvm/lldb-ui\n    \n            #!/usr/bin/env bash\n            # Maintained in linux-config.org\n            directory=\"${1:-`pwd`}\"\n            session=\"$(lldb-ui-session \"${directory}\" \"$2\")\"\n            ONETERM_TITLE=\"dbg:lldb-$session\"  sway-oneterminal \"$session\"\n    \n    4.  lldb voltron scripts\n    \n        1.  ~/bin/llvm/voltron-backtrace\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'thread backtrace'\n        \n        2.  ~/bin/llvm/voltron-breakpoints\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'breakpoint list'\n        \n        3.  ~/bin/llvm/voltron-disassembly\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'disassemble --pc --context '\"${1:-4}\"' --count '\"${2:-4}\"''\n        \n        4.  ~/bin/llvm/voltron-disassembly-mixed\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'disassemble --mixed --pc --context '\"${1:-1}\"' --count '\"${2:-32}\"''\n        \n        5.  ~/bin/llvm/voltron-locals\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'frame variable' --lexer c\n        \n        6.  ~/bin/llvm/voltron-registers\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v registers\n        \n        7.  ~/bin/llvm/voltron-source\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v c 'source list -a $rip -c '\"${1:-32}\"''\n        \n        8.  ~/bin/llvm/voltron-stack\n        \n                #!/usr/bin/env bash\n                # Maintained in linux-config.org\n                voltron v stack\n    \n    5.  lldb python scripting     :python:\n    \n        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.\n        \n        \u003chttps://lldb.llvm.org/use/python.html\u003e\n        \n        1.  TODO follow up on SE post\n        \n            \u003chttps://stackoverflow.com/questions/68207020/trying-to-run-pdb-in-an-imported-lldb-python-script-results-in-error-attributeer\u003e\n\n\n## gdbgui\n\n\u003chttps://www.gdbgui.com/\u003e\n\n\n### fix for python 3.9\n\n    export PURE_PYTHON=1\n\n\n## haskell\n\n    # haskell\n    #source \"${HOME}/.ghcup/env\"\n\n\n## python\n\n\n### pyvenv  \u003chttps://github.com/pyenv/pyenv#installation\u003e\n\n1.  add pyenv to path\n\n        export PYENV_ROOT=\"${HOME}/bin/thirdparty/pyenv\"\n        export PATH=\"$PYENV_ROOT/bin:$PATH\"\n        eval \"$(pyenv init --path)\"\n\n\n### Debuggers     :debuggers:\n\n1.  pdb     :pdb:\n\n    \u003chttps://docs.python.org/3/library/pdb.html\u003e\n    The official python debugger\n    [/home/rgr/development/projects/Python/debugging/pdb](file:///home/rgr/development/projects/Python/debugging/pdb)\n\n2.  ipdb     :ipdb:\n\n    \u003chttps://pypi.org/project/ipdb/\u003e\n    \n    1.  installing\n    \n            pip install ipdb\n    \n    2.  Better Python Debugging\n    \n        \u003chttps://hasil-sharma.github.io/2017-05-13-python-ipdb/\u003e\n    \n    3.  ~/.ipdb\n    \n            # Maintained in linux-config.org\n            context=5\n\n\n## platformio     :platformio:\n\n    # platformio integration - point to pio ide (vscode) stuff.\n    export PATH=\"${PATH}:${HOME}/.platformio/penv/bin\"\n\n\n## Android     :android:\n\n\n### Sdk     :sdk:\n\n    # android sdk\n    export ANDROID_HOME=\"${HOME}/development/Android/Sdk\"\n    export PATH=\"${PATH}:${ANDROID_HOME}/emulator\"\n    export PATH=\"${PATH}:${ANDROID_HOME}/platform-tools\"\n    \n    export ANDROID_STUDIO_HOME=\"${HOME}/bin/thirdparty/android-studio\"\n    export PATH=\"${PATH}:${ANDROID_STUDIO_HOME}/bin\"\n\n\n## node.js\n\n\n### nvm\n\n[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.\n\n    lts/*\n\n    export NVM_DIR=\"$HOME/.config/nvm\"\n    [ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 . \"$NVM_DIR/nvm.sh\"  # This loads nvm\n\n    export NVM_DIR=\"$HOME/.config/nvm\"\n    [ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 . \"$NVM_DIR/nvm.sh\"  # This loads nvm\n\n\n### snap\n\n    export PATH=\"/snap/bin:$PATH\"\n\n\n## stm32     :embedded:stm32:\n\n\n### stm32cubeide     :stm32cubeide:\n\n1.  path\n\n        # platformio integration - point to pio ide (vscode) stuff.\n        export PATH=\"${PATH}:${HOME}/bin/thirdparty/stm32cubeide_1.9.0\"\n\n2.  install / uninstall\n\n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        version=\"${1:-${STM32CUBEIDE_VERSION:-\"1.9.0\"}}\"\n        echo \"Removing st-stm32cubeide-${version}\"\n        sudo dpkg -r st-stm32cubeide-\"$version\"\n        sudo dpkg -r st-stlink-server\n        sudo dpkg -r st-stlink-udev-rules\n        sudo dpkg -r segger-jlink-udev-rules\n\n3.  STM32CubeMX app\n\n    This is a bit defunct now (may 2022) as they have packaged their code into exes. Also there is a wayland exe.\n    \n    :ID:       b9b221b0-510f-415b-8819-c96b6e00a1d9\n    :header-args:tangle: no\n    \n        #!/usr/bin/env bash\n        #Maintained in linux-config.org\n        java -jar ~/bin/thirdparty/STM32CubeMX/STM32CubeMX\n    \n    1.  sway\n    \n            for_window [class=\"STM32CubeIDE\"] floating enable\n            assign [class=\"STM32CubeIDE\"] 3\n            assign [title=\"STM32CubeIDE\"] 3\n\n4.  launcher for X11 compatability\n\n    pending deletion\n    \n        #!/usr/bin/env bash\n        # Maintained in linux-config.org\n        JAVA_AWT_WM_NONREPARENTING=1 GDK_BACKEND=x11 exec \"/opt/st/stm32cubeide_${STM32CUBEIDE_VERSION:-\"1.7.0\"}/stm32cubeide\"\n\n\n# PGP/GNUPG/GPG\n\n\n## ~/.gnupg/gpg.conf\n\n    # Maintained in linux-config.org\n    use-agent\n\n\n## ~/.gnupg/gpg-agent.conf\n\n    # Maintained in linux-config.org\n    #gpg-preset-passphrase\n    allow-preset-passphrase\n    pinentry-program /usr/bin/pinentry\n    max-cache-ttl 86400\n    default-cache-ttl 86400\n    max-cache-ttl-ssh 86400\n    default-cache-ttl-ssh 86400\n    enable-ssh-support\n\n\n## ~/.profile\n\n    export USER_STARTX_START=\n\n\n## ~/.profile.local\n\npotentially need some gpg keys : not tangled\n\n\n### keys     :crypt:\n\n\u0026#x2013;\u0026#x2014;BEGIN PGP MESSAGE\u0026#x2013;\u0026#x2014;\nhQEMA7IjL5SkHG4iAQgAnAMLgodgtOc1tsGz6mRqJbkJsM+R+5MTPdsOdml6xMoL\nxFZjkYTDUGa3G6PsQHpbJ/tjD+6B4qmZIymq1EReWPtrepGGN6DNG8hLPVNnQ+9N\nWAFaK1o+gzzfsw9XuptT5Um47k2G3zm019mGKDe0OwYJJ/r/DTHpz9yI9nj5lVdq\nsdk0Y/WQL/5mcraC7LPz0FhIhuXqKKFNvcQCA6D0fTWJxlzqvXRzuc44LN+mvozq\n9Q4WbvXp/etZjeiUYjXmz70KEYxFIch3OR4EGmV41apfojLTmR9R2dp/u3jYexMy\nNlXugS5egyP+ioiuuTcCsSjN4rxnDwSW868lLkdhIdLAPgFdxEWpJjtaJO0A9aIB\n6lJTRLKPzuwTyGiyRdKO8yqYFYwllgfEr/87qcB/ajjRpkhw9tlD8zTrODt4ZUu2\nMQQHK2rzvplmgDf2LvDMiM2gv7z4bI3YzOTiGu6m+SxW/j8LA71WRMwhFmUObgOb\ng44XzdKHAV0o0Q/ZPPnJU4dlKc9nRkNS3MzpORmUGAT1/FSwt+q7uzpuBTZ1crGl\nP/fo8sDBBu2QBoL2+gQZ11l7uSZMjTCR/8msBO5LbLDmyOUposbv6va1dzPN898F\nZsaqN9VNjV2b75kQiPJsZaoekClV7yOFc10/VRKBFD1MlspEovrIpReI9by6azIU\n=nb0T\n\u0026#x2013;\u0026#x2014;END PGP MESSAGE\u0026#x2013;\u0026#x2014;\n\n\n# Email Related\n\n\n## mu4e  - mu for Emacs\n\n[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)\n\n\n## Maildir sync using [mbsync](https://wiki.archlinux.org/index.php/Isync) inspired by the [SystemCrafters](https://www.youtube.com/watch?v=yZRyEhi4y44\u0026ab_channel=SystemCrafters\u0026loop=0) video.\n\nmaildir sync using mbsync\n\n\n### install isync and mu4e\n\nmu4e includes [mu](https://www.djcbsoftware.nl/code/mu/mu4e/Indexing-your-messages.html) for indexing.\n\n    sudo apt install isync mu4e\n\n\n### mbsync config\n\nNote the [PassCmd](https://wiki.archlinux.org/index.php/Isync) - since I use gpg then that's the way to go.\n\n    # Maintained in linux-config.org\n    Create  Both\n    Expunge Both\n    SyncState *\n    \n    IMAPAccount gmx\n    Host imap.gmx.com\n    User rileyrg@gmx.de\n    PassCmd \"pass Email/gmx/apps/mbsync\"\n    TLSType IMAPS\n    CertificateFile /etc/ssl/certs/ca-certificates.crt\n    PipelineDepth 1\n    \n    IMAPStore gmx-remote\n    Account gmx\n    \n    MaildirStore gmx-local\n    Path ~/Maildir/gmx/\n    Inbox ~/Maildir/gmx/INBOX\n    SubFolders Legacy\n    \n    Channel gmx-inbox\n    Far :gmx-remote:\"INBOX\"\n    Near :gmx-local:\"INBOX\"\n    \n    Channel gmx-sent\n    Far :gmx-remote:\"Gesendet\"\n    Near :gmx-local:\"Sent\"\n    \n    Channel gmx-learning\n    Far :gmx-remote:\"Learning\"\n    Near :gmx-local:\"Learning\"\n    \n    Channel gmx-drafts\n    Far :gmx-remote:\"Entw\u0026APw-rfe\"\n    Near :gmx-local:\"Drafts\"\n    \n    Channel gmx-bin\n    Far :gmx-remote:\"Gel\u0026APY-scht\"\n    Near :gmx-local:\"Bin\"\n    \n    Channel gmx-spam\n    Far :gmx-remote:\"Spamverdacht\"\n    Near :gmx-local:\"Spam\"\n    \n    Channel gmx-archive\n    Far :gmx-remote:\"Archiv\"\n    Near :gmx-local:\"Archive\"\n    \n    Group gmx\n    Channel gmx-inbox\n    Channel gmx-sent\n    Channel gmx-drafts\n    Channel gmx-bin\n    Channel gmx-spam\n    Channel gmx-archive\n    \n    Group gmx-special-interest\n    Channel gmx-learning\n    \n    IMAPAccount gmail\n    Host imap.gmail.com\n    User rileyrg@gmail.com\n    PassCmd \"pass Email/gmail/apps/mbsync\"\n    TLSType IMAPS\n    CertificateFile /etc/ssl/certs/ca-certificates.crt\n    PipelineDepth 32\n    \n    IMAPStore gmail-remote\n    Account gmail\n    \n    MaildirStore gmail-local\n    Path ~/Maildir/gmail/\n    Inbox ~/Maildir/gmail/INBOX\n    SubFolders Legacy\n    \n    Channel gmail-inbox\n    Far :gmail-remote:\"INBOX\"\n    Near :gmail-local:\"INBOX\"\n    \n    Channel gmail-sent\n    Far :gmail-remote:\"[Google Mail]/Sent Mail\"\n    Near :gmail-local:\"Sent\"\n    \n    Channel gmail-drafts\n    Far :gmail-remote:\"[Google Mail]/Drafts\"\n    Near :gmail-local:\"Drafts\"\n    \n    Channel gmail-bin\n    Far :gmail-remote:\"[Google Mail]/Bin\"\n    Near :gmail-local:\"Bin\"\n    \n    Channel gmail-spam\n    Far :gmail-remote:\"[Google Mail]/Spam\"\n    Near :gmail-local:\"Spam\"\n    \n    Channel gmail-archive\n    Far :gmail-remote:\"[Google Mail]/All Mail\"\n    Near :gmail-local:\"Archive\"\n    \n    Channel gmail-gmx-archive\n    Far :gmail-remote:\"[Google Mail]/All Mail\"\n    Near :gmx-local:\"gmail/Archive\"\n    \n    Group gmail\n    Channel gmail-inbox\n    Channel gmail-sent\n    Channel gmail-drafts\n    Channel gmail-bin\n    Channel gmail-spam\n    Channel gmail-archive\n    \n    Group gmail-gmx\n    Channel gmail-gmx-archive\n\n\n### sync and index\n\n    cd ~\n    mkdir -p ~/Maildir/gmail\n    mkdir -p ~/Maildir/gmx\n    mbsync gmail gmx\n    mu init --maildir=~/Maildir --my-address=\"riley**@gmx.de\" --my-address=\"riley**@gmail.com\"\n    mu index\n\n\n### mbsync services\n\n1.  ~/.config/systemd/user/mbsync.timer\n\n        [Unit]\n        Description=Mailbox synchronization timer\n        \n        [Timer]\n        OnBootSec=60\n        OnUnitActiveSec=3600\n        Unit=mbsync.service\n        \n        [Install]\n        WantedBy=timers.target\n\n2.  ~/.config/systemd/user/mbsync.service\n\n        [Unit]\n        Description=Mailbox synchronization service\n        \n        [Service]\n        Type=simple\n        ExecStart=/home/rgr/bin/getmails\n        \n        RuntimeMaxSec=1200\n    \n    and activate them\n    \n        systemctl --user enable mbsync.timer\n        systemctl --user start mbsync.timer\n\n\n## ~/bin/getmails\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if ! $(pidof -xq \"mbsync\"); then\n        if [ $# -eq 0 ]; then\n            mbsync -a\n        else\n            mbsync \"$@\"\n        fi\n    fi\n    exit 0\n\n\n# bin\n\n\n## ~/bin/arch-backup\n\nkeep the arch and aur packages installed backed up\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    pacman -Qqen \u003e ~/cloud/homefiles/etc/arch/pkglist-repo.txt\n    pacman -Qqem \u003e ~/cloud/homefiles/etc/arch/pkglist-aur.txt\n\n\n## ~/bin/arch-restore\n\ninstall packages from backup catalog\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    sudo pacman -S --needed - \u003c ~/cloud/homefiles/etc/arch/pkglist-repo.txt\n    pikaur -S --needed - \u003c ~/cloud/homefiles/etc/arch/pkglist-aur.txt\n\n\n## ~/bin/beepy\n\n    if [ -f /usr/share/sounds/freedesktop/stereo/suspend-error.oga ];then\n        paplay  /usr/share/sounds/freedesktop/stereo/suspend-error.oga\n    else\n        # sudo modprobe pcspkr\n        beep\n    fi\n\n\n## ~/bin/bluetooth-headphone-controls\n\nEnable bluetooth multimedia pause/ play\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    pkill mpris-proxy\n    mpris-proxy\n\n\n## ~/bin/edit\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    ${VISUAL:-${EDITOR:-vi}} \"${@}\"\n\n\n## ~/bin/eman\n\nUse emacs for manpages if it's running\nmight be an idea set an alias such as 'alias man=eman'\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    mp=\"${1:-man}\"\n    if pidof emacs; then\n        emacsclient -c -e \"(manual-entry \\\"-a ${mp}\\\")\" \u0026\u003e /dev/null \u0026\n    else\n        sway-oneterminal random-man \"man $mp\"\n    fi\n\n\n## ~/bin/expert-advice\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    f=$(command -v fortune \u0026\u003e/dev/null \u0026\u0026 fortune || echo \"I don't need to study a subject to have my own truths. Because own truths ARE a thing in 2020.\")\n    if [ \"$1\" = \"t\" ]\n    then\n        echo $f | xclip -i -selection clipboard\n    fi\n    echo $f\n\n\n## ~/bin/extract-debug-info\n\nstrip debug info and store elsewhere\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    scriptdir=`dirname ${0}`\n    scriptdir=`(cd ${scriptdir}; pwd)`\n    scriptname=`basename ${0}`\n    \n    set -e\n    \n    function errorexit()\n    {\n        errorcode=${1}\n        shift\n        echo $@\n        exit ${errorcode}\n    }\n    \n    function usage()\n    {\n        echo \"USAGE ${scriptname} \u003ctostrip\u003e\"\n    }\n    \n    tostripdir=`dirname \"$1\"`\n    tostripfile=`basename \"$1\"`\n    \n    \n    if [ -z ${tostripfile} ] ; then\n        usage\n        errorexit 0 \"tostrip must be specified\"\n    fi\n    \n    cd \"${tostripdir}\"\n    \n    debugdir=.debug\n    debugfile=\"${tostripfile}.debug\"\n    \n    if [ ! -d \"${debugdir}\" ] ; then\n        echo \"creating dir ${tostripdir}/${debugdir}\"\n        mkdir -p \"${debugdir}\"\n    fi\n    echo \"stripping ${tostripfile}, putting debug info into ${debugfile}\"\n    objcopy --only-keep-debug \"${tostripfile}\" \"${debugdir}/${debugfile}\"\n    strip --strip-debug  \"${tostripfile}\"\n    #objcopy --add-gnu-debuglink=\"${debugdir}/${debugfile}\" \"${tostripfile}\"\n    chmod -x \"${debugdir}/${debugfile}\"\n\n\n## ~/bin/htop-regexp\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    filter=\"${1:-\"$(zenity --entry --text \"HTop filter\" --title \"htop regexp\")\"}\"\n    [ -z \"$filter\" ] \u0026\u0026 exit 1\n    session=\"${2:-\"htop-filter-${filter//[^[:alnum:]]/}\"}\"\n    pids=$(ps aux | awk '/'\"${filter}\"'/ {print $2}' | xargs | sed -e 's/ /,/g')\n    if tmux has-session -t \"${session}\"; then\n        tmux kill-session -t \"${session}\"\n        sleep 0.1\n    fi\n    tmux new-session -d -s \"${session}\" \"htop -p $pids\"\n    sleep 0.1\n    ONETERM_TITLE=\"filtered htop:${filter}\" sway-oneterminal \"${session}\"\n\n\n## ~/bin/make-compile\\_commands\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    make --always-make --dry-run \\\n        | grep -wE 'gcc|g++' \\\n        | grep -w '\\-c' \\\n        | jq -nR '[inputs|{directory:\".\", command:., file: match(\" [^ ]+$\").string[1:]}]' \\\n             \u003e compile_commands.json\n\n\n## ~/bin/md-read\n\n     #!/usr/bin/env bash\n     #Maintained in linux-config.org\n    [ -z  $(command -v lynx) ] \u0026\u0026 echo \"install lynx\" \u0026\u0026 exit 1\n    [ -z  $(command -v pandoc) ] \u0026\u0026 echo \"install pandoc\" \u0026\u0026 exit 1\n    pandoc \"$1\" | lynx -stdin\n\n\n## ~/bin/random-man-page\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    page=\"$(find /usr/share/man/man1 -type f | sort -R | head -n1)\"\n    eman \"$page\"\n\n\n## ~/bin/remove-broken-symlinks\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    find -L . -name . -o -type d -prune -o -type l -exec rm {} +\n\n\n## ~/bin/remove-conflicted-copies\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    if [ \"$1\" == \"--f\" ]; then\n        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 {} \\;\n        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 {} \\;\n    \n    else\n        echo \"add --f to force deletion of conflicted copies\"\n        find ~/Dropbox/ -path \"*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*\" -print\n        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\n    fi\n\n\n## ~/bin/resgithub.sh\n\n[resgithub.sh - reset local and remote git repo](https://github.com/rileyrg/resgithub)\n\n    #!/usr/bin/bash\n    #Maintained in resgithub.org\n    tconfig=$(mktemp)\n    texclude=$(mktemp)\n    commitmsg=${1:-\"git repository initialised\"}\n    if [ -f .git/config ]; then\n        cp .git/config \"$tconfig\"\n        cp .git/info/exclude \"$texclude\"\n        rm -rf .git\n        git init .\n        mv \"$tconfig\" .git/config\n        mv \"$texclude\" .git/info/exclude\n        git add .\n        git commit -a -m \"$commitmsg\"\n    #    git push -f\n    else\n        echo \"test Warning: No git config file found. Aborting.\";exit;\n    fi\n\n\n## ~/bin/rsnapshot-if-mounted\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    mountpoint=${1:-\"/media/rsnapshot\"};\n    rsnapshottype=${2:-\"alpha\"};\n    if $(/usr/bin/mountpoint -q $mountpoint); then\n        echo \"$mountpoint is mounted\";\n        /usr/bin/rsnapshot -v \"$rsnapshottype\";\n    else\n        echo \"$mountpoint not mounted\";\n    fi;\n\n\n## ~/cloud/etc/rsnapshot/excludes\n\n    #Maintained in linux-config.org\n    - /home/rgr/.local/share/Steam/\n    - /home/rgr/Mail/\n    - /home/rgr/Maildir/\n    - OpenAudible/aax/\n    - OpenAudible/books/\n    - OpenAudible/current/\n    - cloud/.syncrclone/\n    - .syncrclone/logs/\n    - .syncrclone/backups/\n\n\n## ~/bin/sharemouse\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    exec ssh -X ${1-192.168.2.100} x2x -east -to :0\n\n\n## ~/bin/wifi-toggle\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    status=\"$(nmcli radio wifi)\"\n    if [ \"$status\" = \"enabled\" ]; then\n        nmcli radio wifi off\n        echo \"Wifi Off\"\n    else\n        nmcli radio wifi on\n        echo \"Wifi On\"\n    fi\n\n\n## ~/bin/enable-disable-wifi\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    \n    if LANG=C nmcli dev | grep -q '\\sethernet\\s\\+connected\\s'; then\n        if [ -f \"${HOME}\"/.wifi-and-eth ]; then\n            echo \"${HOME}/.wifi-and-eth exists so wifi on.\"\n            nmcli radio wifi on\n        else\n            echo \"Turning wifi  off\"\n            nmcli radio wifi off\n        fi\n    else\n        echo \"Turning wifi on\"\n        nmcli radio wifi on\n    fi\n\n\n## ~/bin/70-wifi-wired-exclusive.sh\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    # https://askubuntu.com/a/1272865/232407\n    export LC_ALL=C\n    \n    # This dispatcher script makes Wi-Fi mutually exclusive with wired networking. When a wired\n    #    interface is connected, Wi-Fi will be set to airplane mode (rfkilled). When the wired\n    #    interface is disconnected, Wi-Fi will be turned back on. Name this script e.g.\n    #    70-wifi-wired-exclusive.sh and put it into /etc/NetworkManager/dispatcher.d/ directory.\n    #    See NetworkManager(8) manual page for more information about NetworkManager dispatcher\n    #    scripts.\n    \n    if [ \"$2\" = \"up\" ]; then\n        enable-disable-wifi\n    fi\n    \n    if [ \"$2\" = \"down\" ]; then\n        enable-disable-wifi\n    fi\n\n\n## ~/bin/upd\n\nupdate sw\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    string=\"$(uname -r)\"\n    if [[ $string == *\"arch\"* ]]; then\n        if command -v \"pikaur\"; then\n            pikaur -Syu\n        else\n            sudo pacman -Syu\n        fi\n    else\n        export DEBIAN_FRONTEND=noninteractive\n        sudo apt update -y \u0026\u0026 sudo apt full-upgrade -y \u0026\u0026 sudo apt autoremove -y \u0026\u0026 sudo apt clean -y \u0026\u0026 sudo apt autoclean -y\n    fi\n\n\n## rclone\n\n\u003chttps://rclone.org/\u003e\n\n\n### ~/bin/syncrclone-gdrive-docs\n\n\u003chttps://github.com/Jwink3101/syncrclone\u003e\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    syncrclone \"$HOME\"/.syncrclone/gdrive-docs-config.py\n\n\n### ~/bin/syncrclone-gdrive\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    syncrclone \"$HOME\"/.syncrclone/gdrive-config.py\n\n\n### ~/bin/hetzner-du\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    echo \"df -h\"  | sftp u377059@u377059.your-storagebox.de\n\n\n### ~/bin/rclone-mount\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    remote=${1:-\"hetzner\"}\n    if [ -d ~/$remote ]; then\n        umount ~/${remote}\n        rmdir ~/${remote}\n        echo \"Closed ~/${remote}\"\n    else\n        mkdir -p ~/${remote}\n        rclone mount $( [ \"$2\" != \"rw\" ] \u0026\u0026 echo \"--read-only\") ${remote}: ~/${remote} \u0026\u003e /dev/null \u0026\n        echo \"Mounted ~/${remote}\"\n    fi\n\n\n### ~/bin/gdrive-mount\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    rclone-mount gdrive \"$1\"\n\n\n### ~/bin/hetzner-mount\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    rclone-mount hetzner \"$1\"\n\n\n### ~/bin/syncrclone-htop\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    htop -F \"syncrclone\"\n\n\n### ~/bin/syncrclone-once\n\n    #!/usr/bin/env bash\n    # Maintained in linux-config.org\n    if ! network-online; then\n        echo \"offline\"\n        exit 1\n    fi\n    if pgrep -x \"rclone\" \u003e /dev/null; then\n        echo \"syncrclone already running\"\n        exit 1\n    else\n        if [[ -z $SYNC_CRON ]]; then\n            syncrclone | mail -s \"syncrclone manual : $(date)\" $USER\n        else\n            syncrclone\n        fi\n        exit 0\n    fi\n\n\n## cloud rsync between machines\n\n    #Maintained in linux-config.org\n    cloud/.syncrclone/\n    Documents/.syncrclone/\n    OpenAudible/aax/\n    OpenAudible/books/\n\n\n## Google Translate Helpers\n\n    sudo apt install translate-shell\n\n\n### ~/bin/google-trans\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    src=$1;shift;\n    dst=$1;shift;\n    txt=$@;\n    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\"\n\n\n### ~/bin/google-trans-de-en\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    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 \"$@\"\n\n\n### ~/bin/google-trans-en-de\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    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 \"$@\"\n\n\n## Security/Locking/GPG\n\n\n### ~/bin/gpg-cache\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    if ! pidof gpg-agent; then\n        cachefile=\"${1:-\"${HOME}/.gnupg/auth/cache-keys\"}\"\n        if [ -f \"$cachefile\" ]; then\n            p=$(zenity --password --title \"Password for SSH\")\n            if [ ! -z \"$p\" ]; then\n                while IFS= read -r k; do\n                    [ ! -z \"$p\" ] \u0026\u0026 echo \"$p\" | /usr/lib/gnupg2/gpg-preset-passphrase --preset \"$k\"\n                done \u003c \"$cachefile\"\n            fi\n        fi\n    fi\n\n\\#+end\\_src\n\n\n### ~/bin/pre-lock\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    [ -f \"${HOME}\"/.pre-lock ]  \u0026\u0026 . \"${HOME}\"/.pre-lock\n\n1.  Sample .pre-lock\n\n        #!/usr/bin/env bash\n        xmg-neo-rgb-kbd-lights sleep\n\n\n### ~/bin/post-lock\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    [ -f \"${HOME}\"/.post-lock  ]  \u0026\u0026 . \"${HOME}\"/.post-lock\n\n1.  Sample .post-lock\n\n        #!/usr/bin/env bash\n        xmg-neo-rgb-kbd-lights wake\n\n\n### ~/bin/pre-blank\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    command -v brightnessctl \u0026\u0026 brightnessctl -s\n    [ -f ~/.pre-blank ]  \u0026\u0026 . ~/.pre-blank\n\n\n### ~/bin/post-blank\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    [ -f ~/.post-blank ]  \u0026\u0026 . ~/.post-blank\n    command -v brightnessctl \u0026\u0026 brightnessctl -r\n\n\n# AIS\n\nout of date\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    TMUX= tmux new  -A -s \"AIS\" AIScatcher\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    if ! pgrep AIS-catcher \u003e/dev/null\n    then\n        echo \"`date`: AIS-catcher down. Restarting.\" \u003e\u003e \"${HOME}/.AISStatus\"\n        \"${HOME}/bin/AIScatcher\" \u0026\u003e /dev/null \u0026\n    fi\n\n    #!/usr/bin/env bash\n    #Maintained in linux-config.org\n    \"${HOME}/bin/AIS-catcher\"  -d:0 -u 127.0.0.1 2345\n\n\n# tailends\n\n\n## ~/.bash\\_profile\n\n    \n    [ -f \"${HOME}/.bash_profile.local\" ] \u0026\u0026 . \"${HOME}/.bash_profile.local\"\n    [ -f \"${HOME}/.cargo/env\" ] \u0026\u0026 . \"$HOME/.cargo/env\"\n    sway-autostart\n\n\n## ~/.profile\n\n    # fix for java apps in sway\n    export _JAVA_AWT_WM_NONREPARENTING=1\n    pgrep emacs \u003e /dev/null || (emacs --daemon=\"general\" \u003e /dev/null 2\u003e\u00261 \u0026 )\n    [ -f \"${HOME}/.profile.local\" ] \u0026\u0026 . \"${HOME}/.profile.local\"\n\n\n## sway config\n\n    include /etc/sway/config.d/*\n    include config-vars.d/*\n\n","funding_links":[],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frileyrg%2Flinux-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frileyrg%2Flinux-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frileyrg%2Flinux-init/lists"}