Huge update, sway mostly. - dotfiles - These are my dotfiles. There are many like it, but these are mine.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit f416bf57b40d2678b1d9a32d2e6f72c6d75a38dc
 (DIR) parent 07475f784ba3846094d1545852eac46dd79db095
 (HTM) Author: Jay Scott <me@jay.scot>
       Date:   Wed,  7 Feb 2024 21:39:23 +0000
       
       Huge update, sway mostly.
       
       Diffstat:
         M README                              |      11 +++++------
         D X11/Xresources                      |      98 -------------------------------
         D X11/xinitrc                         |      15 ---------------
         D alacritty/alacritty.toml            |      33 -------------------------------
         A ashrc                               |      54 +++++++++++++++++++++++++++++++
         D bashrc                              |      58 ------------------------------
         M bin/game_select.sh                  |       1 -
         M bin/link_handler.sh                 |       8 ++++----
         A bin/sway-run.sh                     |      22 ++++++++++++++++++++++
         M bootstrap.sh                        |       4 ++--
         A foot/foot.ini                       |      27 +++++++++++++++++++++++++++
         D mpd/mpd.conf                        |      20 --------------------
         D ncmpcpp/config                      |      31 -------------------------------
         M newsraft/config                     |       4 ++--
         M newsraft/feeds                      |      15 ---------------
         D pkg/pkglist-aur.txt                 |       7 -------
         D pkg/pkglist-repo.txt                |      62 -------------------------------
         M profile                             |       2 +-
         D suckless/dmenu/Makefile             |      39 -------------------------------
         D suckless/dmenu/config.h             |      16 ----------------
         D suckless/dmenu/patches/01-dmenu-bo… |      36 -------------------------------
         D suckless/dmenu/patches/02-dmenu-ce… |     120 -------------------------------
         D suckless/dwm/Makefile               |      41 -------------------------------
         D suckless/dwm/config.h               |     199 -------------------------------
         D suckless/dwm/patches/01-dwm-systra… |     746 -------------------------------
         D suckless/herbe/Makefile             |      40 -------------------------------
         D suckless/herbe/config.h             |      19 -------------------
         D suckless/slstatus/Makefile          |      35 -------------------------------
         D suckless/slstatus/config.h          |      71 -------------------------------
         A sway/config                         |      87 +++++++++++++++++++++++++++++++
         A waybar/config                       |      65 +++++++++++++++++++++++++++++++
         A waybar/style.css                    |      58 ++++++++++++++++++++++++++++++
         A waybar/waybar_mail.sh               |      12 ++++++++++++
         A waybar/waybar_newsboat.sh           |      11 +++++++++++
       
       34 files changed, 350 insertions(+), 1717 deletions(-)
       ---
 (DIR) diff --git a/README b/README
       @@ -7,14 +7,13 @@ Privacy is at the forefront of my mind as such some of my browser
        settings maybe too restrictive for some. I also don't use social media
        at all, the closest I come is using IRC.
        
       -  operating sys  : archlinux / alpine linux
       -  window manager : dwm
       -  terminal       : alacritty
       -  launcher       : dmenu
       +  operating sys  : alpine linux
       +  window manager : sway
       +  terminal       : foot
       +  launcher       : bemenu
          email          : mutt / isync
          browser        : qutebrowser / librewolf
       -  video          : mpv
       -  music          : mpd / ncmcpp
       +  video / music  : mpv
          password mgt   : pass
          vpn            : mullvad
          news           : newsraft
 (DIR) diff --git a/X11/Xresources b/X11/Xresources
       @@ -1,98 +0,0 @@
       -! vim:ft=xdefaults
       -
       -/* COLOURS */
       -#define RED0            #cc0403
       -#define RED1            #f2201f
       -#define GREEN0          #19cb00
       -#define GREEN1          #23fd00
       -#define YELLOW0         #cecb00
       -#define YELLOW1         #fffd00
       -#define BLUE0           #0d73cc
       -#define BLUE1           #1a8fff
       -#define MAGENTA0        #cb1ed1
       -#define MAGENTA1        #fd28ff
       -#define CYAN0           #0dcdcd
       -#define CYAN1           #14ffff
       -#define BLACK           #000000
       -#define GREY1           #767676
       -#define GREY2           #dddddd
       -#define WHITE           #ffffff
       -
       -#define FONT                       Hack:size=14
       -
       -/* XFT */
       -Xft.dpi:       96
       -Xft.hinting:   true
       -Xft.rgba:      rgb
       -Xft.antialias: true
       -Xft.autohint:  false
       -Xft.hintstyle: hintslight
       -Xft.lcdfilter: lcddefault
       -
       -*.foreground:        WHITE
       -*.background:         BLACK
       -
       -/* NORMAL */
       -*.color0:         BLACK
       -*.color1:         RED0
       -*.color2:          GREEN0
       -*.color3:          YELLOW0
       -*.color4:          BLUE0
       -*.color5:          MAGENTA0
       -*.color6:          CYAN0
       -*.color7:          GREY2
       -
       -/* BRIGHT */
       -*.color8:         GREY1
       -*.color9:         RED1
       -*.color10:         GREEN1
       -*.color11:         YELLOW1
       -*.color12:         BLUE1
       -*.color13:         MAGENTA1
       -*.color14:         CYAN1
       -*.color15:         WHITE
       -
       -!
       -! Generated with :
       -! XRDB2Xreources.py
       -!
       -*.foreground:  #e6d4a3
       -*.background:  #1e1e1e
       -*.cursorColor: #bbbbbb
       -!
       -! Black
       -*.color0:      #161819
       -*.color8:      #7f7061
       -!
       -! Red
       -*.color1:      #f73028
       -*.color9:      #be0f17
       -!
       -! Green
       -*.color2:      #aab01e
       -*.color10:     #868715
       -!
       -! Yellow
       -*.color3:      #f7b125
       -*.color11:     #cc881a
       -!
       -! Blue
       -*.color4:      #719586
       -*.color12:     #377375
       -!
       -! Magenta
       -*.color5:      #c77089
       -*.color13:     #a04b73
       -!
       -! Cyan
       -*.color6:      #7db669
       -*.color14:     #578e57
       -!
       -! White
       -*.color7:      #faefbb
       -*.color15:     #e6d4a3
       -!
       -! Bold, Italic, Underline
       -*.colorBD:     #978771
       -!*.colorIT:
       -!*.colorUL:
 (DIR) diff --git a/X11/xinitrc b/X11/xinitrc
       @@ -1,15 +0,0 @@
       -# x stuff
       -setxkbmap gb
       -xset s off -dpms
       -xrdb -load ~/.config/X11/Xresources
       -
       -if [ -z "$XDG_RUNTIME_DIR" ]; then
       -        mkdir -p /tmp/runtime/jay
       -        chmod 700 /tmp/runtime/jay
       -        export XDG_RUNTIME_DIR=/tmp/runtime/jay
       -fi
       -
       -slstatus &
       -xrandr --output HDMI-A-0 --auto --output DisplayPort-0 --auto --right-of HDMI-A-0 &
       -mpd &
       -exec dwm
 (DIR) diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml
       @@ -1,33 +0,0 @@
       -[colors.bright]
       -black = "0x928374"
       -blue = "0x83a598"
       -cyan = "0x8ec07c"
       -green = "0xb8bb26"
       -magenta = "0xd3869b"
       -red = "0xfb4934"
       -white = "0xebdbb2"
       -yellow = "0xfabd2f"
       -
       -[colors.normal]
       -black = "0x282828"
       -blue = "0x458588"
       -cyan = "0x689d6a"
       -green = "0x98971a"
       -magenta = "0xb16286"
       -red = "0xcc241d"
       -white = "0xa89984"
       -yellow = "0xd79921"
       -
       -[colors.primary]
       -background = "0x282828"
       -foreground = "0xebdbb2"
       -
       -[env]
       -TERM = "xterm-256color"
       -
       -[font]
       -size = 15
       -
       -[font.normal]
       -family = "Hack"
       -style = "Regular"
 (DIR) diff --git a/ashrc b/ashrc
       @@ -0,0 +1,54 @@
       +export XDG_CONFIG_HOME="$HOME/.config"
       +export XDG_CACHE_HOME="$HOME/.cache"
       +export XDG_DATA_HOME="$HOME/.local/share"
       +export XDG_STATE_HOME="$HOME/.local/state"
       +
       +# cleanup ~/
       +export PASSWORD_STORE_DIR="$XDG_CONFIG_HOME"/pass
       +export CARGO_HOME="$XDG_DATA_HOME"/cargo
       +alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
       +
       +# common exports
       +GPG_TTY=$(tty)
       +export GPG_TTY
       +export EDITOR="vim"
       +export BROWSER="qutebrowser"
       +export PATH=$PATH:$HOME/bin:$HOME/.local/bin
       +
       +export BEMENU_OPTS="-p '> ' --tb '#013220' --tf '#ffffff' --hf '#444444'"
       +
       +# terraform config
       +export TF_CLOUD_ORGANIZATION="jay-scot"
       +export TF_WORKSPACE="hetzner"
       +
       +# lynx
       +export LYNX_CFG=$HOME/.config/lynx/config
       +export LYNX_LSS=$HOME/.config/lynx/theme.lss
       +
       +# safety first kids!
       +alias cp='cp -i'
       +alias mv='mv -i'
       +alias rm='rm -i'
       +
       +# random alias
       +alias weather='curl wttr.in/?1QF'
       +
       +# git alias
       +alias ga='git add -A'
       +alias gs='git status -s'
       +alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
       +alias gd='git diff'
       +alias gma='git commit -am'
       +
       +# neo
       +alias vim='nvim'
       +alias mutt='neomutt'
       +
       +# ash
       +export MAILPATH='~/.mail/jay/Inbox/cur/'
       +export LANG=en_US.UTF-8
       +export LC_CTYPE="en_US.UTF-8"
       +export LC_ALL=en_US.UTF-8
       +export PS1="\[\e[00;34m\]▶▶▶ \W \[\e[0m\]"
       +
       +source ~/.secret
 (DIR) diff --git a/bashrc b/bashrc
       @@ -1,58 +0,0 @@
       -if [[ -r /usr/share/bash-completion/bash_completion ]]; then
       -  . /usr/share/bash-completion/bash_completion
       -fi
       -
       -export XDG_CONFIG_HOME="$HOME/.config"
       -export XDG_CACHE_HOME="$HOME/.cache"
       -export XDG_DATA_HOME="$HOME/.local/share"
       -export XDG_STATE_HOME="$HOME/.local/state"
       -
       -# cleanup ~/
       -export PASSWORD_STORE_DIR="$XDG_CONFIG_HOME"/pass
       -export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
       -export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
       -export CARGO_HOME="$XDG_DATA_HOME"/cargo
       -alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
       -
       -# common exports
       -GPG_TTY=$(tty)
       -export GPG_TTY
       -export EDITOR="vim"
       -export BROWSER="librewolf"
       -export GOPATH="$XDG_DATA_HOME"/go
       -export GOPROXY=direct
       -export PATH=$PATH:$GOPATH/bin:$HOME/bin:$HOME/.local/bin
       -export PS1="[\[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]] \\$ \[$(tput sgr0)\]"
       -
       -# terraform config
       -export TF_CLOUD_ORGANIZATION="jay-scot"
       -export TF_WORKSPACE="hetzner"
       -
       -# lynx
       -export LYNX_CFG=$HOME/.config/lynx/config
       -export LYNX_LSS=$HOME/.config/lynx/theme.lss
       -
       -# safety first kids!
       -alias cp='cp -i'
       -alias mv='mv -i'
       -alias rm='rm -i'
       -
       -# random alias
       -alias weather='curl wttr.in/57.66,-2.52?3QF'
       -alias ls='ls --color=auto'
       -alias voff='mullvad lockdown-mode set off; mullvad disconnect'
       -alias von='mullvad lockdown-mode set on; mullvad connect'
       -alias vcheck='curl https://am.i.mullvad.net/connected'
       -
       -# neo
       -alias vim='nvim'
       -alias mutt='neomutt'
       -
       -# git alias
       -alias ga='git add -A'
       -alias gs='git status -s'
       -alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
       -alias gd='git diff --color=always --word-diff=color | less -RFX'
       -alias gma='git commit -am'
       -
       -source ~/.secret
 (DIR) diff --git a/bin/game_select.sh b/bin/game_select.sh
       @@ -7,7 +7,6 @@ stellaris_path=$MEDIA_GAMES_DIR/stellaris/start.sh
        gibbous_path=$MEDIA_GAMES_DIR/gibbous/start.sh
        rimworld_path=$MEDIA_GAMES_DIR/rimworld/start.sh
        atomrpg_path=$MEDIA_GAMES_DIR/atomrpg/start.sh
       -primordia_path=$MEDIA_GAMES_DIR/primordia/start.sh
        steam_command=steam
        
        # Define game list
 (DIR) diff --git a/bin/link_handler.sh b/bin/link_handler.sh
       @@ -4,10 +4,10 @@ launcher="setsid"
        
        # apps
        player="mpv --really-quiet --no-terminal"
       -gemini="alacritty -e amfora"
       -gopher="alacritty -e lynx"
       +gemini="foot -e amfora"
       +gopher="foot -e lynx"
        pdf="zathura"
       -images="feh"
       +images="swayimg"
        
        uri="$1"
        uri_lower="$(printf "%s" "$uri" | tr '[:upper:]' '[:lower:]')"
       @@ -30,6 +30,6 @@ case "$uri_lower" in
                $launcher $images "$uri"
                ;;
        *)
       -        $launcher librewolf "$uri"
       +        $launcher firefox "$uri"
                ;;
        esac
 (DIR) diff --git a/bin/sway-run.sh b/bin/sway-run.sh
       @@ -0,0 +1,22 @@
       +#!/bin/sh
       +export TERM=foot
       +export _JAVA_AWT_WM_NONREPARENTING=1
       +export XKB_DEFAULT_OPTIONS=caps:escape
       +export GDK_BACKEND=wayland
       +export XDG_SESSION_TYPE=wayland
       +#export XCURSOR_THEME=Adwaita
       +export XDG_DESKTOP_DIR="$HOME"
       +export XDG_DOWNLOAD_DIR="$HOME/tmp"
       +export XDG_DOCUMENTS_DIR="$HOME/tmp"
       +export XDG_MUSIC_DIR="$HOME/tmp"
       +export XDG_PICTURES_DIR="$HOME/tmp"
       +export XDG_VIDEOS_DIR="$HOME/tmp"
       +export XDG_CURRENT_DESKTOP=sway
       +
       +if [ -z "$XDG_RUNTIME_DIR" ]; then
       +        mkdir -p /tmp/runtime/jay
       +        chmod 700 /tmp/runtime/jay
       +        export XDG_RUNTIME_DIR=/tmp/runtime/jay
       +fi
       +
       +exec dbus-run-session sway
 (DIR) diff --git a/bootstrap.sh b/bootstrap.sh
       @@ -2,9 +2,9 @@
        
        DOTFILES=$(pwd)
        
       -FILES='bashrc profile'
       +FILES='ashrc profile'
        ROOT='bin'
       -CONFIG='alacritty git isync lynx mutt newsraft mpd ncmpcpp nvim qutebrowser X11'
       +CONFIG='foot git isync lynx mutt newsraft nvim qutebrowser sway waybar'
        
        link() {
          for f in $FILES; do ln -sfn "$DOTFILES/$f" "$HOME/.$f"; done
 (DIR) diff --git a/foot/foot.ini b/foot/foot.ini
       @@ -0,0 +1,27 @@
       +font=Hack:size=14
       +
       +[url]
       +launch=link_handler.sh ${url}
       +
       +[key-bindings]
       +show-urls-launch=Control+Shift+p
       +
       +[colors]
       +background=282828
       +foreground=ebdbb2
       +regular0=282828
       +regular1=cc241d
       +regular2=98971a
       +regular3=d79921
       +regular4=458588
       +regular5=b16286
       +regular6=689d6a
       +regular7=a89984
       +bright0=928374
       +bright1=fb4934
       +bright2=b8bb26
       +bright3=fabd2f
       +bright4=83a598
       +bright5=d3869b
       +bright6=8ec07c
       +bright7=ebdbb2
 (DIR) diff --git a/mpd/mpd.conf b/mpd/mpd.conf
       @@ -1,20 +0,0 @@
       -music_directory                "/home/jay/media/music"
       -playlist_directory         "/home/jay/.config/mpd/playlists"
       -db_file                 "/home/jay/.config/mpd/mpd.db"
       -log_file                   "syslog"
       -pid_file                 "/home/jay/.config/mpd/mpd.pid"
       -state_file                 "/home/jay/.config/mpd/mpdstate"
       -
       -audio_output {
       -        type "pulse"
       -        name "pulse audio"
       -}
       -audio_output {
       -    type                    "fifo"
       -    name                    "my_fifo"
       -    path                    "/tmp/mpd.fifo"
       -    format                  "44100:16:2"
       -}
       -
       -bind_to_address "127.0.0.1"
       -port "6600"
 (DIR) diff --git a/ncmpcpp/config b/ncmpcpp/config
       @@ -1,31 +0,0 @@
       -# visual stuff for 8
       -visualizer_data_source = /tmp/mpd.fifo
       -visualizer_output_name = my_fifo
       -visualizer_in_stereo = no
       -visualizer_type = spectrum
       -visualizer_look = ∙▋
       -visualizer_color = 7,5,8,3
       -song_columns_list_format = "(50)[green]{a} (50)[white]{t|f}"
       -
       -playlist_display_mode = columns
       -browser_display_mode = columns
       -
       -ncmpcpp_directory = ~/.config/ncmpcpp
       -lyrics_directory = /tmp
       -store_lyrics_in_song_dir = yes
       -autocenter_mode = "yes"
       -centered_cursor = "yes"
       -cyclic_scrolling = "no"
       -
       -titles_visibility = "no"
       -header_visibility = "no"
       -statusbar_visibility = "no"
       -progressbar_look = "❙❙❙"
       -progressbar_color = "white"
       -
       -user_interface = "classic"
       -
       -startup_screen = playlist
       -startup_slave_screen = visualizer
       -startup_slave_screen_focus = no
       -locked_screen_width_part = 35
 (DIR) diff --git a/newsraft/config b/newsraft/config
       @@ -3,8 +3,8 @@ set open-in-browser-command ~/bin/link_handler.sh "%l"
        set send-user-agent-header true
        set clean-database-on-startup  true
        
       -set menu-feed-sorting unread-desc
       -set menu-item-sorting unread-desc
       +#set menu-feed-sorting unread-desc
       +#set menu-item-sorting unread-desc
        
        # key bindings
        bind f exec "~/bin/link_handler.sh %l"
 (DIR) diff --git a/newsraft/feeds b/newsraft/feeds
       @@ -10,17 +10,6 @@ https://goarmy.co.uk/collections/all.atom "GoArmy Disressed"
        
        @ MEDIA
        https://showrss.info/other/all.rss "TV Torrents"
       -http://feed.rutracker.cc/atom/f/1992.atom "RU Tracker"
       -
       -@ GAMING
       -https://www.gamingonlinux.com/article_rss.php "Gaming On Linux"
       -
       -@ GEMINI
       -$(gemget tilde.team/~tomasino/atom.xml --output -) "tomasino@tilde.team"
       -$(gemget capsule.usebox.net/gemlog/atom.xml --output -) "Juans Gemlog"
       -$(gemget foobucket.xyz/gemlog/atom.xml --output -) "Foobucket Gemlog"
       -$(gemget midnight.pub/feed.xml --output -) "Midnight Pub"
       -$(gemget gemini://warmedal.se/~antenna/atom.xml --output -) "Antenna"
        
        @ PEOPLE
        https://codemadness.org/atom.xml "CodeMadness"
       @@ -28,8 +17,6 @@ https://drewdevault.com/blog/index.xml "Drew DeVault"
        http://joeyh.name/blog/index.rss "Joey H"
        https://unixsheikh.com/feed.rss "Unix Sheikh"
        https://www.uninformativ.de/blog/feeds/en.atom "Uninformativ"
       -$(curl -s gopher://box.matto.nl/0/gopherindex.rss) "Matto"
       -$(curl -s gopher://1436.ninja/0phlog.atom) "RPod"
        
        @ ODYSEE
        https://odysee.com/$/rss/@AlphaNerd:8 "Mental Outlaws"
       @@ -61,7 +48,6 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCpXwMqnXfJzazKS5fJ8nrVw "Sh
        https://www.youtube.com/feeds/videos.xml?channel_id=UCO8MMsO_XRjO7X4iGCuKdwg "Vagabond"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCpiWxsm9Gt_HK7d-jqkU4MA "Daly Life Outdoors"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCPqdx8N99fs4IDoK_XA1aew "English Woodsman"
       -https://www.youtube.com/feeds/videos.xml?channel_id=UCAN5q-zNsG3zfk0pHI2rXWQ "English Woodsman 2"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCI3mQP0kLxdZKhNtcHhExyA "Paul Messer"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCdVEfdWcNwL5jWmwaNWEf1Q "Bushman & Blue"
        https://www.youtube.com/feeds/videos.xml?channel_id=UC2O6HDtMOZf9FkUAepz9Atg "Noel Phillips"
       @@ -76,7 +62,6 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UC7McxlM5qJVjqLBRYcHyylg "Ba
        https://www.youtube.com/feeds/videos.xml?channel_id=UCb31gOY6OD8ES0zP8M0GhAw "MaxFosh"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCqWFLuBLPiaeNzYAek6BOmA "AutoAlex"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCSnqXeK94-iNmwqGO__eJ5g "SteveWallis"
       -https://www.youtube.com/feeds/videos.xml?channel_id=UCQkKf5qwYKyJlyhZPbdAVmw "HamsterWheelGaming"
        https://www.youtube.com/feeds/videos.xml?channel_id=UC2SMpy2oZV6BoyJEYShw9bw "TA Outdoors"
        https://www.youtube.com/feeds/videos.xml?channel_id=UCDQ9L4eFHxSh0BM6z-SkZMw "Ned in the Cloud"
        https://www.youtube.com/feeds/videos.xml?channel_id=UC3Vuq4Q1bKFtAiKYlwRv3oA "Peter Santenello"
 (DIR) diff --git a/pkg/pkglist-aur.txt b/pkg/pkglist-aur.txt
       @@ -1,7 +0,0 @@
       -gemget
       -lib32-gperftools
       -librewolf-bin
       -mullvad-vpn-bin
       -newsraft
       -paru
       -shellcheck-bin
 (DIR) diff --git a/pkg/pkglist-repo.txt b/pkg/pkglist-repo.txt
       @@ -1,62 +0,0 @@
       -alacritty
       -amfora
       -base
       -base-devel
       -bash-completion
       -chrony
       -dhcpcd
       -docker
       -docker-compose
       -efibootmgr
       -fzf
       -gamemode
       -git
       -gnu-netcat
       -isync
       -less
       -lf
       -lib32-libpng12
       -lib32-pipewire
       -linux
       -linux-firmware
       -lynx
       -mpd
       -mpv
       -ncmpcpp
       -neomutt
       -neovim
       -noto-fonts-emoji
       -ntfs-3g
       -pamixer
       -pass
       -pipewire-alsa
       -pipewire-pulse
       -profanity
       -pulsemixer
       -python-adblock
       -qutebrowser
       -rsync
       -scrot
       -shfmt
       -steam
       -sudo
       -terraform
       -ttf-dejavu
       -ttf-hack
       -ttf-jetbrains-mono-nerd
       -ttf-liberation
       -unrar
       -unzip
       -vulkan-radeon
       -wayland
       -wine-staging
       -xclip
       -xdg-utils
       -xf86-video-amdgpu
       -xorg-server
       -xorg-xinit
       -xorg-xset
       -xorg-xsetroot
       -yt-dlp
       -zathura
       -zathura-pdf-mupdf
 (DIR) diff --git a/profile b/profile
       @@ -1,2 +1,2 @@
       -export ENV=$HOME/.bashrc
       +export ENV=$HOME/.ashrc
        . $ENV
 (DIR) diff --git a/suckless/dmenu/Makefile b/suckless/dmenu/Makefile
       @@ -1,39 +0,0 @@
       -REPOSITORY = http://git.suckless.org/dmenu
       -SRC_DIR = src
       -PINNED_REVISION = HEAD
       -PATCH_DIR = patches
       -
       -all: $(SRC_DIR)
       -
       -clean: reset
       -        @if test -d $(SRC_DIR); then \
       -                $(MAKE) -C "${SRC_DIR}" -s clean; \
       -                git -C "${SRC_DIR}" clean -f; \
       -        fi
       -
       -$(SRC_DIR): clone reset patch
       -        @cp config.h $@
       -        $(MAKE) -C "${SRC_DIR}" -s
       -
       -patch: $(PATCH_DIR)/*
       -        @for file in $^ ; do \
       -                patch -d "${SRC_DIR}" < $${file}; \
       -        done
       -reset:
       -        @if [ -n "$(strip $(PINNED_REVISION))" ]; then \
       -                git -C "${SRC_DIR}" reset --hard $(PINNED_REVISION); \
       -        fi
       -
       -clone:
       -        @if ! test -d $(SRC_DIR); then \
       -                git clone $(REPOSITORY) $(SRC_DIR); \
       -        fi
       -
       -update: clean
       -        @git -C "${SRC_DIR}" pull
       -
       -install:
       -        $(MAKE) -C "${SRC_DIR}" -s install
       -
       -
       -.PHONY: all clean update install reset clone
 (DIR) diff --git a/suckless/dmenu/config.h b/suckless/dmenu/config.h
       @@ -1,16 +0,0 @@
       -static int topbar = 1;
       -static const char *fonts[] = {
       -        "Hack:pixelsize=14"
       -};
       -static int centered = 1;
       -static const char *prompt      = "run »";
       -static const char *colors[SchemeLast][2] = {
       -        [SchemeNorm] = { "#ebdbb2", "#282828" },
       -        [SchemeSel] = { "#ebdbb2", "#98971a" },
       -        [SchemeOut] = { "#ebdbb2", "#8ec07c" },
       -};
       -
       -static unsigned int lines = 0;
       -static const char worddelimiters[] = " ";
       -static int min_width = 800;
       -static unsigned int border_width = 3;
 (DIR) diff --git a/suckless/dmenu/patches/01-dmenu-border-4.9.diff b/suckless/dmenu/patches/01-dmenu-border-4.9.diff
       @@ -1,36 +0,0 @@
       -diff --git a/config.def.h b/config.def.h
       -index 1edb647..dd3eb31 100644
       ---- a/config.def.h
       -+++ b/config.def.h
       -@@ -21,3 +21,6 @@ static unsigned int lines      = 0;
       -  * for example: " /?\"&[]"
       -  */
       - static const char worddelimiters[] = " ";
       -+
       -+/* Size of the window border */
       -+static unsigned int border_width = 0;
       -diff --git a/dmenu.c b/dmenu.c
       -index 27b7a30..7c130fc 100644
       ---- a/dmenu.c
       -+++ b/dmenu.c
       -@@ -684,9 +684,11 @@ setup(void)
       -         swa.override_redirect = True;
       -         swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
       -         swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
       --        win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
       -+        win = XCreateWindow(dpy, root, x, y, mw, mh, border_width,
       -                             CopyFromParent, CopyFromParent, CopyFromParent,
       -                             CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
       -+        if (border_width)
       -+                XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
       -         XSetClassHint(dpy, win, &ch);
       -
       -
       -@@ -757,6 +759,8 @@ main(int argc, char *argv[])
       -                         colors[SchemeSel][ColFg] = argv[++i];
       -                 else if (!strcmp(argv[i], "-w"))   /* embedding window id */
       -                         embed = argv[++i];
       -+                else if (!strcmp(argv[i], "-bw"))
       -+                        border_width = atoi(argv[++i]); /* border width */
       -                 else
       -                         usage();
 (DIR) diff --git a/suckless/dmenu/patches/02-dmenu-center-20200111-8cd37e1.diff b/suckless/dmenu/patches/02-dmenu-center-20200111-8cd37e1.diff
       @@ -1,120 +0,0 @@
       -From 8cd37e1ab9e7cb025224aeb3543f1a5be8bceb93 Mon Sep 17 00:00:00 2001
       -From: Nihal Jere <nihal@nihaljere.xyz>
       -Date: Sat, 11 Jan 2020 21:16:08 -0600
       -Subject: [PATCH] center patch now has adjustable minimum width
       -
       ----
       - config.def.h |  2 ++
       - dmenu.1      |  3 +++
       - dmenu.c      | 39 ++++++++++++++++++++++++++++++++-------
       - 3 files changed, 37 insertions(+), 7 deletions(-)
       -
       -diff --git a/config.def.h b/config.def.h
       -index 1edb647..88ef264 100644
       ---- a/config.def.h
       -+++ b/config.def.h
       -@@ -2,6 +2,8 @@
       - /* Default settings; can be overriden by command line. */
       - 
       - static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
       -+static int centered = 0;                    /* -c option; centers dmenu on screen */
       -+static int min_width = 500;                    /* minimum width when centered */
       - /* -fn option overrides fonts[0]; default X11 font or font set */
       - static const char *fonts[] = {
       -         "monospace:size=10"
       -diff --git a/dmenu.1 b/dmenu.1
       -index 323f93c..c036baa 100644
       ---- a/dmenu.1
       -+++ b/dmenu.1
       -@@ -40,6 +40,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
       - .B \-b
       - dmenu appears at the bottom of the screen.
       - .TP
       -+.B \-c
       -+dmenu appears centered on the screen.
       -+.TP
       - .B \-f
       - dmenu grabs the keyboard before reading stdin if not reading from a tty. This
       - is faster, but will lock up X until stdin reaches end\-of\-file.
       -diff --git a/dmenu.c b/dmenu.c
       -index 65f25ce..041c7f8 100644
       ---- a/dmenu.c
       -+++ b/dmenu.c
       -@@ -89,6 +89,15 @@ calcoffsets(void)
       -                         break;
       - }
       - 
       -+static int
       -+max_textw(void)
       -+{
       -+        int len = 0;
       -+        for (struct item *item = items; item && item->text; item++)
       -+                len = MAX(TEXTW(item->text), len);
       -+        return len;
       -+}
       -+
       - static void
       - cleanup(void)
       - {
       -@@ -611,6 +620,7 @@ setup(void)
       -         bh = drw->fonts->h + 2;
       -         lines = MAX(lines, 0);
       -         mh = (lines + 1) * bh;
       -+        promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
       - #ifdef XINERAMA
       -         i = 0;
       -         if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
       -@@ -637,9 +647,16 @@ setup(void)
       -                                 if (INTERSECT(x, y, 1, 1, info[i]))
       -                                         break;
       - 
       --                x = info[i].x_org;
       --                y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
       --                mw = info[i].width;
       -+                if (centered) {
       -+                        mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
       -+                        x = info[i].x_org + ((info[i].width  - mw) / 2);
       -+                        y = info[i].y_org + ((info[i].height - mh) / 2);
       -+                } else {
       -+                        x = info[i].x_org;
       -+                        y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
       -+                        mw = info[i].width;
       -+                }
       -+
       -                 XFree(info);
       -         } else
       - #endif
       -@@ -647,11 +664,17 @@ setup(void)
       -                 if (!XGetWindowAttributes(dpy, parentwin, &wa))
       -                         die("could not get embedding window attributes: 0x%lx",
       -                             parentwin);
       --                x = 0;
       --                y = topbar ? 0 : wa.height - mh;
       --                mw = wa.width;
       -+
       -+                if (centered) {
       -+                        mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
       -+                        x = (wa.width  - mw) / 2;
       -+                        y = (wa.height - mh) / 2;
       -+                } else {
       -+                        x = 0;
       -+                        y = topbar ? 0 : wa.height - mh;
       -+                        mw = wa.width;
       -+                }
       -         }
       --        promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
       -         inputw = MIN(inputw, mw/3);
       -         match();
       - 
       -@@ -709,6 +732,8 @@ main(int argc, char *argv[])
       -                         topbar = 0;
       -                 else if (!strcmp(argv[i], "-f"))   /* grabs keyboard before reading stdin */
       -                         fast = 1;
       -+                else if (!strcmp(argv[i], "-c"))   /* centers dmenu on screen */
       -+                        centered = 1;
       -                 else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
       -                         fstrncmp = strncasecmp;
       -                         fstrstr = cistrstr;
       --- 
       -2.24.1
       -
 (DIR) diff --git a/suckless/dwm/Makefile b/suckless/dwm/Makefile
       @@ -1,41 +0,0 @@
       -REPOSITORY = http://git.suckless.org/dwm
       -SRC_DIR = src
       -PINNED_REVISION = HEAD
       -PATCH_DIR = patches
       -
       -all: $(SRC_DIR)
       -
       -clean: reset
       -        @if test -d $(SRC_DIR); then \
       -                cd $(SRC_DIR); \
       -                $(MAKE) -s clean; \
       -                git clean -f; \
       -        fi
       -
       -$(SRC_DIR): clone reset patch
       -        @cp config.h $@
       -        @cd $@ && $(MAKE) -s
       -
       -reset:
       -        @if [ -n "$(strip $(PINNED_REVISION))" ]; then \
       -                cd $(SRC_DIR) && git reset --hard $(PINNED_REVISION); \
       -        fi
       -
       -patch: $(PATCH_DIR)/*
       -        @for file in $^ ; do \
       -                patch -d "${SRC_DIR}" < $${file}; \
       -        done
       -
       -clone:
       -        @if ! test -d $(SRC_DIR); then \
       -                git clone $(REPOSITORY) $(SRC_DIR); \
       -        fi
       -
       -update: clean
       -        @cd $(SRC_DIR) && git pull
       -
       -install:
       -        $(MAKE) -C "${SRC_DIR}" -s install
       -
       -
       -.PHONY: all clean update install reset clone
 (DIR) diff --git a/suckless/dwm/config.h b/suckless/dwm/config.h
       @@ -1,199 +0,0 @@
       -/* See LICENSE file for copyright and license details. */
       -
       -/* appearance */
       -static const unsigned int borderpx  = 3;
       -static const unsigned int snap      = 32;
       -static const int lockfullscreen            = 1;
       -static const int showbar            = 1;
       -static const int topbar             = 1;
       -static const unsigned int systraypinning = 0;
       -static const unsigned int systrayonleft = 0;
       -static const unsigned int systrayspacing = 2;
       -static const int systraypinningfailfirst = 1;
       -static const int showsystray        = 1;
       -
       -static const char *fonts[]          = { "Hack:size=10" };
       -static const char dmenufont[]       = "Hack:size=10";
       -static const char col_gray1[]       = "#222222";
       -static const char col_gray2[]       = "#98971A";
       -static const char col_gray3[]       = "#bbbbbb";
       -static const char col_gray4[]       = "#eeeeee";
       -static const char col_cyan[]        = "#222222";
       -static const char *colors[][3]      = {
       -        /*               fg         bg         border   */
       -        [SchemeNorm] = { col_gray3, col_gray1, col_cyan },
       -        [SchemeSel]  = { col_gray4, col_cyan,  col_gray2  },
       -};
       -
       -
       -/* custom functions */
       -static void togglefullscreen(const Arg *arg);
       -static void bstack(Monitor *m);
       -static void centeredfloatingmaster(Monitor *m);
       -
       -/* custom defines for mouse buttons */
       -/* only 1-5 are defined in X11/X.h */
       -#define Button8 8
       -#define Button9 9
       -
       -/* tagging */
       -static const char *tags[] = { "1", "2", "3", "4", "5" };
       -
       -static Rule rules[] = {
       -        /* class      instance    title       tags mask     isfloating   monitor */
       -        { NULL,       NULL,       NULL,       0,            False,       -1 },
       -};
       -
       -/* layout(s) */
       -static const float mfact     = 0.65;
       -static const int nmaster     = 1;
       -static const int resizehints = 0;
       -
       -static const Layout layouts[] = {
       -        { "TTT",      bstack },
       -        { "[]=",      tile },
       -        { ">M>",      centeredfloatingmaster },
       -        { "><>",      NULL },
       -};
       -
       -#define MODKEY Mod1Mask
       -#define TAGKEYS(KEY,TAG) \
       -{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
       -{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
       -{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
       -{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
       -
       -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
       -
       -/* commands */
       -static char dmenumon[2] = "0";
       -static const char *dmenucmd[] = { "dmenu_run", NULL };
       -static const char *termcmd[]  = { "alacritty", NULL };
       -static const char *webcmd[]  = { "librewolf", NULL };
       -static const char *gamecmd[]  = { "/home/jay/bin/game_select.sh", NULL };
       -static const char *volup[] = { "pamixer", "-i", "5", NULL };
       -static const char *voldown[] = { "pamixer", "-d", "5", NULL };
       -
       -
       -static Key keys[] = {
       -        /* modifier                     key        function        argument */
       -        { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
       -        { MODKEY,                       XK_space,  spawn,          {.v = termcmd } },
       -        { MODKEY,                       XK_f,      spawn,          {.v = webcmd } },
       -        { MODKEY,                       XK_g,      spawn,          {.v = gamecmd } },
       -        { MODKEY,                       XK_u,      spawn,          {.v = volup } },
       -        { MODKEY,                       XK_d,      spawn,          {.v = voldown } },
       -        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
       -        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
       -        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
       -        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
       -        { MODKEY,                       XK_Return, zoom,           {0} },
       -        { MODKEY,                       XK_Tab,    view,           {0} },
       -        { MODKEY,                       XK_c,      killclient,     {0} },
       -        { MODKEY,                       XK_m,      togglefullscreen, {0} },
       -        { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
       -        { MODKEY,                        XK_comma,  tagmon,         {.i = +1 } },
       -        { MODKEY,                       XK_b,      togglebar,      {0} },
       -        { MODKEY,                       XK_x,      setlayout,      {.v = &layouts[0]} },
       -        { MODKEY|ShiftMask,             XK_x,      setlayout,      {.v = &layouts[1]} },
       -        TAGKEYS(                        XK_1,                      0)
       -        TAGKEYS(                        XK_2,                      1)
       -        TAGKEYS(                        XK_3,                      2)
       -        TAGKEYS(                        XK_4,                      3)
       -        TAGKEYS(                        XK_5,                      4)
       -        { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
       -};
       -
       -/* button definitions */
       -static Button buttons[] = {
       -               { ClkRootWin,        0,              Button8,        spawn,          {.v = voldown } },
       -               { ClkRootWin,        0,              Button9,        spawn,          {.v = volup } },
       -        };
       -
       -void
       -togglefullscreen(const Arg *arg)
       -{
       -        if (!selmon->sel)
       -                return;
       -        setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
       -}
       -
       -static void
       -bstack(Monitor *m) {
       -        int w, h, mh, mx, tx, ty, tw;
       -        unsigned int i, n;
       -        Client *c;
       -
       -        for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
       -        if (n == 0)
       -                return;
       -        if (n > m->nmaster) {
       -                mh = m->nmaster ? m->mfact * m->wh : 0;
       -                tw = m->ww / (n - m->nmaster);
       -                ty = m->wy + mh;
       -        } else {
       -                mh = m->wh;
       -                tw = m->ww;
       -                ty = m->wy;
       -        }
       -        for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
       -                if (i < m->nmaster) {
       -                        w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
       -                        resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), 0);
       -                        mx += WIDTH(c);
       -                } else {
       -                        h = m->wh - mh;
       -                        resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), 0);
       -                        if (tw != m->ww)
       -                                tx += WIDTH(c);
       -                }
       -        }
       -}
       -
       -void
       -centeredfloatingmaster(Monitor *m)
       -{
       -        unsigned int i, n, w, mh, mw, mx, mxo, my, myo, tx;
       -        Client *c;
       -
       -        /* count number of clients in the selected monitor */
       -        for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
       -        if (n == 0)
       -                return;
       -
       -        /* initialize nmaster area */
       -        if (n > m->nmaster) {
       -                /* go mfact box in the center if more than nmaster clients */
       -                if (m->ww > m->wh) {
       -                        mw = m->nmaster ? m->ww * m->mfact : 0;
       -                        mh = m->nmaster ? m->wh * 0.9 : 0;
       -                } else {
       -                        mh = m->nmaster ? m->wh * m->mfact : 0;
       -                        mw = m->nmaster ? m->ww * 0.9 : 0;
       -                }
       -                mx = mxo = (m->ww - mw) / 2;
       -                my = myo = (m->wh - mh) / 2;
       -        } else {
       -                /* go fullscreen if all clients are in the master area */
       -                mh = m->wh;
       -                mw = m->ww;
       -                mx = mxo = 0;
       -                my = myo = 0;
       -        }
       -
       -        for(i = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
       -        if (i < m->nmaster) {
       -                /* nmaster clients are stacked horizontally, in the center
       -                 * of the screen */
       -                w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i);
       -                resize(c, m->wx + mx, m->wy + my, w - (2*c->bw),
       -                       mh - (2*c->bw), 0);
       -                mx += WIDTH(c);
       -        } else {
       -                /* stack clients are stacked horizontally */
       -                w = (m->ww - tx) / (n - i);
       -                resize(c, m->wx + tx, m->wy, w - (2*c->bw),
       -                       m->wh - (2*c->bw), 0);
       -                tx += WIDTH(c);
       -        }
       -}
 (DIR) diff --git a/suckless/dwm/patches/01-dwm-systray-6.4.diff b/suckless/dwm/patches/01-dwm-systray-6.4.diff
       @@ -1,746 +0,0 @@
       -diff --git a/config.def.h b/config.def.h
       -index 9efa774..750529d 100644
       ---- a/config.def.h
       -+++ b/config.def.h
       -@@ -3,6 +3,11 @@
       - /* appearance */
       - static const unsigned int borderpx  = 1;        /* border pixel of windows */
       - static const unsigned int snap      = 32;       /* snap pixel */
       -+static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
       -+static const unsigned int systrayonleft = 0;    /* 0: systray in the right corner, >0: systray on left of status text */
       -+static const unsigned int systrayspacing = 2;   /* systray spacing */
       -+static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
       -+static const int showsystray        = 1;        /* 0 means no systray */
       - static const int showbar            = 1;        /* 0 means no bar */
       - static const int topbar             = 1;        /* 0 means bottom bar */
       - static const char *fonts[]          = { "monospace:size=10" };
       -@@ -101,8 +106,8 @@ static const Key keys[] = {
       - /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
       - static const Button buttons[] = {
       -         /* click                event mask      button          function        argument */
       --        { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
       --        { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
       -+        { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
       -+        { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
       -         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
       -         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
       -         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
       -diff --git a/dwm.c b/dwm.c
       -index 03baf42..4611a03 100644
       ---- a/dwm.c
       -+++ b/dwm.c
       -@@ -57,12 +57,27 @@
       - #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
       - #define TEXTW(X)                (drw_fontset_getwidth(drw, (X)) + lrpad)
       - 
       -+#define SYSTEM_TRAY_REQUEST_DOCK    0
       -+/* XEMBED messages */
       -+#define XEMBED_EMBEDDED_NOTIFY      0
       -+#define XEMBED_WINDOW_ACTIVATE      1
       -+#define XEMBED_FOCUS_IN             4
       -+#define XEMBED_MODALITY_ON         10
       -+#define XEMBED_MAPPED              (1 << 0)
       -+#define XEMBED_WINDOW_ACTIVATE      1
       -+#define XEMBED_WINDOW_DEACTIVATE    2
       -+#define VERSION_MAJOR               0
       -+#define VERSION_MINOR               0
       -+#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
       -+
       - /* enums */
       - enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
       - enum { SchemeNorm, SchemeSel }; /* color schemes */
       - enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
       -+       NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
       -        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
       -        NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
       -+enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */
       - enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
       - enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
       -        ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
       -@@ -141,6 +156,12 @@ typedef struct {
       -         int monitor;
       - } Rule;
       - 
       -+typedef struct Systray   Systray;
       -+struct Systray {
       -+        Window win;
       -+        Client *icons;
       -+};
       -+
       - /* function declarations */
       - static void applyrules(Client *c);
       - static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
       -@@ -172,6 +193,7 @@ static void focusstack(const Arg *arg);
       - static Atom getatomprop(Client *c, Atom prop);
       - static int getrootptr(int *x, int *y);
       - static long getstate(Window w);
       -+static unsigned int getsystraywidth();
       - static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
       - static void grabbuttons(Client *c, int focused);
       - static void grabkeys(void);
       -@@ -189,13 +211,16 @@ static void pop(Client *c);
       - static void propertynotify(XEvent *e);
       - static void quit(const Arg *arg);
       - static Monitor *recttomon(int x, int y, int w, int h);
       -+static void removesystrayicon(Client *i);
       - static void resize(Client *c, int x, int y, int w, int h, int interact);
       -+static void resizebarwin(Monitor *m);
       - static void resizeclient(Client *c, int x, int y, int w, int h);
       - static void resizemouse(const Arg *arg);
       -+static void resizerequest(XEvent *e);
       - static void restack(Monitor *m);
       - static void run(void);
       - static void scan(void);
       --static int sendevent(Client *c, Atom proto);
       -+static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4);
       - static void sendmon(Client *c, Monitor *m);
       - static void setclientstate(Client *c, long state);
       - static void setfocus(Client *c);
       -@@ -207,6 +232,7 @@ static void seturgent(Client *c, int urg);
       - static void showhide(Client *c);
       - static void sigchld(int unused);
       - static void spawn(const Arg *arg);
       -+static Monitor *systraytomon(Monitor *m);
       - static void tag(const Arg *arg);
       - static void tagmon(const Arg *arg);
       - static void tile(Monitor *m);
       -@@ -224,18 +250,23 @@ static int updategeom(void);
       - static void updatenumlockmask(void);
       - static void updatesizehints(Client *c);
       - static void updatestatus(void);
       -+static void updatesystray(void);
       -+static void updatesystrayicongeom(Client *i, int w, int h);
       -+static void updatesystrayiconstate(Client *i, XPropertyEvent *ev);
       - static void updatetitle(Client *c);
       - static void updatewindowtype(Client *c);
       - static void updatewmhints(Client *c);
       - static void view(const Arg *arg);
       - static Client *wintoclient(Window w);
       - static Monitor *wintomon(Window w);
       -+static Client *wintosystrayicon(Window w);
       - static int xerror(Display *dpy, XErrorEvent *ee);
       - static int xerrordummy(Display *dpy, XErrorEvent *ee);
       - static int xerrorstart(Display *dpy, XErrorEvent *ee);
       - static void zoom(const Arg *arg);
       - 
       - /* variables */
       -+static Systray *systray = NULL;
       - static const char broken[] = "broken";
       - static char stext[256];
       - static int screen;
       -@@ -258,9 +289,10 @@ static void (*handler[LASTEvent]) (XEvent *) = {
       -         [MapRequest] = maprequest,
       -         [MotionNotify] = motionnotify,
       -         [PropertyNotify] = propertynotify,
       -+        [ResizeRequest] = resizerequest,
       -         [UnmapNotify] = unmapnotify
       - };
       --static Atom wmatom[WMLast], netatom[NetLast];
       -+static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
       - static int running = 1;
       - static Cur *cursor[CurLast];
       - static Clr **scheme;
       -@@ -442,7 +474,7 @@ buttonpress(XEvent *e)
       -                         arg.ui = 1 << i;
       -                 } else if (ev->x < x + TEXTW(selmon->ltsymbol))
       -                         click = ClkLtSymbol;
       --                else if (ev->x > selmon->ww - (int)TEXTW(stext))
       -+                else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth())
       -                         click = ClkStatusText;
       -                 else
       -                         click = ClkWinTitle;
       -@@ -485,6 +517,13 @@ cleanup(void)
       -         XUngrabKey(dpy, AnyKey, AnyModifier, root);
       -         while (mons)
       -                 cleanupmon(mons);
       -+
       -+        if (showsystray) {
       -+                XUnmapWindow(dpy, systray->win);
       -+                XDestroyWindow(dpy, systray->win);
       -+                free(systray);
       -+        }
       -+
       -         for (i = 0; i < CurLast; i++)
       -                 drw_cur_free(drw, cursor[i]);
       -         for (i = 0; i < LENGTH(colors); i++)
       -@@ -516,9 +555,58 @@ cleanupmon(Monitor *mon)
       - void
       - clientmessage(XEvent *e)
       - {
       -+        XWindowAttributes wa;
       -+        XSetWindowAttributes swa;
       -         XClientMessageEvent *cme = &e->xclient;
       -         Client *c = wintoclient(cme->window);
       - 
       -+        if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
       -+                /* add systray icons */
       -+                if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
       -+                        if (!(c = (Client *)calloc(1, sizeof(Client))))
       -+                                die("fatal: could not malloc() %u bytes\n", sizeof(Client));
       -+                        if (!(c->win = cme->data.l[2])) {
       -+                                free(c);
       -+                                return;
       -+                        }
       -+                        c->mon = selmon;
       -+                        c->next = systray->icons;
       -+                        systray->icons = c;
       -+                        if (!XGetWindowAttributes(dpy, c->win, &wa)) {
       -+                                /* use sane defaults */
       -+                                wa.width = bh;
       -+                                wa.height = bh;
       -+                                wa.border_width = 0;
       -+                        }
       -+                        c->x = c->oldx = c->y = c->oldy = 0;
       -+                        c->w = c->oldw = wa.width;
       -+                        c->h = c->oldh = wa.height;
       -+                        c->oldbw = wa.border_width;
       -+                        c->bw = 0;
       -+                        c->isfloating = True;
       -+                        /* reuse tags field as mapped status */
       -+                        c->tags = 1;
       -+                        updatesizehints(c);
       -+                        updatesystrayicongeom(c, wa.width, wa.height);
       -+                        XAddToSaveSet(dpy, c->win);
       -+                        XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
       -+                        XReparentWindow(dpy, c->win, systray->win, 0, 0);
       -+                        /* use parents background color */
       -+                        swa.background_pixel  = scheme[SchemeNorm][ColBg].pixel;
       -+                        XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa);
       -+                        sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
       -+                        /* FIXME not sure if I have to send these events, too */
       -+                        sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
       -+                        sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
       -+                        sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_MODALITY_ON, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
       -+                        XSync(dpy, False);
       -+                        resizebarwin(selmon);
       -+                        updatesystray();
       -+                        setclientstate(c, NormalState);
       -+                }
       -+                return;
       -+        }
       -+
       -         if (!c)
       -                 return;
       -         if (cme->message_type == netatom[NetWMState]) {
       -@@ -571,7 +659,7 @@ configurenotify(XEvent *e)
       -                                 for (c = m->clients; c; c = c->next)
       -                                         if (c->isfullscreen)
       -                                                 resizeclient(c, m->mx, m->my, m->mw, m->mh);
       --                                XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
       -+                                resizebarwin(m);
       -                         }
       -                         focus(NULL);
       -                         arrange(NULL);
       -@@ -656,6 +744,11 @@ destroynotify(XEvent *e)
       - 
       -         if ((c = wintoclient(ev->window)))
       -                 unmanage(c, 1);
       -+        else if ((c = wintosystrayicon(ev->window))) {
       -+                removesystrayicon(c);
       -+                resizebarwin(selmon);
       -+                updatesystray();
       -+        }
       - }
       - 
       - void
       -@@ -699,7 +792,7 @@ dirtomon(int dir)
       - void
       - drawbar(Monitor *m)
       - {
       --        int x, w, tw = 0;
       -+        int x, w, tw = 0, stw = 0;
       -         int boxs = drw->fonts->h / 9;
       -         int boxw = drw->fonts->h / 6 + 2;
       -         unsigned int i, occ = 0, urg = 0;
       -@@ -708,13 +801,17 @@ drawbar(Monitor *m)
       -         if (!m->showbar)
       -                 return;
       - 
       -+        if(showsystray && m == systraytomon(m) && !systrayonleft)
       -+                stw = getsystraywidth();
       -+
       -         /* draw status first so it can be overdrawn by tags later */
       -         if (m == selmon) { /* status is only drawn on selected monitor */
       -                 drw_setscheme(drw, scheme[SchemeNorm]);
       --                tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
       --                drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
       -+                tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px extra right padding */
       -+                drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0);
       -         }
       - 
       -+        resizebarwin(m);
       -         for (c = m->clients; c; c = c->next) {
       -                 occ |= c->tags;
       -                 if (c->isurgent)
       -@@ -735,7 +832,7 @@ drawbar(Monitor *m)
       -         drw_setscheme(drw, scheme[SchemeNorm]);
       -         x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
       - 
       --        if ((w = m->ww - tw - x) > bh) {
       -+        if ((w = m->ww - tw - stw - x) > bh) {
       -                 if (m->sel) {
       -                         drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
       -                         drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
       -@@ -746,7 +843,7 @@ drawbar(Monitor *m)
       -                         drw_rect(drw, x, 0, w, bh, 1, 1);
       -                 }
       -         }
       --        drw_map(drw, m->barwin, 0, 0, m->ww, bh);
       -+        drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh);
       - }
       - 
       - void
       -@@ -783,8 +880,11 @@ expose(XEvent *e)
       -         Monitor *m;
       -         XExposeEvent *ev = &e->xexpose;
       - 
       --        if (ev->count == 0 && (m = wintomon(ev->window)))
       -+        if (ev->count == 0 && (m = wintomon(ev->window))) {
       -                 drawbar(m);
       -+                if (m == selmon)
       -+                        updatesystray();
       -+        }
       - }
       - 
       - void
       -@@ -870,14 +970,32 @@ getatomprop(Client *c, Atom prop)
       -         unsigned char *p = NULL;
       -         Atom da, atom = None;
       - 
       --        if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM,
       -+        /* FIXME getatomprop should return the number of items and a pointer to
       -+         * the stored data instead of this workaround */
       -+        Atom req = XA_ATOM;
       -+        if (prop == xatom[XembedInfo])
       -+                req = xatom[XembedInfo];
       -+
       -+        if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req,
       -                 &da, &di, &dl, &dl, &p) == Success && p) {
       -                 atom = *(Atom *)p;
       -+                if (da == xatom[XembedInfo] && dl == 2)
       -+                        atom = ((Atom *)p)[1];
       -                 XFree(p);
       -         }
       -         return atom;
       - }
       - 
       -+unsigned int
       -+getsystraywidth()
       -+{
       -+        unsigned int w = 0;
       -+        Client *i;
       -+        if(showsystray)
       -+                for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ;
       -+        return w ? w + systrayspacing : 1;
       -+}
       -+
       - int
       - getrootptr(int *x, int *y)
       - {
       -@@ -1018,7 +1136,8 @@ killclient(const Arg *arg)
       - {
       -         if (!selmon->sel)
       -                 return;
       --        if (!sendevent(selmon->sel, wmatom[WMDelete])) {
       -+
       -+        if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) {
       -                 XGrabServer(dpy);
       -                 XSetErrorHandler(xerrordummy);
       -                 XSetCloseDownMode(dpy, DestroyAll);
       -@@ -1105,6 +1224,13 @@ maprequest(XEvent *e)
       -         static XWindowAttributes wa;
       -         XMapRequestEvent *ev = &e->xmaprequest;
       - 
       -+        Client *i;
       -+        if ((i = wintosystrayicon(ev->window))) {
       -+                sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION);
       -+                resizebarwin(selmon);
       -+                updatesystray();
       -+        }
       -+
       -         if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect)
       -                 return;
       -         if (!wintoclient(ev->window))
       -@@ -1226,6 +1352,17 @@ propertynotify(XEvent *e)
       -         Window trans;
       -         XPropertyEvent *ev = &e->xproperty;
       - 
       -+        if ((c = wintosystrayicon(ev->window))) {
       -+                if (ev->atom == XA_WM_NORMAL_HINTS) {
       -+                        updatesizehints(c);
       -+                        updatesystrayicongeom(c, c->w, c->h);
       -+                }
       -+                else
       -+                        updatesystrayiconstate(c, ev);
       -+                resizebarwin(selmon);
       -+                updatesystray();
       -+        }
       -+
       -         if ((ev->window == root) && (ev->atom == XA_WM_NAME))
       -                 updatestatus();
       -         else if (ev->state == PropertyDelete)
       -@@ -1276,6 +1413,19 @@ recttomon(int x, int y, int w, int h)
       -         return r;
       - }
       - 
       -+void
       -+removesystrayicon(Client *i)
       -+{
       -+        Client **ii;
       -+
       -+        if (!showsystray || !i)
       -+                return;
       -+        for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
       -+        if (ii)
       -+                *ii = i->next;
       -+        free(i);
       -+}
       -+
       - void
       - resize(Client *c, int x, int y, int w, int h, int interact)
       - {
       -@@ -1283,6 +1433,14 @@ resize(Client *c, int x, int y, int w, int h, int interact)
       -                 resizeclient(c, x, y, w, h);
       - }
       - 
       -+void
       -+resizebarwin(Monitor *m) {
       -+        unsigned int w = m->ww;
       -+        if (showsystray && m == systraytomon(m) && !systrayonleft)
       -+                w -= getsystraywidth();
       -+        XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
       -+}
       -+
       - void
       - resizeclient(Client *c, int x, int y, int w, int h)
       - {
       -@@ -1298,6 +1456,19 @@ resizeclient(Client *c, int x, int y, int w, int h)
       -         XSync(dpy, False);
       - }
       - 
       -+void
       -+resizerequest(XEvent *e)
       -+{
       -+        XResizeRequestEvent *ev = &e->xresizerequest;
       -+        Client *i;
       -+
       -+        if ((i = wintosystrayicon(ev->window))) {
       -+                updatesystrayicongeom(i, ev->width, ev->height);
       -+                resizebarwin(selmon);
       -+                updatesystray();
       -+        }
       -+}
       -+
       - void
       - resizemouse(const Arg *arg)
       - {
       -@@ -1444,26 +1615,37 @@ setclientstate(Client *c, long state)
       - }
       - 
       - int
       --sendevent(Client *c, Atom proto)
       -+sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4)
       - {
       -         int n;
       --        Atom *protocols;
       -+        Atom *protocols, mt;
       -         int exists = 0;
       -         XEvent ev;
       - 
       --        if (XGetWMProtocols(dpy, c->win, &protocols, &n)) {
       --                while (!exists && n--)
       --                        exists = protocols[n] == proto;
       --                XFree(protocols);
       -+        if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) {
       -+                mt = wmatom[WMProtocols];
       -+                if (XGetWMProtocols(dpy, w, &protocols, &n)) {
       -+                        while (!exists && n--)
       -+                                exists = protocols[n] == proto;
       -+                        XFree(protocols);
       -+                }
       -+        }
       -+        else {
       -+                exists = True;
       -+                mt = proto;
       -         }
       -+
       -         if (exists) {
       -                 ev.type = ClientMessage;
       --                ev.xclient.window = c->win;
       --                ev.xclient.message_type = wmatom[WMProtocols];
       -+                ev.xclient.window = w;
       -+                ev.xclient.message_type = mt;
       -                 ev.xclient.format = 32;
       --                ev.xclient.data.l[0] = proto;
       --                ev.xclient.data.l[1] = CurrentTime;
       --                XSendEvent(dpy, c->win, False, NoEventMask, &ev);
       -+                ev.xclient.data.l[0] = d0;
       -+                ev.xclient.data.l[1] = d1;
       -+                ev.xclient.data.l[2] = d2;
       -+                ev.xclient.data.l[3] = d3;
       -+                ev.xclient.data.l[4] = d4;
       -+                XSendEvent(dpy, w, False, mask, &ev);
       -         }
       -         return exists;
       - }
       -@@ -1477,7 +1659,7 @@ setfocus(Client *c)
       -                         XA_WINDOW, 32, PropModeReplace,
       -                         (unsigned char *) &(c->win), 1);
       -         }
       --        sendevent(c, wmatom[WMTakeFocus]);
       -+        sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
       - }
       - 
       - void
       -@@ -1566,6 +1748,10 @@ setup(void)
       -         wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
       -         netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
       -         netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
       -+        netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
       -+        netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
       -+        netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
       -+        netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False);
       -         netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
       -         netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
       -         netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
       -@@ -1573,6 +1759,9 @@ setup(void)
       -         netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
       -         netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
       -         netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
       -+        xatom[Manager] = XInternAtom(dpy, "MANAGER", False);
       -+        xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
       -+        xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
       -         /* init cursors */
       -         cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
       -         cursor[CurResize] = drw_cur_create(drw, XC_sizing);
       -@@ -1581,6 +1770,8 @@ setup(void)
       -         scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
       -         for (i = 0; i < LENGTH(colors); i++)
       -                 scheme[i] = drw_scm_create(drw, colors[i], 3);
       -+        /* init system tray */
       -+        updatesystray();
       -         /* init bars */
       -         updatebars();
       -         updatestatus();
       -@@ -1711,7 +1902,18 @@ togglebar(const Arg *arg)
       - {
       -         selmon->showbar = !selmon->showbar;
       -         updatebarpos(selmon);
       --        XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
       -+        resizebarwin(selmon);
       -+        if (showsystray) {
       -+                XWindowChanges wc;
       -+                if (!selmon->showbar)
       -+                        wc.y = -bh;
       -+                else if (selmon->showbar) {
       -+                        wc.y = 0;
       -+                        if (!selmon->topbar)
       -+                                wc.y = selmon->mh - bh;
       -+                }
       -+                XConfigureWindow(dpy, systray->win, CWY, &wc);
       -+        }
       -         arrange(selmon);
       - }
       - 
       -@@ -1807,11 +2009,18 @@ unmapnotify(XEvent *e)
       -                 else
       -                         unmanage(c, 0);
       -         }
       -+        else if ((c = wintosystrayicon(ev->window))) {
       -+                /* KLUDGE! sometimes icons occasionally unmap their windows, but do
       -+                 * _not_ destroy them. We map those windows back */
       -+                XMapRaised(dpy, c->win);
       -+                updatesystray();
       -+        }
       - }
       - 
       - void
       - updatebars(void)
       - {
       -+        unsigned int w;
       -         Monitor *m;
       -         XSetWindowAttributes wa = {
       -                 .override_redirect = True,
       -@@ -1822,10 +2031,15 @@ updatebars(void)
       -         for (m = mons; m; m = m->next) {
       -                 if (m->barwin)
       -                         continue;
       --                m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
       -+                w = m->ww;
       -+                if (showsystray && m == systraytomon(m))
       -+                        w -= getsystraywidth();
       -+                m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen),
       -                                 CopyFromParent, DefaultVisual(dpy, screen),
       -                                 CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
       -                 XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
       -+                if (showsystray && m == systraytomon(m))
       -+                        XMapRaised(dpy, systray->win);
       -                 XMapRaised(dpy, m->barwin);
       -                 XSetClassHint(dpy, m->barwin, &ch);
       -         }
       -@@ -2002,6 +2216,125 @@ updatestatus(void)
       -         if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
       -                 strcpy(stext, "dwm-"VERSION);
       -         drawbar(selmon);
       -+        updatesystray();
       -+}
       -+
       -+
       -+void
       -+updatesystrayicongeom(Client *i, int w, int h)
       -+{
       -+        if (i) {
       -+                i->h = bh;
       -+                if (w == h)
       -+                        i->w = bh;
       -+                else if (h == bh)
       -+                        i->w = w;
       -+                else
       -+                        i->w = (int) ((float)bh * ((float)w / (float)h));
       -+                applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False);
       -+                /* force icons into the systray dimensions if they don't want to */
       -+                if (i->h > bh) {
       -+                        if (i->w == i->h)
       -+                                i->w = bh;
       -+                        else
       -+                                i->w = (int) ((float)bh * ((float)i->w / (float)i->h));
       -+                        i->h = bh;
       -+                }
       -+        }
       -+}
       -+
       -+void
       -+updatesystrayiconstate(Client *i, XPropertyEvent *ev)
       -+{
       -+        long flags;
       -+        int code = 0;
       -+
       -+        if (!showsystray || !i || ev->atom != xatom[XembedInfo] ||
       -+                        !(flags = getatomprop(i, xatom[XembedInfo])))
       -+                return;
       -+
       -+        if (flags & XEMBED_MAPPED && !i->tags) {
       -+                i->tags = 1;
       -+                code = XEMBED_WINDOW_ACTIVATE;
       -+                XMapRaised(dpy, i->win);
       -+                setclientstate(i, NormalState);
       -+        }
       -+        else if (!(flags & XEMBED_MAPPED) && i->tags) {
       -+                i->tags = 0;
       -+                code = XEMBED_WINDOW_DEACTIVATE;
       -+                XUnmapWindow(dpy, i->win);
       -+                setclientstate(i, WithdrawnState);
       -+        }
       -+        else
       -+                return;
       -+        sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0,
       -+                        systray->win, XEMBED_EMBEDDED_VERSION);
       -+}
       -+
       -+void
       -+updatesystray(void)
       -+{
       -+        XSetWindowAttributes wa;
       -+        XWindowChanges wc;
       -+        Client *i;
       -+        Monitor *m = systraytomon(NULL);
       -+        unsigned int x = m->mx + m->mw;
       -+        unsigned int sw = TEXTW(stext) - lrpad + systrayspacing;
       -+        unsigned int w = 1;
       -+
       -+        if (!showsystray)
       -+                return;
       -+        if (systrayonleft)
       -+                x -= sw + lrpad / 2;
       -+        if (!systray) {
       -+                /* init systray */
       -+                if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
       -+                        die("fatal: could not malloc() %u bytes\n", sizeof(Systray));
       -+                systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel);
       -+                wa.event_mask        = ButtonPressMask | ExposureMask;
       -+                wa.override_redirect = True;
       -+                wa.background_pixel  = scheme[SchemeNorm][ColBg].pixel;
       -+                XSelectInput(dpy, systray->win, SubstructureNotifyMask);
       -+                XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
       -+                                PropModeReplace, (unsigned char *)&netatom[NetSystemTrayOrientationHorz], 1);
       -+                XChangeWindowAttributes(dpy, systray->win, CWEventMask|CWOverrideRedirect|CWBackPixel, &wa);
       -+                XMapRaised(dpy, systray->win);
       -+                XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime);
       -+                if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) {
       -+                        sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0);
       -+                        XSync(dpy, False);
       -+                }
       -+                else {
       -+                        fprintf(stderr, "dwm: unable to obtain system tray.\n");
       -+                        free(systray);
       -+                        systray = NULL;
       -+                        return;
       -+                }
       -+        }
       -+        for (w = 0, i = systray->icons; i; i = i->next) {
       -+                /* make sure the background color stays the same */
       -+                wa.background_pixel  = scheme[SchemeNorm][ColBg].pixel;
       -+                XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
       -+                XMapRaised(dpy, i->win);
       -+                w += systrayspacing;
       -+                i->x = w;
       -+                XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h);
       -+                w += i->w;
       -+                if (i->mon != m)
       -+                        i->mon = m;
       -+        }
       -+        w = w ? w + systrayspacing : 1;
       -+        x -= w;
       -+        XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh);
       -+        wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh;
       -+        wc.stack_mode = Above; wc.sibling = m->barwin;
       -+        XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc);
       -+        XMapWindow(dpy, systray->win);
       -+        XMapSubwindows(dpy, systray->win);
       -+        /* redraw background */
       -+        XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
       -+        XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
       -+        XSync(dpy, False);
       - }
       - 
       - void
       -@@ -2069,6 +2402,16 @@ wintoclient(Window w)
       -         return NULL;
       - }
       - 
       -+Client *
       -+wintosystrayicon(Window w) {
       -+        Client *i = NULL;
       -+
       -+        if (!showsystray || !w)
       -+                return i;
       -+        for (i = systray->icons; i && i->win != w; i = i->next) ;
       -+        return i;
       -+}
       -+
       - Monitor *
       - wintomon(Window w)
       - {
       -@@ -2122,6 +2465,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
       -         return -1;
       - }
       - 
       -+Monitor *
       -+systraytomon(Monitor *m) {
       -+        Monitor *t;
       -+        int i, n;
       -+        if(!systraypinning) {
       -+                if(!m)
       -+                        return selmon;
       -+                return m == selmon ? m : NULL;
       -+        }
       -+        for(n = 1, t = mons; t && t->next; n++, t = t->next) ;
       -+        for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ;
       -+        if(systraypinningfailfirst && n < systraypinning)
       -+                return mons;
       -+        return t;
       -+}
       -+
       - void
       - zoom(const Arg *arg)
       - {
 (DIR) diff --git a/suckless/herbe/Makefile b/suckless/herbe/Makefile
       @@ -1,40 +0,0 @@
       -REPOSITORY = https://github.com/dudik/herbe.git
       -SRC_DIR = src
       -PINNED_REVISION = HEAD
       -PATCH_DIR = patches
       -
       -all: $(SRC_DIR)
       -
       -clean: reset
       -        @if test -d $(SRC_DIR); then \
       -                $(MAKE) -C "${SRC_DIR}" -s clean; \
       -                git -C "${SRC_DIR}" clean -f; \
       -        fi
       -
       -$(SRC_DIR): clone reset
       -        @cp config.h $@
       -        $(MAKE) -C "${SRC_DIR}" -s
       -
       -reset:
       -        @if [ -n "$(strip $(PINNED_REVISION))" ]; then \
       -                git -C "${SRC_DIR}" reset --hard $(PINNED_REVISION); \
       -        fi
       -
       -patch: $(PATCH_DIR)/*
       -        @for file in $^ ; do \
       -                patch -d "${SRC_DIR}" < $${file}; \
       -        done
       -
       -clone:
       -        @if ! test -d $(SRC_DIR); then \
       -                git clone $(REPOSITORY) $(SRC_DIR); \
       -        fi
       -
       -update: clean
       -        @git -C "${SRC_DIR}" pull
       -
       -install:
       -        $(MAKE) -C "${SRC_DIR}" -s install
       -
       -
       -.PHONY: all clean update install reset clone
 (DIR) diff --git a/suckless/herbe/config.h b/suckless/herbe/config.h
       @@ -1,19 +0,0 @@
       -static const char *background_color = "#222222";
       -static const char *border_color = "#008000";
       -static const char *font_color = "#ffd7af";
       -static const char *font_pattern = "Hack:pixelsize=12";
       -static unsigned line_spacing = 5;
       -static unsigned int padding = 12;
       -
       -static unsigned int width = 300;
       -static unsigned int border_size = 3;
       -static unsigned int pos_x = 30;
       -static unsigned int pos_y = 60;
       -
       -enum corners { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };
       -enum corners corner = TOP_RIGHT;
       -
       -static unsigned int duration = 5; /* in seconds */
       -
       -#define DISMISS_BUTTON Button1
       -#define ACTION_BUTTON Button3
 (DIR) diff --git a/suckless/slstatus/Makefile b/suckless/slstatus/Makefile
       @@ -1,35 +0,0 @@
       -REPOSITORY = git://git.suckless.org/slstatus
       -SRC_DIR = src
       -PINNED_REVISION = HEAD
       -
       -all: $(SRC_DIR)
       -
       -clean: reset
       -        @if test -d $(SRC_DIR); then \
       -                cd $(SRC_DIR); \
       -                $(MAKE) -s clean; \
       -                git clean -f; \
       -        fi
       -
       -$(SRC_DIR): clone reset
       -        @cp config.h $@
       -        @cd $@ && $(MAKE) -s
       -
       -reset:
       -        @if [ -n "$(strip $(PINNED_REVISION))" ]; then \
       -                cd $(SRC_DIR) && git reset --hard $(PINNED_REVISION); \
       -        fi
       -
       -clone:
       -        @if ! test -d $(SRC_DIR); then \
       -                git clone $(REPOSITORY) $(SRC_DIR); \
       -        fi
       -
       -update: clean
       -        @cd $(SRC_DIR) && git pull
       -
       -install:
       -        $(MAKE) -C "${SRC_DIR}" -s install
       -
       -
       -.PHONY: all clean update install reset clone
 (DIR) diff --git a/suckless/slstatus/config.h b/suckless/slstatus/config.h
       @@ -1,71 +0,0 @@
       -/* See LICENSE file for copyright and license details. */
       -
       -/* interval between updates (in ms) */
       -const unsigned int interval = 1000;
       -
       -/* text to show if no value can be retrieved */
       -static const char unknown_str[] = "n/a";
       -
       -/* maximum output string length */
       -#define MAXLEN 2048
       -
       -/*
       - * function            description                     argument (example)
       - *
       - * battery_perc        battery percentage              battery name (BAT0)
       - *                                                     NULL on OpenBSD/FreeBSD
       - * battery_remaining   battery remaining HH:MM         battery name (BAT0)
       - *                                                     NULL on OpenBSD/FreeBSD
       - * battery_state       battery charging state          battery name (BAT0)
       - *                                                     NULL on OpenBSD/FreeBSD
       - * cat                 read arbitrary file             path
       - * cpu_freq            cpu frequency in MHz            NULL
       - * cpu_perc            cpu usage in percent            NULL
       - * datetime            date and time                   format string (%F %T)
       - * disk_free           free disk space in GB           mountpoint path (/)
       - * disk_perc           disk usage in percent           mountpoint path (/)
       - * disk_total          total disk space in GB          mountpoint path (/)
       - * disk_used           used disk space in GB           mountpoint path (/)
       - * entropy             available entropy               NULL
       - * gid                 GID of current user             NULL
       - * hostname            hostname                        NULL
       - * ipv4                IPv4 address                    interface name (eth0)
       - * ipv6                IPv6 address                    interface name (eth0)
       - * kernel_release      `uname -r`                      NULL
       - * keyboard_indicators caps/num lock indicators        format string (c?n?)
       - *                                                     see keyboard_indicators.c
       - * keymap              layout (variant) of current     NULL
       - *                     keymap
       - * load_avg            load average                    NULL
       - * netspeed_rx         receive network speed           interface name (wlan0)
       - * netspeed_tx         transfer network speed          interface name (wlan0)
       - * num_files           number of files in a directory  path
       - *                                                     (/home/foo/Inbox/cur)
       - * ram_free            free memory in GB               NULL
       - * ram_perc            memory usage in percent         NULL
       - * ram_total           total memory size in GB         NULL
       - * ram_used            used memory in GB               NULL
       - * run_command         custom shell command            command (echo foo)
       - * swap_free           free swap in GB                 NULL
       - * swap_perc           swap usage in percent           NULL
       - * swap_total          total swap size in GB           NULL
       - * swap_used           used swap in GB                 NULL
       - * temp                temperature in degree celsius   sensor file
       - *                                                     (/sys/class/thermal/...)
       - *                                                     NULL on OpenBSD
       - *                                                     thermal zone on FreeBSD
       - *                                                     (tz0, tz1, etc.)
       - * uid                 UID of current user             NULL
       - * uptime              system uptime                   NULL
       - * username            username of current user        NULL
       - * vol_perc            OSS/ALSA volume in percent      mixer file (/dev/mixer)
       - *                                                     NULL on OpenBSD/FreeBSD
       - * wifi_essid          WiFi ESSID                      interface name (wlan0)
       - * wifi_perc           WiFi signal in percent          interface name (wlan0)
       - */
       -static const struct arg args[] = {
       -        /* function format          argument */
       -        { run_command, "VPN:%4s | ", "if [ `mullvad status|grep Disconnected` ]; then echo 'Off';else echo 'On'; fi" },
       -        { run_command, "VOL:%4s | ", "pactl list sinks | tr ' ' '\n' | grep -m1 '%'" },
       -        { datetime, "%s",            "%T" },
       -};
 (DIR) diff --git a/sway/config b/sway/config
       @@ -0,0 +1,87 @@
       +set $mod Mod1
       +
       +# colour theme
       +set $colour #013220
       +
       +set $left h
       +set $down j
       +set $up k
       +set $right l
       +
       +# apps
       +set $term footclient -d none
       +set $browser qutebrowser
       +set $menu bemenu-run -n -p '> ' --tb '$colour' --tf '#ffffff' --hf '#444444'
       +set $vol pamixer
       +
       +# autostart
       +exec foot --server
       +exec wl-paste -t text --watch clipman store --no-persist
       +exec /usr/libexec/pipewire-launcher
       +
       +# appearance
       +default_border none
       +default_floating_border none
       +workspace_layout tabbed
       +font pango: Hack:style=Regular 2
       +
       +# misc
       +xwayland enable
       +bar swaybar_command waybar
       +
       +# Keyboard layout
       +input * {
       +    xkb_layout "gb"
       +    xkb_variant "extd"
       +}
       +
       +# monitors
       +output HDMI-A-1 pos 0 0 res 1920x1080
       +output DP-1 pos 1920 0 res 1920x1080
       +#focus output DP-1
       +
       +# workspaces
       +workspace 1 HDMI-A-1
       +workspace 2 HDMI-A-1
       +workspace 3 DP-1
       +workspace 4 DP-1
       +
       +# Keybinds
       +bindsym $mod+Space exec $term
       +bindsym $mod+p exec $menu
       +bindsym $mod+f exec $browser
       +bindsym $mod+u exec $vol -i 5
       +bindsym $mod+d exec $vol -d 5
       +
       +bindsym $mod+c kill
       +bindsym $mod+Shift+c reload
       +bindsym $mod+Shift+q exec swaymsg exit
       +
       +# Move your focus around
       +bindsym $mod+$left focus left
       +bindsym $mod+$down focus down
       +bindsym $mod+$up focus up
       +bindsym $mod+$right focus right
       +
       +# Or use $mod+[up|down|left|right]
       +bindsym $mod+Left focus left
       +bindsym $mod+Down focus down
       +bindsym $mod+Up focus up
       +bindsym $mod+Right focus right
       +
       +# Switch to workspace
       +bindsym $mod+1 workspace number 1
       +bindsym $mod+2 workspace number 2
       +bindsym $mod+3 workspace number 3
       +bindsym $mod+4 workspace number 4
       +
       +bindsym $mod+Shift+1 move container to workspace number 1
       +bindsym $mod+Shift+2 move container to workspace number 2
       +bindsym $mod+Shift+3 move container to workspace number 3
       +bindsym $mod+Shift+4 move container to workspace number 4
       +
       +bindsym $mod+e layout toggle split
       +bindsym $mod+m fullscreen
       +bindsym $mod+w layout tabbed
       +
       +client.focused $colour $colour $colour
 (DIR) diff --git a/waybar/config b/waybar/config
       @@ -0,0 +1,65 @@
       +{
       +        "layer": "top",
       +        "position": "top",
       +
       +        "modules-left": [
       +                "sway/workspaces",
       +                "custom/right-arrow-dark"
       +        ],
       +
       +        "modules-right": [
       +                "custom/left-arrow-dark",
       +                "custom/mail",
       +                "custom/newsboat",
       +                "pulseaudio",
       +                "tray",
       +                "clock"
       +        ],
       +
       +        "custom/right-arrow-dark": {
       +                "format": "",
       +                "tooltip": false
       +        },
       +
       +        "custom/left-arrow-dark": {
       +                "format": "",
       +                "tooltip": false
       +        },
       +
       +        "sway/workspaces": {
       +                "disable-scroll": true,
       +                "format": "{name}"
       +        },
       +
       +        "clock": {
       +                "format": "{:%H:%M}",
       +                "tooltip": false
       +        },
       +
       +        "pulseaudio": {
       +                "format": "{icon} {volume:2}%",
       +                "format-bluetooth": " {volume}%",
       +                "format-muted": "MUTE",
       +                "format-icons": {
       +                        "default": [
       +                                "",
       +                                ""
       +                        ]
       +                },
       +                "scroll-step": 5,
       +                "on-click": "pamixer -t",
       +                "on-click-right": "foot ncmpcpp"
       +        },
       +
       +        "custom/mail": {
       +                    "format": "",
       +                "return-type": "json",
       +                    "interval": 120,
       +                "exec": "$HOME/.config/waybar/waybar_mail.sh",
       +                "on-click": "foot mutt",
       +        },
       +
       +        "tray": {
       +                "icon-size": 15
       +        }
       +}
 (DIR) diff --git a/waybar/style.css b/waybar/style.css
       @@ -0,0 +1,58 @@
       +* {
       +        font-size: 12px;
       +        font-family: monospace;
       +}
       +
       +window#waybar {
       +        background: #292b2e;
       +        color: #fdf6e3;
       +}
       +
       +#workspaces,
       +#clock,
       +#custom-mail,
       +#custom-newsboat,
       +#custom-vpn,
       +#pulseaudio,
       +#tray {
       +        background: #1a1a1a;
       +}
       +
       +#custom-right-arrow-dark,
       +#custom-left-arrow-dark {
       +        color: #1a1a1a;
       +}
       +
       +#workspaces button {
       +        padding: 0 0px;
       +        color: #fdf6e3;
       +}
       +#workspaces button.focused {
       +        color: #268bd2;
       +}
       +#workspaces button:hover {
       +        box-shadow: inherit;
       +        text-shadow: inherit;
       +}
       +#workspaces button:hover {
       +        background: #1a1a1a;
       +        border: #1a1a1a;
       +        padding: 0 3px;
       +}
       +
       +#custom-mail.new,
       +#custom-newsboat.new {
       +        color: #268bd2;
       +}
       +
       +#custom-vpn.connected {
       +        color: #d22635;
       +}
       +
       +#clock,
       +#custom-mail,
       +#custom-newsboat,
       +#custom-vpn,
       +#pulseaudio {
       +        padding: 0 5px;
       +}
 (DIR) diff --git a/waybar/waybar_mail.sh b/waybar/waybar_mail.sh
       @@ -0,0 +1,12 @@
       +#!/bin/sh
       +
       +maildirnew="$HOME/.mail/jay/Inbox/new/"
       +new="$(find $maildirnew -type f | wc -l)"
       +
       +if [ $new -gt 0 ]
       +then
       +        echo "{\"text\":\"$new\",\"tooltip\":\"$new Mail\",\"class\":\"new\"}"
       +else
       +        echo '{"text":"No new mail","tooltip":"","class":""}'
       +fi
       +
 (DIR) diff --git a/waybar/waybar_newsboat.sh b/waybar/waybar_newsboat.sh
       @@ -0,0 +1,11 @@
       +#!/usr/bin/bash
       +
       +new="$(newsboat -x print-unread | awk '{ print $1}')"
       +
       +if [ $new -gt 0 ]
       +then
       +        echo "{\"text\":\"$new\",\"tooltip\":\"$new Feeds\",\"class\":\"new\"}"
       +else
       +        echo '{"text":"No new feeds","tooltip":"","class":""}'
       +fi
       +