├── config ├── st │ ├── world │ ├── .gitignore │ ├── shell.nix │ ├── hb.h │ ├── st.desktop │ ├── normalMode.h │ ├── st-urlhandler │ ├── st-copyout │ ├── xresources │ ├── config.mk │ ├── arg.h │ ├── win.h │ ├── utils.h │ ├── LICENSE │ ├── Makefile │ ├── hb.c │ ├── README.md │ ├── st.h │ ├── st.info │ ├── st.1 │ ├── boxdraw.c │ └── boxdraw_data.h ├── dwm │ ├── .gitignore │ ├── src │ │ ├── .gitignore │ │ ├── dwm │ │ ├── drw.o │ │ ├── dwm.o │ │ ├── util.o │ │ ├── util.h │ │ ├── util.c │ │ ├── transient.c │ │ ├── config.mk.orig │ │ ├── config.mk │ │ ├── README │ │ ├── Makefile │ │ ├── drw.h │ │ ├── LICENSE │ │ ├── dwm.c.rej │ │ ├── dwm.1 │ │ ├── config.def.h.orig │ │ ├── config.h │ │ ├── config.def.h │ │ └── drw.c.orig │ ├── wallpapers │ │ └── sea.jpg │ └── scripts │ │ ├── start │ │ └── widgets ├── rofi │ ├── config.rasi │ ├── colors │ │ └── colors.rasi │ └── appmnu.rasi ├── eww │ ├── scripts │ │ ├── getLayout │ │ ├── echoSongArt │ │ ├── lockScreen │ │ ├── getUsedRam │ │ ├── getCalendarMonth │ │ ├── toggle-vpn.sh │ │ ├── getNetwork │ │ ├── openCalendar.sh │ │ ├── openSysTray.sh │ │ ├── getSongTitle │ │ ├── getSongArt │ │ ├── getWeather │ │ ├── getPlayerStatus │ │ ├── getSongArtist │ │ ├── getVpn │ │ └── getWorkspaces │ ├── src │ │ ├── scss │ │ │ ├── _config.scss │ │ │ ├── _overrides.scss │ │ │ ├── widgets │ │ │ │ └── _layouts.scss │ │ │ ├── bar │ │ │ │ ├── widgets │ │ │ │ │ ├── _time.scss │ │ │ │ │ ├── _launcher.scss │ │ │ │ │ ├── _browser.scss │ │ │ │ │ ├── _chat.scss │ │ │ │ │ ├── _rofi.scss │ │ │ │ │ ├── _terminal.scss │ │ │ │ │ ├── _vpn.scss │ │ │ │ │ ├── _workspaces.scss │ │ │ │ │ ├── _powermenu.scss │ │ │ │ │ ├── _calendar.scss │ │ │ │ │ └── _systray.scss │ │ │ │ └── index.scss │ │ │ ├── _variables.scss │ │ │ └── lock │ │ │ │ └── index.scss │ │ └── yuck │ │ │ ├── widgets │ │ │ ├── _definitions.yuck │ │ │ └── _widgets.yuck │ │ │ ├── lock │ │ │ ├── _definitions.yuck │ │ │ └── _widgets.yuck │ │ │ ├── bar │ │ │ ├── _definitions.yuck │ │ │ └── _widgets.yuck │ │ │ └── _variables.yuck │ ├── assets │ │ ├── avatar.jpg │ │ ├── fallback.png │ │ └── lockscreen.png │ ├── eww.yuck │ └── eww.scss ├── fish │ ├── fish_plugins │ ├── functions │ │ ├── _nvm_version_activate.fish │ │ ├── _nvm_version_deactivate.fish │ │ ├── _nvm_list.fish │ │ ├── fish_prompt.fish │ │ ├── fish_mode_prompt.fish │ │ ├── _nvm_index_update.fish │ │ ├── fish_right_prompt.fish │ │ ├── nvm.fish │ │ └── fisher.fish │ ├── completions │ │ ├── fisher.fish │ │ └── nvm.fish │ ├── conf.d │ │ └── nvm.fish │ ├── config.fish │ └── fish_variables ├── tym │ ├── config.lua │ └── theme.lua ├── starship.toml ├── picom │ └── picom.conf └── dunst │ └── dunstrc ├── misc └── demonstration.png ├── launchers ├── dwm.desktop └── xinitrc ├── bin ├── nv ├── bunnyfetch ├── xcolor-pick └── fetch ├── home └── .Xresources └── README.md /config/st/world: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /config/dwm/.gitignore: -------------------------------------------------------------------------------- 1 | patches 2 | -------------------------------------------------------------------------------- /config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | @theme "appmnu" 2 | -------------------------------------------------------------------------------- /config/st/.gitignore: -------------------------------------------------------------------------------- 1 | config.h 2 | st 3 | *.o 4 | -------------------------------------------------------------------------------- /config/dwm/src/.gitignore: -------------------------------------------------------------------------------- 1 | patches 2 | *.o 3 | *.rej 4 | *.orij 5 | -------------------------------------------------------------------------------- /config/eww/scripts/getLayout: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | layout-mgr.sh get 4 | -------------------------------------------------------------------------------- /config/eww/src/scss/_config.scss: -------------------------------------------------------------------------------- 1 | .line { 2 | margin-left: -1px; 3 | } -------------------------------------------------------------------------------- /config/fish/fish_plugins: -------------------------------------------------------------------------------- 1 | jorgebucaran/fisher 2 | jorgebucaran/nvm.fish 3 | -------------------------------------------------------------------------------- /config/eww/scripts/echoSongArt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "$HOME/.cache/eww/spotify/cover.png" -------------------------------------------------------------------------------- /config/dwm/src/dwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/dwm/src/dwm -------------------------------------------------------------------------------- /config/dwm/src/drw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/dwm/src/drw.o -------------------------------------------------------------------------------- /config/dwm/src/dwm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/dwm/src/dwm.o -------------------------------------------------------------------------------- /config/dwm/src/util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/dwm/src/util.o -------------------------------------------------------------------------------- /misc/demonstration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/misc/demonstration.png -------------------------------------------------------------------------------- /config/eww/scripts/lockScreen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pkill eww 4 | sleep 0.5 && $HOME/.local/bin/lock 5 | -------------------------------------------------------------------------------- /config/dwm/wallpapers/sea.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/dwm/wallpapers/sea.jpg -------------------------------------------------------------------------------- /config/eww/assets/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/eww/assets/avatar.jpg -------------------------------------------------------------------------------- /config/eww/scripts/getUsedRam: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') -------------------------------------------------------------------------------- /config/eww/assets/fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/eww/assets/fallback.png -------------------------------------------------------------------------------- /config/eww/assets/lockscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaTechnolog/dwm/HEAD/config/eww/assets/lockscreen.png -------------------------------------------------------------------------------- /launchers/dwm.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=dwm 3 | Comment=Spawn dwm 4 | Exec=/home/gabriel/.config/dwm/scripts/start 5 | Type=Application 6 | -------------------------------------------------------------------------------- /config/eww/src/scss/_overrides.scss: -------------------------------------------------------------------------------- 1 | * { 2 | all: unset; 3 | } 4 | 5 | window { 6 | color: $fg; 7 | font-family: "Iosevka Nerd Font"; 8 | } 9 | -------------------------------------------------------------------------------- /config/eww/scripts/getCalendarMonth: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | month=$(date +%m) 4 | month=$((month-1)) # for some reason eww gives the month as a zero-based integer 5 | 6 | echo $month -------------------------------------------------------------------------------- /config/eww/src/scss/widgets/_layouts.scss: -------------------------------------------------------------------------------- 1 | .layout { 2 | background: $bg; 3 | border: solid 1px $contrastbg; 4 | border-radius: 10px; 5 | color: $cyan; 6 | } 7 | -------------------------------------------------------------------------------- /config/st/shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | pkgs.mkShell { 4 | nativeBuildInputs = with pkgs; [ pkgconfig xorg.libX11 xorg.libXft fontconfig harfbuzz ]; 5 | } 6 | -------------------------------------------------------------------------------- /config/tym/config.lua: -------------------------------------------------------------------------------- 1 | local tym = require('tym') 2 | 3 | tym.set_config({ 4 | padding_horizontal = 10, 5 | padding_vertical = 10, 6 | font = 'JetBrainsMono Nerd Font 9' 7 | }) 8 | -------------------------------------------------------------------------------- /config/st/hb.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void hbunloadfonts(); 6 | void hbtransform(XftGlyphFontSpec *, const Glyph *, size_t, int, int); 7 | 8 | -------------------------------------------------------------------------------- /config/st/st.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=st 4 | Comment=simple-terminal emulator for X 5 | Icon=utilities-terminal 6 | Exec=st 7 | Categories=System;TerminalEmulator 8 | -------------------------------------------------------------------------------- /config/fish/functions/_nvm_version_activate.fish: -------------------------------------------------------------------------------- 1 | function _nvm_version_activate --argument-names v 2 | set --global --export nvm_current_version $v 3 | set --prepend PATH $nvm_data/$v/bin 4 | end 5 | -------------------------------------------------------------------------------- /config/eww/src/yuck/widgets/_definitions.yuck: -------------------------------------------------------------------------------- 1 | (defwindow layout 2 | :geometry (geometry :x "90%" 3 | :y "2%" 4 | :height "30px" 5 | :width "90px") 6 | (layout)) 7 | -------------------------------------------------------------------------------- /config/eww/src/yuck/widgets/_widgets.yuck: -------------------------------------------------------------------------------- 1 | (defwidget layout [] 2 | (box :class "layout" :orientation "h" 3 | (box :orientation "v" :valign "center" 4 | (label :class "txt" :text layout) 5 | ) 6 | ) 7 | ) 8 | -------------------------------------------------------------------------------- /config/eww/scripts/toggle-vpn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | eww="eww -c $HOME/.config/eww" 4 | 5 | if [[ $($eww windows | grep '*vpn') == "" ]]; then 6 | # closed, opening 7 | $eww open vpn 8 | else 9 | # open, closing 10 | $eww close vpn 11 | fi 12 | -------------------------------------------------------------------------------- /config/eww/scripts/getNetwork: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | symbol() { 4 | [ $(cat /sys/class/net/w*/operstate) = down ] && echo  && exit 5 | echo  6 | } 7 | 8 | name() { 9 | iwgetid -r 10 | } 11 | 12 | [ "$1" = "icon" ] && symbol 13 | [ "$1" = "name" ] && name 14 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_time.scss: -------------------------------------------------------------------------------- 1 | .time { 2 | font-family: "Iosevka Nerd Font"; 3 | font-weight: bold; 4 | font-size: 1.3em; 5 | color: $foreground; 6 | border-radius: 6px; 7 | margin: .1em .2em; 8 | padding: .6em .1em .3em; 9 | } 10 | -------------------------------------------------------------------------------- /config/eww/src/yuck/lock/_definitions.yuck: -------------------------------------------------------------------------------- 1 | (defwindow lock-screen 2 | :geometry (geometry :x "0" 3 | :y "0" 4 | :width "260px" 5 | :height "220px" 6 | :anchor "center") 7 | (lock-screen)) -------------------------------------------------------------------------------- /config/fish/functions/_nvm_version_deactivate.fish: -------------------------------------------------------------------------------- 1 | function _nvm_version_deactivate --argument-names v 2 | test "$nvm_current_version" = "$v" && set --erase nvm_current_version 3 | set --local index (contains --index -- $nvm_data/$v/bin $PATH) && 4 | set --erase PATH[$index] 5 | end 6 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_launcher.scss: -------------------------------------------------------------------------------- 1 | .launcher { 2 | font-family: "Iosevka Nerd Font"; 3 | margin: 1.25em 1.2em 0.75em; 4 | 5 | button { 6 | // color: #1793d0; 7 | font-size: 1.6em; 8 | 9 | &:hover { 10 | color: $blue; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /config/dwm/src/util.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | #define MAX(A, B) ((A) > (B) ? (A) : (B)) 4 | #define MIN(A, B) ((A) < (B) ? (A) : (B)) 5 | #define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) 6 | 7 | void die(const char *fmt, ...); 8 | void *ecalloc(size_t nmemb, size_t size); 9 | -------------------------------------------------------------------------------- /config/rofi/colors/colors.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #101419; 3 | background-alt: #15191e; 4 | border: #1a1e23; 5 | foreground: #d2daf4; 6 | accent: #78DBA9; 7 | 8 | text-color: @fg; 9 | javacafe-blue: #74bee9; 10 | } 11 | -------------------------------------------------------------------------------- /config/dwm/scripts/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $(dirname $0) 4 | 5 | export PATH="$PWD:$PATH" 6 | 7 | launch () { 8 | ${@} & 9 | } 10 | 11 | feh --bg-scale $PWD/../wallpapers/sea.jpg 12 | pkill picom; picom -b 13 | pkill widgets; launch widgets 14 | 15 | cd $HOME 16 | 17 | if ! eww ping 2>&1 > /dev/null; then 18 | eww daemon & 19 | fi 20 | 21 | exec dwm 22 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/index.scss: -------------------------------------------------------------------------------- 1 | * { 2 | all: unset; 3 | } 4 | 5 | window { 6 | color: $fg; 7 | font-family: "Iosevka Nerd Font"; 8 | } 9 | 10 | button:hover { 11 | color: $accent; 12 | } 13 | 14 | .eww-bar { 15 | background-color: $bg; 16 | border-radius: 8px; 17 | } 18 | 19 | .separator { 20 | background-color: $bg; 21 | color: $black; 22 | } 23 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_browser.scss: -------------------------------------------------------------------------------- 1 | .browser { 2 | font-family: "Iosevka Nerd Font"; 3 | margin-top: 0.65rem; 4 | margin-right: 1.2em; 5 | margin-bottom: 0.45em; 6 | margin-left: 1.3em; 7 | 8 | button { 9 | font-size: 1em; 10 | color: $yellow; 11 | 12 | &:hover { 13 | color: $blue; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /config/st/normalMode.h: -------------------------------------------------------------------------------- 1 | void normalMode(); 2 | void historyPreDraw(); 3 | void historyOverlay(int x, int y, Glyph* g); 4 | void historyModeToggle(int start); 5 | void historyOpToggle(int, int); 6 | typedef enum {failed=0, success=1, exitMotion=2, exitOp=3, finish=4} ExitState; 7 | ExitState kPressHist(char const *txt, size_t len, int ctrl, KeySym const *kSym); 8 | ExitState pressKeys(char const* s, size_t e); 9 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_chat.scss: -------------------------------------------------------------------------------- 1 | .chat { 2 | font-family: "Iosevka Nerd Font"; 3 | font-size: 16px; 4 | margin-top: 0.65rem; 5 | margin-right: 1.2em; 6 | margin-bottom: 0.20em; 7 | margin-left: 1.2em; 8 | 9 | button { 10 | font-size: 1em; 11 | color: $cyan; 12 | 13 | &:hover { 14 | color: $blue; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_rofi.scss: -------------------------------------------------------------------------------- 1 | .rofi { 2 | font-family: "Iosevka Nerd Font"; 3 | font-size: 18px; 4 | margin-top: 0.65em; 5 | margin-right: 1.2em; 6 | margin-bottom: 0.75em; 7 | margin-left: 1.1em; 8 | 9 | button { 10 | font-size: 1em; 11 | color: $green; 12 | 13 | &:hover { 14 | color: $blue; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_terminal.scss: -------------------------------------------------------------------------------- 1 | .terminal { 2 | font-family: "Iosevka Nerd Font"; 3 | font-size: 16px; 4 | margin-top: 0.65rem; 5 | margin-right: 1.2em; 6 | margin-bottom: 0.20em; 7 | margin-left: 1.3em; 8 | 9 | button { 10 | font-size: 1em; 11 | color: $red; 12 | 13 | &:hover { 14 | color: $blue; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/eww/eww.yuck: -------------------------------------------------------------------------------- 1 | ;; NOTE: This is only for 1366x768 resolution! Use at your own risk. 2 | 3 | (include "./src/yuck/_variables.yuck") 4 | 5 | (include "./src/yuck/bar/_definitions.yuck") 6 | (include "./src/yuck/bar/_widgets.yuck") 7 | (include "./src/yuck/lock/_definitions.yuck") 8 | (include "./src/yuck/lock/_widgets.yuck") 9 | (include "./src/yuck/widgets/_definitions.yuck") 10 | (include "./src/yuck/widgets/_widgets.yuck") 11 | -------------------------------------------------------------------------------- /config/fish/functions/_nvm_list.fish: -------------------------------------------------------------------------------- 1 | function _nvm_list 2 | set --local versions $nvm_data/* 3 | set --query versions[1] && 4 | string match --entire --regex -- (string match --regex -- "v\d.+" $versions | 5 | string escape --style=regex | 6 | string join "|" 7 | ) <$nvm_data/.index 8 | 9 | command --all node | 10 | string match --quiet --invert --regex -- "^$nvm_data" && echo system 11 | end 12 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_vpn.scss: -------------------------------------------------------------------------------- 1 | .vpn { 2 | .disconnected { 3 | color: $magenta; 4 | } 5 | 6 | .connected { 7 | color: $green; 8 | } 9 | } 10 | 11 | .vpn-popup { 12 | background: $bg; 13 | font-size: 20px; 14 | .title { 15 | color: $accent; 16 | font-size: 16px; 17 | } 18 | .vpn-txt { 19 | color: $green; 20 | font-weight: bold; 21 | &-disconnected { 22 | color: $magenta; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_workspaces.scss: -------------------------------------------------------------------------------- 1 | .ws { 2 | font-size: 0.95em; 3 | font-weight: normal; 4 | margin: 0em 1em 12px; 5 | 6 | .0 , .01, .02, .03, .04, .05, .06, 7 | .011, .022, .033, .044, .055, .066 { 8 | margin: .75em 0px 0px 0px; 9 | } 10 | 11 | .0, .01, .02, .03, .04, .05, .06 { 12 | color: $black; 13 | } 14 | 15 | .011, .022, .033, .044, .055, .066 { 16 | color: $accent; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /config/eww/src/yuck/lock/_widgets.yuck: -------------------------------------------------------------------------------- 1 | (defwidget lock-screen [] 2 | (box :class "lock-screen" :orientation "h" :space-evenly "true" 3 | (box :class "lock-inner" :orientation "v" :space-evenly "true" 4 | (box :class "lock-pfp") 5 | (box :class "lock-text" :orientation "v" 6 | (box :class "lock-username" "${username}") 7 | (box :class "lock-hostname" "@${hostname}") 8 | ) 9 | ) 10 | ) 11 | ) -------------------------------------------------------------------------------- /config/fish/functions/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_prompt 2 | if test -n "$SSH_TTY" 3 | echo -n (set_color brred)"$USER"(set_color white)'@'(set_color yellow)(prompt_hostname)' ' 4 | end 5 | 6 | echo -n ' '(set_color white)(prompt_pwd)' '(set_color black)''(set_color white)' ' 7 | 8 | set_color -o 9 | if fish_is_root_user 10 | echo -n (set_color red)'# ' 11 | end 12 | # echo -n (set_color red)'❯'(set_color yellow)'❯'(set_color green)'❯ ' 13 | set_color normal 14 | end 15 | -------------------------------------------------------------------------------- /config/eww/scripts/openCalendar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Opens eww calendar 3 | 4 | LOCK_FILE="$HOME/.cache/eww-calendar.lock" 5 | EWW_BIN="/usr/bin/eww" 6 | 7 | run() { 8 | ${EWW_BIN} open calendar 9 | } 10 | 11 | # Run eww daemon if not running 12 | if [[ ! `pidof eww` ]]; then 13 | ${EWW_BIN} daemon 14 | sleep 1 15 | fi 16 | 17 | # Open widgets 18 | if [[ ! -f "$LOCK_FILE" ]]; then 19 | touch "$LOCK_FILE" 20 | run 21 | else 22 | ${EWW_BIN} close calendar 23 | rm "$LOCK_FILE" 24 | fi 25 | -------------------------------------------------------------------------------- /config/fish/functions/fish_mode_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_mode_prompt 2 | switch $fish_bind_mode 3 | case default 4 | set_color --bold magenta 5 | echo "󰊠 " 6 | case insert 7 | set_color --bold green 8 | echo "󰊠 " 9 | case replace_one 10 | set_color --bold red 11 | echo "󰊠 " 12 | case visual 13 | set_color --bold cyan 14 | echo "󰊠 " 15 | case '*' 16 | set_color --bold magenta 17 | echo "󰊠 " 18 | end 19 | set_color green 20 | end 21 | -------------------------------------------------------------------------------- /config/eww/scripts/openSysTray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Opens eww system tray 3 | 4 | LOCK_FILE="$HOME/.cache/eww-sys.lock" 5 | EWW_BIN="/usr/bin/eww" 6 | 7 | run() { 8 | ${EWW_BIN} open-many system-tray 9 | } 10 | 11 | # Run eww daemon if not running 12 | if [[ ! `pidof eww` ]]; then 13 | ${EWW_BIN} daemon 14 | sleep 1 15 | fi 16 | 17 | # Open widgets 18 | if [[ ! -f "$LOCK_FILE" ]]; then 19 | touch "$LOCK_FILE" 20 | run 21 | else 22 | ${EWW_BIN} close system-tray 23 | rm "$LOCK_FILE" 24 | fi 25 | -------------------------------------------------------------------------------- /bin/nv: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | original_content=$(cat $HOME/.Xresources) 4 | 5 | rm $HOME/.Xresources 6 | echo "$original_content" | sed 's/st\.borderpx: .*$/st\.borderpx: 0/g' > $HOME/.Xresources 7 | xrdb merge $HOME/.Xresources 8 | kill -USR1 $(xprop -id $(xdotool getwindowfocus) | grep '_NET_WM_PID' | grep -oE '[[:digit:]]*$') 9 | echo "$original_content" > $HOME/.Xresources 10 | xrdb merge $HOME/.Xresources 11 | nvim ${@} 12 | kill -USR1 $(xprop -id $(xdotool getwindowfocus) | grep '_NET_WM_PID' | grep -oE '[[:digit:]]*$') 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /config/st/st-urlhandler: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | urlregex="(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./@$&%?$\#=_~-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)" 4 | 5 | # First remove linebreaks and mutt sidebars: 6 | urls="$(sed 's/.*│//g' | tr -d '\n' | 7 | grep -aEo "$urlregex" | # grep only urls as defined above. 8 | uniq | # Ignore neighboring duplicates. 9 | sed 's/^www./http:\/\/www\./g')" 10 | 11 | [ -z "$urls" ] && exit 12 | 13 | chosen="$(echo "$urls" | dmenu -i -p 'Follow which url?' -l 10)" 14 | 15 | setsid xdg-open "$chosen" >/dev/null 2>&1 & 16 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_powermenu.scss: -------------------------------------------------------------------------------- 1 | .powermenu { 2 | font-family: "Iosevka Nerd Font"; 3 | font-size: 1.5em; 4 | font-weight: bold; 5 | 6 | button { 7 | margin: .35em .35em .75em .35em; 8 | } 9 | 10 | .reboot-btn { 11 | color: $cyan; 12 | } 13 | .logout-btn { 14 | color: $green; 15 | } 16 | .lock-btn { 17 | color: $magenta 18 | } 19 | .shutdown-btn { 20 | color: $red; 21 | } 22 | .power-btn { 23 | color: $fg; 24 | font-weight: normal; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /config/eww/scripts/getSongTitle: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | title=$(playerctl -p spotify metadata --format '{{ title }}') 3 | count=$(echo -n "$title" | wc -c) 4 | 5 | if [ -z "$title" ]; then 6 | echo "Not Playing"; 7 | else 8 | if [ "$count" -le 24 ]; then 9 | echo $title 10 | else 11 | if [[ "$title" =~ ^[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+ ]]; then 12 | echo $(playerctl metadata --format '{{ title }}' | awk '{ print substr($1, 1, 15) }')... 13 | else 14 | echo $(playerctl metadata --format '{{ title }}' | awk '{print $1, $2, $3, substr($4, 1, 5)}')... 15 | fi 16 | fi 17 | fi 18 | -------------------------------------------------------------------------------- /config/fish/functions/_nvm_index_update.fish: -------------------------------------------------------------------------------- 1 | function _nvm_index_update --argument-names mirror index 2 | if not command curl --location --silent $mirror/index.tab >$index.temp 3 | command rm -f $index.temp 4 | echo "nvm: Can't update index, host unavailable: \"$mirror\"" >&2 5 | return 1 6 | end 7 | 8 | command awk -v OFS=\t ' 9 | /v0.9.12/ { exit } # Unsupported 10 | NR > 1 { 11 | print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "") 12 | } 13 | ' $index.temp >$index 14 | 15 | command rm -f $index.temp 16 | end 17 | -------------------------------------------------------------------------------- /config/eww/src/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $bg: #101419; 2 | $contrastbg: #15191e; 3 | $bgSecondary: #1a1e23; 4 | $bgSecondaryAlt: #b6beca; 5 | $fg: #b6beca; 6 | $fgDim: #b6beca; 7 | $watermelon: #e05f65; 8 | 9 | // Aliases 10 | $background: $bg; 11 | $backgroundSecondary: $bgSecondary; 12 | $backgroundSecondaryAlt: $bgSecondaryAlt; 13 | $foreground: $fg; 14 | $foregroundDim: $fgDim; 15 | 16 | $black: #242931; 17 | $red: #e05f65; 18 | $blue: #70a5eb; 19 | $cyan: #74bee9; 20 | $blue-desaturated: #74bee9; 21 | $magenta: #c68aee; 22 | $green: #78DBA9; 23 | $yellow: #f1cf8a; 24 | $accent: #78DBA9; 25 | $javacafeMagenta: #c68aee; 26 | $javacafeBlue: #70a5eb; 27 | -------------------------------------------------------------------------------- /config/dwm/src/util.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "util.h" 8 | 9 | void * 10 | ecalloc(size_t nmemb, size_t size) 11 | { 12 | void *p; 13 | 14 | if (!(p = calloc(nmemb, size))) 15 | die("calloc:"); 16 | return p; 17 | } 18 | 19 | void 20 | die(const char *fmt, ...) { 21 | va_list ap; 22 | 23 | va_start(ap, fmt); 24 | vfprintf(stderr, fmt, ap); 25 | va_end(ap); 26 | 27 | if (fmt[0] && fmt[strlen(fmt)-1] == ':') { 28 | fputc(' ', stderr); 29 | perror(NULL); 30 | } else { 31 | fputc('\n', stderr); 32 | } 33 | 34 | exit(1); 35 | } 36 | -------------------------------------------------------------------------------- /config/eww/eww.scss: -------------------------------------------------------------------------------- 1 | @import "src/scss/variables"; 2 | @import "src/scss/overrides"; 3 | 4 | @import "src/scss/bar/index.scss"; 5 | @import "src/scss/bar/widgets/calendar"; 6 | @import "src/scss/bar/widgets/launcher"; 7 | @import "src/scss/bar/widgets/browser"; 8 | @import "src/scss/bar/widgets/terminal"; 9 | @import "src/scss/bar/widgets/chat"; 10 | @import "src/scss/bar/widgets/rofi"; 11 | @import "src/scss/bar/widgets/powermenu"; 12 | @import "src/scss/bar/widgets/systray"; 13 | @import "src/scss/bar/widgets/time"; 14 | @import "src/scss/bar/widgets/workspaces"; 15 | @import "src/scss/bar/widgets/vpn"; 16 | 17 | @import "src/scss/lock/index.scss"; 18 | 19 | @import "src/scss/widgets/layouts"; 20 | 21 | @import "src/scss/config"; 22 | -------------------------------------------------------------------------------- /config/st/st-copyout: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Using external pipe with st, give a dmenu prompt of recent commands, 3 | # allowing the user to copy the output of one. 4 | # xclip required for this script. 5 | # By Jaywalker and Luke 6 | tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX) 7 | trap 'rm "$tmpfile"' 0 1 15 8 | sed -n "w $tmpfile" 9 | sed -i 's/\x0//g' "$tmpfile" 10 | ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)" 11 | chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" 12 | eps1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')" 13 | awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | xclip -selection clipboard 14 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_calendar.scss: -------------------------------------------------------------------------------- 1 | .cal-box { 2 | font-family: Iosevka Nerd Font; 3 | background-color: $bg; 4 | border-radius: 8px; 5 | padding: 1rem 1rem .2rem; 6 | 7 | .cal { 8 | &.highlight { 9 | padding: 10rem; 10 | } 11 | 12 | padding: .8rem .25rem 0rem; 13 | margin-left: 10px; 14 | } 15 | } 16 | 17 | calendar:selected { 18 | color: $accent; 19 | } 20 | 21 | calendar.header { 22 | color: $cyan; 23 | font-weight: bold; 24 | } 25 | 26 | calendar.button { 27 | color: $cyan; 28 | } 29 | 30 | calendar.highlight { 31 | color: $green; 32 | font-weight: bold; 33 | } 34 | 35 | calendar:indeterminate { 36 | color: rgba(205, 219, 249, 0.3); 37 | } 38 | -------------------------------------------------------------------------------- /config/tym/theme.lua: -------------------------------------------------------------------------------- 1 | local bg = '#181f21' 2 | local fg = '#dadada' 3 | return { 4 | color_background = bg, 5 | color_foreground = fg, 6 | color_window_background = bg, 7 | color_bold = fg, 8 | color_cursor = '#3b4244', 9 | color_highlight = fg, 10 | color_highlight_foreground = bg, 11 | color_0 = '#22292b', 12 | color_1 = '#e06e6e', 13 | color_2 = '#8ccf7e', 14 | color_3 = '#e5c76b', 15 | color_4 = '#67b0e8', 16 | color_5 = '#c47fd5', 17 | color_6 = '#6da4cd', 18 | color_7 = '#b3b9b8', 19 | color_8 = '#3b4244', 20 | color_9 = '#ef7d7d', 21 | color_10 = '#9bdead', 22 | color_11 = '#f4d67a', 23 | color_12 = '#6cb5ed', 24 | color_13 = '#ce89df', 25 | color_14 = '#67cbe7', 26 | color_15 = '#bdc3c2', 27 | } 28 | -------------------------------------------------------------------------------- /config/eww/src/scss/lock/index.scss: -------------------------------------------------------------------------------- 1 | .lock-screen { 2 | background-color: $bg; 3 | border-radius: 12px; 4 | // border: $bgSecondaryAlt solid 3px; 5 | 6 | .lock-pfp { 7 | background-image: url("./assets/avatar.jpg"); 8 | background-size: 100%; 9 | border-radius: 50%; 10 | 11 | margin: 3.3rem 6.8rem 0rem; 12 | } 13 | 14 | .lock-text { 15 | margin: 0rem 1rem; 16 | padding: 1rem; 17 | 18 | .lock-username { 19 | color: $accent; 20 | font-size: 20px; 21 | } 22 | 23 | .lock-hostname { 24 | color: $magenta; 25 | font-size: 16px; 26 | font-style: italic; 27 | font-family: "Iosevka Nerd Font"; 28 | margin-bottom: 1.2rem; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /launchers/xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | userresources=$HOME/.Xresources 4 | usermodmap=$HOME/.Xmodmap 5 | sysresources=/etc/X11/xinit/.Xresources 6 | sysmodmap=/etc/X11/xinit/.Xmodmap 7 | 8 | # merge in defaults and keymaps 9 | 10 | if [ -f $sysresources ]; then 11 | xrdb -merge $sysresources 12 | fi 13 | 14 | if [ -f $sysmodmap ]; then 15 | xmodmap $sysmodmap 16 | fi 17 | 18 | if [ -f "$userresources" ]; then 19 | xrdb -merge "$userresources" 20 | fi 21 | 22 | if [ -f "$usermodmap" ]; then 23 | xmodmap "$usermodmap" 24 | fi 25 | 26 | # start some nice programs 27 | 28 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 29 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 30 | [ -x "$f" ] && . "$f" 31 | done 32 | unset f 33 | fi 34 | 35 | test -f $HOME/.xprofile && bash $HOME/.xprofile 36 | bash $HOME/.config/dwm/scripts/start 37 | -------------------------------------------------------------------------------- /config/eww/scripts/getSongArt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tmp_dir="$HOME/.cache/eww/spotify" 3 | tmp_cover_path=$tmp_dir/cover.png 4 | tmp_temp_path=$tmp_dir/temp.png 5 | 6 | if [ ! -d $tmp_dir ]; then 7 | mkdir -p $tmp_dir 8 | fi 9 | 10 | artlink="$(playerctl -p spotify metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')" 11 | 12 | if [ $(playerctl -p spotify metadata mpris:artUrl) ]; then 13 | curl -s "$artlink" --output $tmp_temp_path 14 | else 15 | cp $HOME/.config/eww/assets/fallback.png $tmp_temp_path 16 | fi 17 | 18 | # an epic effekt 19 | # convert $tmp_temp_path -alpha set -channel A -evaluate multiply 0.3 $tmp_cover_path 20 | convert $tmp_temp_path -gravity center +repage -alpha set -channel A \ 21 | -sparse-color Barycentric '%[fx:w*2/32],0 opaque %[fx:w+0.5],0 transparent' \ 22 | -evaluate multiply 0.5 \ 23 | $tmp_cover_path -------------------------------------------------------------------------------- /config/eww/scripts/getWeather: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | KEY="4621ebb64emsha0443925458b9e6p1bf846jsn35d5842299ce" 4 | CITY="Iloilo" 5 | 6 | weather=$(curl -sf "api.openweathermap.org/data/2.5/weather?q=$CITY&appid=$KEY&units=metric") 7 | weather_desc=$(echo $weather | jq -r ".weather[0].main") 8 | weather_temp=$(echo $weather | jq ".main.temp" | cut -d "." -f 1) 9 | feels_like=$(echo $weather | jq ".main.feels_like" | cut -d "." -f 1) 10 | humidity=$(echo $weather | jq ".main.humidity") 11 | wind=$(echo $weather | jq ".wind.speed") 12 | 13 | case $1 in 14 | current_temp) 15 | echo $weather_temp 16 | ;; 17 | feels_like) 18 | echo $feels_like 19 | ;; 20 | weather_desc) 21 | echo $weather_desc 22 | ;; 23 | humidity) 24 | echo $humidity 25 | ;; 26 | wind) 27 | echo $wind 28 | ;; 29 | esac 30 | -------------------------------------------------------------------------------- /config/fish/completions/fisher.fish: -------------------------------------------------------------------------------- 1 | complete --command fisher --exclusive --long help --description "Print help" 2 | complete --command fisher --exclusive --long version --description "Print version" 3 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" 4 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" 5 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" 6 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" 7 | complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" 8 | -------------------------------------------------------------------------------- /config/eww/scripts/getPlayerStatus: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function that shows the current artist, track, duration, and status from Spotify using playerctl 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Dependencies: spotify, playerctl 8 | 9 | # NOTE: The official spotify client does not provide the track position or shuffle status through playerctl. This does work through spotifyd however. 10 | 11 | if ps -C spotify > /dev/null; then 12 | PLAYER="spotify" 13 | fi 14 | 15 | if [ -z "$PLAYER" ]; then 16 | printf "" 17 | fi 18 | 19 | if [ "$PLAYER" = "spotify" ]; then 20 | STATUS=$(playerctl -p spotify status) 21 | 22 | if [ "$STATUS" = "Playing" ]; then 23 | STATUS="" 24 | else 25 | STATUS="" 26 | fi 27 | 28 | if [ "$PLAYER" = "spotify" ]; then 29 | printf "$STATUS" 30 | fi 31 | fi -------------------------------------------------------------------------------- /bin/bunnyfetch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Tiny colored fetch script 3 | # Requires Typicons Font to display the icons 4 | # elenapan @ github 5 | 6 | f=3 b=4 7 | for j in f b; do 8 | for i in {0..7}; do 9 | printf -v $j$i %b "\e[${!j}${i}m" 10 | done 11 | done 12 | d=$'\e[1m' 13 | t=$'\e[0m' 14 | v=$'\e[7m' 15 | 16 | # Items 17 | h=wm 18 | wmname="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")" 19 | 20 | k=kr 21 | kernel="$(uname -r | cut -d '-' -f1)" 22 | 23 | sh=sh 24 | shell=$(basename $SHELL) 25 | 26 | o=os 27 | os="$(uname -s)" 28 | 29 | # (\ /) 30 | # ( · ·) 31 | # c(")(") 32 | 33 | # (\ /) 34 | # ( . .) 35 | # c(")(") 36 | 37 | tput clear 38 | cat << EOF 39 | 40 | (\ /) $f6$k $t~ $kernel 41 | ( $d· ·$t) $f6$h $t~ $wmname 42 | c($f1"$t)($f1"$t) $f6$sh $t~ $shell 43 | 44 | EOF 45 | -------------------------------------------------------------------------------- /config/eww/scripts/getSongArtist: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | artist=$(playerctl -p spotify metadata --format '{{ artist }}') 3 | title=$(playerctl -p spotify metadata --format '{{ title }}') 4 | count=$(echo -n "$artist" | wc -c) 5 | 6 | # Check if $title is "Advertisement" 7 | if [ "$title" = "Advertisement" ]; then 8 | echo "Spotify" 9 | else 10 | if [ -z "$artist" ]; then 11 | echo "Unknown Artist"; 12 | else 13 | echo $artist 14 | # if [ "$count" -le 18 ]; then 15 | # echo $artist 16 | # else 17 | # if [[ "$artist" =~ ^[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+ ]]; then 18 | # echo $(playerctl metadata --format '{{ artist }}' | awk '{ print substr($1, 1, 15) }')... 19 | # elif [[ "$artist" -le 15 ]]; then 20 | # echo $(playerctl metadata --format '{{ artist }}' | awk '{print $1, $2}') 21 | # else 22 | # echo $(playerctl metadata --format '{{ artist }}' | awk '{print $1, $2, substr($3, 1, 4)}')... 23 | # fi 24 | # fi 25 | fi 26 | fi 27 | -------------------------------------------------------------------------------- /config/eww/scripts/getVpn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | get_ip () { 4 | ifconfig tun0 2>/dev/null | \ 5 | grep inet | \ 6 | head -n 1 | \ 7 | awk '{print $2}' 8 | } 9 | 10 | ip=$(get_ip) 11 | 12 | if [[ $1 == "get" ]]; then 13 | if [[ $ip == "" ]]; then 14 | echo "Disconnected" 15 | else 16 | echo $ip 17 | fi 18 | exit 0 19 | fi 20 | 21 | if [[ $1 == "get-class" ]]; then 22 | if [[ $ip == "" ]]; then 23 | echo "vpn-txt-disconnected" 24 | else 25 | echo "vpn-txt" 26 | fi 27 | exit 0 28 | fi 29 | 30 | if [[ $ip == "" ]]; then 31 | echo "(box :class \"vpn\" :halign \"center\" :valign \"start\" :space-evenly \"false\" :spacing \"-5\" (button :onclick \"scripts/toggle-vpn.sh\" :class \"disconnected\" \" \"))" 32 | else 33 | echo "(box :class \"vpn\" :halign \"center\" :valign \"start\" :space-evenly \"false\" :spacing \"-5\" (button :onclick \"scripts/toggle-vpn.sh\" :class \"connected\" \" \"))" 34 | fi 35 | -------------------------------------------------------------------------------- /config/st/xresources: -------------------------------------------------------------------------------- 1 | Xft.antialias: 1 2 | Xft.hinting: 1 3 | Xft.autohint: 0 4 | Xft.hintstyle: hintslight 5 | Xft.rgba: rgb 6 | Xft.lcdfilter: lcddefault 7 | 8 | st.font: JetBrainsMono Nerd Font:style:medium:pixelsize=13 9 | 10 | ! window padding 11 | st.borderpx: 20 12 | 13 | !- 0.1 to 0.9 = transparency 14 | st.alpha: 1.0 15 | 16 | *background: #181f21 17 | *foreground: #dadada 18 | 19 | ! Black + DarkGrey 20 | *color0: #22292b 21 | *color8: #575e60 22 | 23 | ! DarkRed + Red 24 | *color1: #e06e6e 25 | *color9: #ef7d7d 26 | 27 | ! DarkGreen + Green 28 | *color2: #8ccf7e 29 | *color10: #9bdead 30 | 31 | ! DarkYellow + Yellow 32 | *color3: #e5c76b 33 | *color11: #f4d67a 34 | 35 | ! DarkBlue + Blue 36 | *color4: #67b0e8 37 | *color12: #6cb5ed 38 | 39 | ! DarkMagenta + Magenta 40 | *color5: #c47fd5 41 | *color13: #ce89df 42 | 43 | ! DarkCyan + Cyan 44 | *color6: #6da4cd 45 | *color14: #67cbe7 46 | 47 | ! LightGrey + White 48 | *color7: #b3b9b8 49 | *color15: #bdc3c2 50 | -------------------------------------------------------------------------------- /bin/xcolor-pick: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ██╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ ██████╗ 4 | # ╚██╗██╔╝██╔════╝██╔═══██╗██║ ██╔═══██╗██╔══██╗ 5 | # ╚███╔╝ ██║ ██║ ██║██║ ██║ ██║██████╔╝ 6 | # ██╔██╗ ██║ ██║ ██║██║ ██║ ██║██╔══██╗ 7 | # ██╔╝ ██╗╚██████╗╚██████╔╝███████╗╚██████╔╝██║ ██║ 8 | # ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ 9 | # color picker for X. 10 | # Simple Script To Pick Color Quickly Using Gpick. 11 | # Created By: https://github.com/rxyhn 12 | 13 | TEMP_DIR=/tmp/xcolor 14 | MSG=${XDG_CACHE_HOME:-$HOME/.cache}/xcolor.msg 15 | 16 | EXPIRE_TIME=5000 17 | 18 | main() { 19 | 20 | HEX_COLOR=$(gpick -pso --no-newline) 21 | mkdir -p $TEMP_DIR 22 | HEX="${HEX_COLOR#\#}" 23 | FNAME="$TEMP_DIR/$HEX.png" 24 | convert -size 100x100 xc:"$HEX_COLOR" "$FNAME" 25 | COLOR_CODE="$HEX_COLOR" 26 | 27 | printf %s "$COLOR_CODE" | xclip -sel c 28 | notify-send -a XColor --icon="$FNAME" xcolor-pick "$COLOR_CODE" --expire-time="$EXPIRE_TIME" 29 | } 30 | 31 | main 32 | -------------------------------------------------------------------------------- /config/dwm/src/transient.c: -------------------------------------------------------------------------------- 1 | /* cc transient.c -o transient -lX11 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(void) { 9 | Display *d; 10 | Window r, f, t = None; 11 | XSizeHints h; 12 | XEvent e; 13 | 14 | d = XOpenDisplay(NULL); 15 | if (!d) 16 | exit(1); 17 | r = DefaultRootWindow(d); 18 | 19 | f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); 20 | h.min_width = h.max_width = h.min_height = h.max_height = 400; 21 | h.flags = PMinSize | PMaxSize; 22 | XSetWMNormalHints(d, f, &h); 23 | XStoreName(d, f, "floating"); 24 | XMapWindow(d, f); 25 | 26 | XSelectInput(d, f, ExposureMask); 27 | while (1) { 28 | XNextEvent(d, &e); 29 | 30 | if (t == None) { 31 | sleep(5); 32 | t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); 33 | XSetTransientForHint(d, t, f); 34 | XStoreName(d, t, "transient"); 35 | XMapWindow(d, t); 36 | XSelectInput(d, t, ExposureMask); 37 | } 38 | } 39 | 40 | XCloseDisplay(d); 41 | exit(0); 42 | } 43 | -------------------------------------------------------------------------------- /config/dwm/src/config.mk.orig: -------------------------------------------------------------------------------- 1 | # dwm version 2 | VERSION = 6.3 3 | 4 | # Customize below to fit your system 5 | 6 | # paths 7 | PREFIX = /usr/local 8 | MANPREFIX = ${PREFIX}/share/man 9 | 10 | X11INC = /usr/X11R6/include 11 | X11LIB = /usr/X11R6/lib 12 | 13 | # Xinerama, comment if you don't want it 14 | XINERAMALIBS = -lXinerama 15 | XINERAMAFLAGS = -DXINERAMA 16 | 17 | # freetype 18 | FREETYPELIBS = -lfontconfig -lXft 19 | FREETYPEINC = /usr/include/freetype2 20 | # OpenBSD (uncomment) 21 | #FREETYPEINC = ${X11INC}/freetype2 22 | 23 | # includes and libs 24 | INCS = -I${X11INC} -I${FREETYPEINC} 25 | LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} 26 | 27 | # flags 28 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 29 | #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} 30 | CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} 31 | LDFLAGS = ${LIBS} 32 | 33 | # Solaris 34 | #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" 35 | #LDFLAGS = ${LIBS} 36 | 37 | # compiler and linker 38 | CC = cc 39 | -------------------------------------------------------------------------------- /config/st/config.mk: -------------------------------------------------------------------------------- 1 | # st version 2 | VERSION = 0.8.4 3 | 4 | # Customize below to fit your system 5 | 6 | # paths 7 | PREFIX = /usr/local 8 | MANPREFIX = $(PREFIX)/share/man 9 | 10 | X11INC = /usr/X11R6/include 11 | X11LIB = /usr/X11R6/lib 12 | 13 | PKG_CONFIG = pkg-config 14 | 15 | # includes and libs 16 | INCS = -I$(X11INC) \ 17 | `$(PKG_CONFIG) --cflags fontconfig` \ 18 | `$(PKG_CONFIG) --cflags freetype2` \ 19 | `$(PKG_CONFIG) --cflags harfbuzz` 20 | LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ 21 | `$(PKG_CONFIG) --libs fontconfig` \ 22 | `$(PKG_CONFIG) --libs freetype2` \ 23 | `$(PKG_CONFIG) --libs harfbuzz` 24 | 25 | # flags 26 | STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 27 | STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) 28 | STLDFLAGS = $(LIBS) $(LDFLAGS) 29 | 30 | # OpenBSD: 31 | #CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE 32 | #LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \ 33 | # `$(PKG_CONFIG) --libs fontconfig` \ 34 | # `$(PKG_CONFIG) --libs freetype2` 35 | 36 | # compiler and linker 37 | # CC = c99 38 | -------------------------------------------------------------------------------- /config/starship.toml: -------------------------------------------------------------------------------- 1 | format = """ 2 | [ ](bold green)$directory(bold blue)$git_branch$git_status[❯](bold yellow)[❯](bold purple)[❯](bold blue) """ 3 | 4 | scan_timeout = 60 5 | add_newline = false 6 | 7 | [line_break] 8 | disabled = true 9 | 10 | [directory] 11 | style = "bold blue" 12 | 13 | [cmd_duration] 14 | format = "[$duration]($style) " 15 | 16 | [status] 17 | disabled = false 18 | format = "[$symbol $status]($style) " 19 | not_found_symbol = "" 20 | not_executable_symbol = "" 21 | sigint_symbol = "ﭦ" 22 | map_symbol = true 23 | 24 | [git_branch] 25 | format = "[$symbol$branch]($style) " 26 | 27 | [package] 28 | format = "[$symbol$version]($style) " 29 | symbol = " " 30 | 31 | [python] 32 | format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' 33 | symbol = " " 34 | 35 | [nodejs] 36 | format = "[$symbol($version )]($style)" 37 | 38 | [php] 39 | format = "[$symbol($version )]($style)" 40 | symbol = " " 41 | 42 | [java] 43 | format = "[${symbol}(${version} )]($style)" 44 | symbol = " " 45 | 46 | [rust] 47 | format = "[$symbol($version )]($style)" 48 | 49 | [golang] 50 | format = "[$symbol($version )]($style)" 51 | symbol = " " 52 | -------------------------------------------------------------------------------- /config/dwm/src/config.mk: -------------------------------------------------------------------------------- 1 | # dwm version 2 | VERSION = 6.3 3 | 4 | # Customize below to fit your system 5 | 6 | # paths 7 | PREFIX = /usr/local 8 | MANPREFIX = ${PREFIX}/share/man 9 | 10 | X11INC = /usr/X11R6/include 11 | X11LIB = /usr/X11R6/lib 12 | 13 | # Xinerama, comment if you don't want it 14 | XINERAMALIBS = -lXinerama 15 | XINERAMAFLAGS = -DXINERAMA 16 | 17 | # freetype 18 | FREETYPELIBS = -lfontconfig -lXft 19 | FREETYPEINC = /usr/include/freetype2 20 | # OpenBSD (uncomment) 21 | #FREETYPEINC = ${X11INC}/freetype2 22 | 23 | # Imlib2 (tag previews) 24 | IMLIB2LIBS = -lImlib2 25 | 26 | # includes and libs 27 | INCS = -I${X11INC} -I${FREETYPEINC} 28 | LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${IMLIB2LIBS} 29 | 30 | # flags 31 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 32 | #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} 33 | CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} 34 | LDFLAGS = ${LIBS} 35 | 36 | # Solaris 37 | #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" 38 | #LDFLAGS = ${LIBS} 39 | 40 | # compiler and linker 41 | CC = cc 42 | -------------------------------------------------------------------------------- /config/st/arg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copy me if you can. 3 | * by 20h 4 | */ 5 | 6 | #ifndef ARG_H__ 7 | #define ARG_H__ 8 | 9 | extern char *argv0; 10 | 11 | /* use main(int argc, char *argv[]) */ 12 | #define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ 13 | argv[0] && argv[0][0] == '-'\ 14 | && argv[0][1];\ 15 | argc--, argv++) {\ 16 | char argc_;\ 17 | char **argv_;\ 18 | int brk_;\ 19 | if (argv[0][1] == '-' && argv[0][2] == '\0') {\ 20 | argv++;\ 21 | argc--;\ 22 | break;\ 23 | }\ 24 | int i_;\ 25 | for (i_ = 1, brk_ = 0, argv_ = argv;\ 26 | argv[0][i_] && !brk_;\ 27 | i_++) {\ 28 | if (argv_ != argv)\ 29 | break;\ 30 | argc_ = argv[0][i_];\ 31 | switch (argc_) 32 | 33 | #define ARGEND }\ 34 | } 35 | 36 | #define ARGC() argc_ 37 | 38 | #define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ 39 | ((x), abort(), (char *)0) :\ 40 | (brk_ = 1, (argv[0][i_+1] != '\0')?\ 41 | (&argv[0][i_+1]) :\ 42 | (argc--, argv++, argv[0]))) 43 | 44 | #define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ 45 | (char *)0 :\ 46 | (brk_ = 1, (argv[0][i_+1] != '\0')?\ 47 | (&argv[0][i_+1]) :\ 48 | (argc--, argv++, argv[0]))) 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /config/st/win.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE for license details. */ 2 | 3 | enum win_mode { 4 | MODE_VISIBLE = 1 << 0, 5 | MODE_FOCUSED = 1 << 1, 6 | MODE_APPKEYPAD = 1 << 2, 7 | MODE_MOUSEBTN = 1 << 3, 8 | MODE_MOUSEMOTION = 1 << 4, 9 | MODE_REVERSE = 1 << 5, 10 | MODE_KBDLOCK = 1 << 6, 11 | MODE_HIDE = 1 << 7, 12 | MODE_APPCURSOR = 1 << 8, 13 | MODE_MOUSESGR = 1 << 9, 14 | MODE_8BIT = 1 << 10, 15 | MODE_BLINK = 1 << 11, 16 | MODE_FBLINK = 1 << 12, 17 | MODE_FOCUS = 1 << 13, 18 | MODE_MOUSEX10 = 1 << 14, 19 | MODE_MOUSEMANY = 1 << 15, 20 | MODE_BRCKTPASTE = 1 << 16, 21 | MODE_NUMLOCK = 1 << 17, 22 | MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\ 23 | |MODE_MOUSEMANY, 24 | }; 25 | 26 | void xbell(void); 27 | void xclipcopy(void); 28 | void xdrawcursor(int, int, Glyph, int, int, Glyph, Line, int); 29 | void xdrawline(Line, int, int, int); 30 | void xfinishdraw(void); 31 | void xloadcols(void); 32 | int xsetcolorname(int, const char *); 33 | void xsettitle(char *); 34 | int xsetcursor(int); 35 | void xsetmode(int, unsigned int); 36 | void xsetpointermotion(int); 37 | void xsetsel(char *); 38 | int xstartdraw(void); 39 | void xximspot(int, int); 40 | void xclearwin(void); 41 | -------------------------------------------------------------------------------- /config/eww/src/yuck/bar/_definitions.yuck: -------------------------------------------------------------------------------- 1 | (defwindow bar 2 | :geometry (geometry :x "1%" 3 | :y "12px" 4 | :height "97%" 5 | :width "46px") 6 | :monitor 0 7 | :stacking "bg" 8 | :windowtype "dock" 9 | :wm-ignore false 10 | (bar)) 11 | 12 | (defwindow bar2 13 | :geometry (geometry :x "1%" 14 | :y "12px" 15 | :height "97%" 16 | :width "46px") 17 | :monitor 1 18 | :stacking "bg" 19 | :windowtype "dock" 20 | :wm-ignore false 21 | (bar)) 22 | 23 | (defwindow system-tray 24 | :geometry (geometry :x "9px" 25 | :y "50px" 26 | :width "26%" 27 | :height "45%" 28 | :anchor "top left") 29 | (sys-tray)) 30 | 31 | (defwindow vpn 32 | :geometry (geometry :x "6%" 33 | :y "73%" 34 | :width "210px" 35 | :height "90px") 36 | (vpn-popup)) 37 | 38 | (defwindow calendar 39 | :geometry (geometry :x "57px" 40 | :y "67%" 41 | :width "270px" 42 | :height "60px") 43 | (cal)) 44 | -------------------------------------------------------------------------------- /config/fish/conf.d/nvm.fish: -------------------------------------------------------------------------------- 1 | function _nvm_install --on-event nvm_install 2 | set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share 3 | set --universal nvm_data $XDG_DATA_HOME/nvm 4 | set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist 5 | 6 | test ! -d $nvm_data && command mkdir -p $nvm_data 7 | echo "Downloading the Node distribution index..." 2>/dev/null 8 | _nvm_index_update $nvm_mirror $nvm_data/.index 9 | end 10 | 11 | function _nvm_update --on-event nvm_update 12 | set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share 13 | set --universal nvm_data $XDG_DATA_HOME/nvm 14 | set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist 15 | end 16 | 17 | function _nvm_uninstall --on-event nvm_uninstall 18 | command rm -rf $nvm_data 19 | 20 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 21 | 22 | set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source 23 | functions --erase (functions --all | string match --entire --regex -- "^_nvm_") 24 | end 25 | 26 | if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version 27 | nvm use $nvm_default_version >/dev/null 28 | end 29 | -------------------------------------------------------------------------------- /config/dwm/src/README: -------------------------------------------------------------------------------- 1 | dwm - dynamic window manager 2 | ============================ 3 | dwm is an extremely fast, small, and dynamic window manager for X. 4 | 5 | 6 | Requirements 7 | ------------ 8 | In order to build dwm you need the Xlib header files. 9 | 10 | 11 | Installation 12 | ------------ 13 | Edit config.mk to match your local setup (dwm is installed into 14 | the /usr/local namespace by default). 15 | 16 | Afterwards enter the following command to build and install dwm (if 17 | necessary as root): 18 | 19 | make clean install 20 | 21 | 22 | Running dwm 23 | ----------- 24 | Add the following line to your .xinitrc to start dwm using startx: 25 | 26 | exec dwm 27 | 28 | In order to connect dwm to a specific display, make sure that 29 | the DISPLAY environment variable is set correctly, e.g.: 30 | 31 | DISPLAY=foo.bar:1 exec dwm 32 | 33 | (This will start dwm on display :1 of the host foo.bar.) 34 | 35 | In order to display status info in the bar, you can do something 36 | like this in your .xinitrc: 37 | 38 | while xsetroot -name "`date` `uptime | sed 's/.*,//'`" 39 | do 40 | sleep 1 41 | done & 42 | exec dwm 43 | 44 | 45 | Configuration 46 | ------------- 47 | The configuration of dwm is done by creating a custom config.h 48 | and (re)compiling the source code. 49 | -------------------------------------------------------------------------------- /config/dwm/src/Makefile: -------------------------------------------------------------------------------- 1 | # dwm - dynamic window manager 2 | # See LICENSE file for copyright and license details. 3 | 4 | include config.mk 5 | 6 | SRC = drw.c dwm.c util.c 7 | OBJ = ${SRC:.c=.o} 8 | 9 | all: options dwm 10 | 11 | options: 12 | @echo dwm build options: 13 | @echo "CFLAGS = ${CFLAGS}" 14 | @echo "LDFLAGS = ${LDFLAGS}" 15 | @echo "CC = ${CC}" 16 | 17 | .c.o: 18 | ${CC} -c ${CFLAGS} $< 19 | 20 | ${OBJ}: config.h config.mk 21 | 22 | config.h: 23 | cp config.def.h $@ 24 | 25 | dwm: ${OBJ} 26 | ${CC} -o $@ ${OBJ} ${LDFLAGS} 27 | 28 | clean: 29 | rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz 30 | 31 | dist: clean 32 | mkdir -p dwm-${VERSION} 33 | cp -R LICENSE Makefile README config.def.h config.mk\ 34 | dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} 35 | tar -cf dwm-${VERSION}.tar dwm-${VERSION} 36 | gzip dwm-${VERSION}.tar 37 | rm -rf dwm-${VERSION} 38 | 39 | install: all 40 | mkdir -p ${DESTDIR}${PREFIX}/bin 41 | cp -f dwm ${DESTDIR}${PREFIX}/bin 42 | chmod 755 ${DESTDIR}${PREFIX}/bin/dwm 43 | mkdir -p ${DESTDIR}${MANPREFIX}/man1 44 | sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 45 | chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 46 | 47 | uninstall: 48 | rm -f ${DESTDIR}${PREFIX}/bin/dwm\ 49 | ${DESTDIR}${MANPREFIX}/man1/dwm.1 50 | 51 | .PHONY: all options clean dist install uninstall 52 | -------------------------------------------------------------------------------- /config/st/utils.h: -------------------------------------------------------------------------------- 1 | /// Dynamic memory-chunk, with (1) datatype size, (2/3) initialized / allocated chunk, (4) content 2 | typedef struct { uint8_t const elSize; uint32_t init, alloc; char* content; } DynamicArray; 3 | #define UTF8_ARRAY {4, 0, 0, NULL} 4 | 5 | static inline int p_alloc(DynamicArray *s, uint32_t amount) { 6 | uint32_t const diff=s->init+s->elSize*amount-s->alloc, nas=s->alloc+max(diff,15)*s->elSize; 7 | if (s->alloc < s->init + s->elSize * amount) { 8 | char* tmp = realloc(s->content, nas); 9 | if (!tmp) return 0; 10 | s->alloc = nas, s->content = tmp; 11 | } 12 | return 1; 13 | } 14 | static inline char *view(DynamicArray * s, uint32_t i) { return s->content + i*s->elSize; } 15 | static inline char *end(DynamicArray *s, uint32_t i) { return s->content +s->init-(i+1)*s->elSize; } 16 | static inline uint32_t getU32(DynamicArray* s, uint32_t i, int b) { return *((uint32_t*) (b ?view(s,i) :end(s,i))); } 17 | static char *expand(DynamicArray *s) { if (!p_alloc(s, 1)) return NULL; s->init += s->elSize; return end(s, 0); } 18 | static inline void pop(DynamicArray* s) { s->init -= s->elSize; } 19 | static inline void empty(DynamicArray* s) { s->init = 0; } 20 | static inline int size(DynamicArray const * s) { return s->init / s->elSize; } 21 | static inline void assign(DynamicArray* s, DynamicArray const *o) { 22 | if (p_alloc(s, size(o))) memcpy(s->content, o->content, (s->init=o->init)); 23 | } 24 | -------------------------------------------------------------------------------- /config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | clear-shadow = true; 2 | shadow = true; 3 | 4 | shadow-radius = 10; 5 | shadow-offset-x = -10; 6 | shadow-offset-y = -10; 7 | shadow-opacity = 0.6; 8 | shadow-red = 0.0; 9 | shadow-green = 0.0; 10 | shadow-blue = 0.0; 11 | 12 | shadow-exclude = [ 13 | 14 | "name = 'stalonetray'", 15 | "name = 'polybar'", 16 | "name = 'plank'", 17 | "name = 'Notification'", 18 | "name = 'fluxbox'", 19 | "class_g = 'bspwm'", 20 | "class_i = 'presel_feedback'", 21 | "class_g = 'fluxbox'", 22 | "class_g ?= 'Notify-osd'", 23 | "class_g = 'xfce4-panel'", 24 | "class_i = 'POWERPNT.EXE'", 25 | "class_i = 'WINWORD.EXE'", 26 | "class_i = 'Meteo'" 27 | ]; 28 | 29 | shadow-ignore-shaped = false; 30 | inactive-opacity = 1.0; 31 | active-opacity = 1.0; 32 | frame-opacity = 1.0; 33 | inactive-opacity-override = false; 34 | 35 | wintypes : 36 | { 37 | popup_menu = 38 | { 39 | opacity = 1.0; 40 | }; 41 | dropdown_menu = 42 | { 43 | opacity = 1.0 44 | }; 45 | dnd = 46 | { 47 | shadow = false; 48 | }; 49 | dock = 50 | { 51 | shadow = true; 52 | }; 53 | tooltip = 54 | { 55 | fade = true; 56 | shadow = true; 57 | opacity = 1.0; 58 | focus = true; 59 | }; 60 | }; 61 | 62 | corner-radius = 6; 63 | rounded-corners-exclude = [ 64 | "class_g = 'Polybar'", 65 | ] -------------------------------------------------------------------------------- /home/.Xresources: -------------------------------------------------------------------------------- 1 | Xft.antialias: 1 2 | Xft.hinting: 1 3 | Xft.autohint: 0 4 | Xft.hintstyle: hintslight 5 | Xft.rgba: rgb 6 | Xft.lcdfilter: lcddefault 7 | 8 | ! window padding 9 | st.borderpx: 25 10 | 11 | !-- values between 0.1 - 1.0 --! 12 | 13 | st.alpha: 1.0 14 | st.font: Iosevka Nerd Font:style:medium:pixelsize=16 15 | 16 | !-- decay palette --! 17 | #define decay_darker_bg #0e1217 18 | #define decay_bg #101419 19 | #define decay_contrast_bg #15191e 20 | #define decay_lighter_bg #1a1e23 21 | #define decay_fg #b6beca 22 | #define decay_cursor #b6beca 23 | 24 | #define decay_black #242931 25 | #define decay_light_black #485263 26 | #define decay_red #e05f65 27 | #define decay_green #76b97f 28 | #define decay_yellow #f1cf8a 29 | #define decay_orange #e9a180 30 | #define decay_darker_blue #4e88d4 31 | #define decay_contrast_blue #5f94da 32 | #define decay_blue #70a5eb 33 | #define decay_aquamarine #7ddac5 34 | #define decay_magenta #c68aee 35 | #define decay_cyan #74bee9 36 | #define decay_white #dee1e6 37 | 38 | *.foreground: decay_fg 39 | *.background: decay_bg 40 | *.cursorColor: decay_cursor 41 | *fading: 35 42 | 43 | *.color0: decay_black 44 | *.color1: decay_red 45 | *.color2: decay_green 46 | *.color3: decay_yellow 47 | *.color4: decay_blue 48 | *.color5: decay_magenta 49 | *.color6: decay_cyan 50 | *.color7: decay_white 51 | 52 | *.color8: decay_light_black 53 | *.color9: decay_red 54 | *.color10: decay_green 55 | *.color11: decay_yellow 56 | *.color12: decay_blue 57 | *.color13: decay_magenta 58 | *.color14: decay_cyan 59 | *.color15: decay_white 60 | -------------------------------------------------------------------------------- /config/fish/completions/nvm.fish: -------------------------------------------------------------------------------- 1 | complete --command nvm --exclusive --long version --description "Print version" 2 | complete --command nvm --exclusive --long help --description "Print help" 3 | 4 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version" 5 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell" 6 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions" 7 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex" 8 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version" 9 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "( 10 | test -e $nvm_data && string split ' ' <$nvm_data/.index 11 | )" 12 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')" 13 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version" 14 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "( 15 | _nvm_list | string split ' ' | string replace system '' 16 | )" 17 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "( 18 | set --query nvm_default_version && echo default 19 | )" 20 | -------------------------------------------------------------------------------- /bin/fetch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: https://github.com/AlphaTechnolog 3 | 4 | clear 5 | 6 | user="${USER}" 7 | shell="$(basename ${SHELL})" 8 | distro=$(. /etc/os-release ; echo "$ID") 9 | wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")" 10 | kernel="$(uname -r | cut -d '-' -f1)" 11 | ram="$(free -t | awk 'NR == 2 {printf("%.2f%"), $3/$2*100}')" 12 | 13 | white='\033[37m' 14 | cyan='\033[36m' 15 | blue='\033[34m' 16 | green='\033[32m' 17 | purple='\033[35m' 18 | bold='\033[1m' 19 | end='\033[0m' 20 | 21 | len () { 22 | echo $@ | wc -c 23 | } 24 | 25 | repeat_by_len () { 26 | local str=$1 27 | local char=$2 28 | local len=$(len $str) 29 | local i=1 30 | 31 | while [[ $i -lt $len ]]; do 32 | printf "$char" 33 | i=$(expr $i + 1) 34 | done 35 | } 36 | 37 | printf '%b' " 38 | ${bold}${blue} ██ ${end}${bold}${blue}${user}${cyan}@${purple}$(cat /etc/hostname)${end} 39 | ${bold}${blue} ████ ${end}${green}$(repeat_by_len "${user}@$(cat /etc/hostname)" "─") 40 | ${bold}${blue} ▀████ ${end} 41 | ${bold}${blue} ██▄ ████ ${end}${bold}${purple} ${blue}os ${green}  ${magenta}${cyan}${distro}${end} 42 | ${bold}${blue} ██████████ ${end}${bold}${purple} ${blue}sh ${green}  ${magenta}${cyan}${shell}${end} 43 | ${bold}${blue} ████▀ ▀████ ${end}${bold}${purple} ${blue}wm ${green}  ${magenta}${cyan}${wm}${end} 44 | ${bold}${blue} ████▀ ▀████ ${end}${bold}${purple} ${blue}kr ${green}  ${magenta}${cyan}${kernel}${end} 45 | ${bold}${blue}▀▀▀ ▀▀▀ ${end}${bold}${purple} ${blue}ram ${green} ${magenta}${cyan}${ram}${end} 46 | 47 | " 48 | -------------------------------------------------------------------------------- /config/dwm/src/drw.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | typedef struct { 4 | Cursor cursor; 5 | } Cur; 6 | 7 | typedef struct Fnt { 8 | Display *dpy; 9 | unsigned int h; 10 | XftFont *xfont; 11 | FcPattern *pattern; 12 | struct Fnt *next; 13 | } Fnt; 14 | 15 | enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ 16 | typedef XftColor Clr; 17 | 18 | typedef struct { 19 | unsigned int w, h; 20 | Display *dpy; 21 | int screen; 22 | Window root; 23 | Drawable drawable; 24 | GC gc; 25 | Clr *scheme; 26 | Fnt *fonts; 27 | } Drw; 28 | 29 | /* Drawable abstraction */ 30 | Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); 31 | void drw_resize(Drw *drw, unsigned int w, unsigned int h); 32 | void drw_free(Drw *drw); 33 | 34 | /* Fnt abstraction */ 35 | Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); 36 | void drw_fontset_free(Fnt* set); 37 | unsigned int drw_fontset_getwidth(Drw *drw, const char *text); 38 | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); 39 | 40 | /* Colorscheme abstraction */ 41 | void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); 42 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); 43 | 44 | /* Cursor abstraction */ 45 | Cur *drw_cur_create(Drw *drw, int shape); 46 | void drw_cur_free(Drw *drw, Cur *cursor); 47 | 48 | /* Drawing context manipulation */ 49 | void drw_setfontset(Drw *drw, Fnt *set); 50 | void drw_setscheme(Drw *drw, Clr *scm); 51 | 52 | /* Drawing functions */ 53 | void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); 54 | int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); 55 | 56 | /* Map functions */ 57 | void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); 58 | -------------------------------------------------------------------------------- /config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # exit if not in interactive mode 2 | status -i || exit 3 | 4 | set fish_greeting "" 5 | 6 | alias ls='exa --icons' 7 | alias la='exa --icons -la' 8 | alias tree='exa --icons --tree' 9 | alias cat='bat --theme base16 --paging=never --style=plain' 10 | alias g='copier -c github_token 2>&1 > /dev/null && git' 11 | # alias clear='clear && ~/.config/color-scripts/launch.sh' 12 | 13 | # color 14 | set fish_color_normal brwhite 15 | set fish_color_command brgreen 16 | set fish_color_param brwhite 17 | set fish_color_error brred 18 | set fish_color_quote bryellow 19 | 20 | # vi-mode 21 | set fish_cursor_default block 22 | set fish_cursor_insert line 23 | set fish_cursor_replace_one underscore 24 | set fish_cursor_visual block 25 | 26 | # startup 27 | # ~/.config/color-scripts/launch.sh 28 | 29 | # functions 30 | function launch_cs () 31 | set color_script $argv[1] 32 | if test color_script != "" 33 | if not test -d $HOME/.config/color-scripts 34 | echo "launch_cs: $HOME/.config/color-scripts does not exists" 35 | end 36 | if test -f $HOME/.config/color-scripts/$color_script 37 | $HOME/.config/color-scripts/$color_script 38 | else 39 | echo "launch_cs: $color_script not found" 40 | end 41 | end 42 | end 43 | 44 | function get_cs () 45 | if not test -d $HOME/.config/color-scripts 46 | echo "get_cs: $HOME/.config/color-scripts does not exists" 47 | end 48 | ls -la $HOME/.config/color-scripts 49 | end 50 | export PATH="$PATH:$HOME/.spicetify:$HOME/.local/bin:$HOME/.yarn/bin" 51 | 52 | # comment to disable vi mode 53 | fish_vi_key_bindings 54 | 55 | # blocks 56 | # launch_cs blocks 57 | 58 | # export http_proxy=http://192.168.49.1:8282/ 59 | # export https_proxy=$http_proxy 60 | # export ftp_proxy=$http_proxy 61 | # export rsync_proxy=$http_proxy 62 | # export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" 63 | 64 | # starship 65 | starship init fish | source 66 | -------------------------------------------------------------------------------- /config/st/LICENSE: -------------------------------------------------------------------------------- 1 | MIT/X Consortium License 2 | 3 | © 2014-2018 Hiltjo Posthuma 4 | © 2018 Devin J. Pohly 5 | © 2014-2017 Quentin Rameau 6 | © 2009-2012 Aurélien APTEL 7 | © 2008-2017 Anselm R Garbe 8 | © 2012-2017 Roberto E. Vargas Caballero 9 | © 2012-2016 Christoph Lohmann <20h at r-36 dot net> 10 | © 2013 Eon S. Jeon 11 | © 2013 Alexander Sedov 12 | © 2013 Mark Edgar 13 | © 2013-2014 Eric Pruitt 14 | © 2013 Michael Forney 15 | © 2013-2014 Markus Teich 16 | © 2014-2015 Laslo Hunhold 17 | 18 | Permission is hereby granted, free of charge, to any person obtaining a 19 | copy of this software and associated documentation files (the "Software"), 20 | to deal in the Software without restriction, including without limitation 21 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 22 | and/or sell copies of the Software, and to permit persons to whom the 23 | Software is furnished to do so, subject to the following conditions: 24 | 25 | The above copyright notice and this permission notice shall be included in 26 | all copies or substantial portions of the Software. 27 | 28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 31 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 33 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 34 | DEALINGS IN THE SOFTWARE. 35 | -------------------------------------------------------------------------------- /config/dwm/src/LICENSE: -------------------------------------------------------------------------------- 1 | MIT/X Consortium License 2 | 3 | © 2006-2019 Anselm R Garbe 4 | © 2006-2009 Jukka Salmi 5 | © 2006-2007 Sander van Dijk 6 | © 2007-2011 Peter Hartlich 7 | © 2007-2009 Szabolcs Nagy 8 | © 2007-2009 Christof Musik 9 | © 2007-2009 Premysl Hruby 10 | © 2007-2008 Enno Gottox Boland 11 | © 2008 Martin Hurton 12 | © 2008 Neale Pickett 13 | © 2009 Mate Nagy 14 | © 2010-2016 Hiltjo Posthuma 15 | © 2010-2012 Connor Lane Smith 16 | © 2011 Christoph Lohmann <20h@r-36.net> 17 | © 2015-2016 Quentin Rameau 18 | © 2015-2016 Eric Pruitt 19 | © 2016-2017 Markus Teich 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a 22 | copy of this software and associated documentation files (the "Software"), 23 | to deal in the Software without restriction, including without limitation 24 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 25 | and/or sell copies of the Software, and to permit persons to whom the 26 | Software is furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 34 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 36 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 37 | DEALINGS IN THE SOFTWARE. 38 | -------------------------------------------------------------------------------- /config/st/Makefile: -------------------------------------------------------------------------------- 1 | # st - simple terminal 2 | # See LICENSE file for copyright and license details. 3 | .POSIX: 4 | 5 | include config.mk 6 | 7 | SRC = st.c x.c boxdraw.c hb.c 8 | OBJ = $(SRC:.c=.o) 9 | 10 | all: options st 11 | 12 | options: 13 | @echo st build options: 14 | @echo "CFLAGS = $(STCFLAGS)" 15 | @echo "LDFLAGS = $(STLDFLAGS)" 16 | @echo "CC = $(CC)" 17 | 18 | config.h: 19 | cp config.def.h config.h 20 | 21 | .c.o: 22 | $(CC) $(STCFLAGS) -c $< 23 | 24 | st.o: config.h st.h win.h 25 | x.o: arg.h config.h st.h win.h hb.h 26 | hb.o: st.h 27 | boxdraw.o: config.h st.h boxdraw_data.h 28 | 29 | $(OBJ): config.h config.mk 30 | 31 | st: $(OBJ) 32 | $(CC) -o $@ $(OBJ) $(STLDFLAGS) 33 | 34 | clean: 35 | rm -f st $(OBJ) st-$(VERSION).tar.gz *.o *.orig *.rej 36 | 37 | dist: clean 38 | mkdir -p st-$(VERSION) 39 | cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\ 40 | config.def.h st.info st.1 arg.h st.h win.h $(SRC)\ 41 | st-$(VERSION) 42 | tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz 43 | rm -rf st-$(VERSION) 44 | 45 | install: st 46 | mkdir -p $(DESTDIR)$(PREFIX)/bin 47 | cp -f st $(DESTDIR)$(PREFIX)/bin 48 | cp -f st-copyout $(DESTDIR)$(PREFIX)/bin 49 | cp -f st-urlhandler $(DESTDIR)$(PREFIX)/bin 50 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st 51 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st-copyout 52 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st-urlhandler 53 | mkdir -p $(DESTDIR)$(MANPREFIX)/man1 54 | sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1 55 | chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1 56 | tic -sx st.info 57 | @echo Please see the README file regarding the terminfo entry of st. 58 | mkdir -p $(DESTDIR)$(PREFIX)/share/applications 59 | cp -f st.desktop $(DESTDIR)$(PREFIX)/share/applications 60 | 61 | uninstall: 62 | rm -f $(DESTDIR)$(PREFIX)/bin/st 63 | rm -f $(DESTDIR)$(PREFIX)/bin/st-copyout 64 | rm -f $(DESTDIR)$(PREFIX)/bin/st-urlhandler 65 | rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1 66 | rm -f $(DESTDIR)$(PREFIX)/share/applications/st.desktop 67 | 68 | .PHONY: all options clean dist install uninstall 69 | -------------------------------------------------------------------------------- /config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | # See dunst(5) for all configuration options 2 | 3 | [global] 4 | 5 | monitor = 0 6 | 7 | follow = mouse 8 | 9 | width = (111, 444) 10 | 11 | height = 222 12 | 13 | origin = top-right 14 | 15 | offset = 15x55 16 | 17 | scale = 0 18 | 19 | notification_limit = 0 20 | 21 | progress_bar = true 22 | 23 | progress_bar_height = 10 24 | 25 | progress_bar_frame_width = 1 26 | 27 | 28 | progress_bar_min_width = 150 29 | 30 | progress_bar_max_width = 300 31 | 32 | indicate_hidden = yes 33 | 34 | transparency = 0 35 | 36 | separator_height = 5 37 | 38 | padding = 15 39 | 40 | horizontal_padding = 15 41 | 42 | text_icon_padding = 0 43 | 44 | frame_width = 0 45 | 46 | frame_color = "#061115" 47 | 48 | separator_color = frame 49 | 50 | sort = yes 51 | 52 | font = Iosevka Nerd Font 10 53 | 54 | line_height = 0 55 | 56 | markup = full 57 | 58 | format = "%s\n%b" 59 | 60 | alignment = center 61 | 62 | vertical_alignment = center 63 | 64 | show_age_threshold = 60 65 | 66 | ellipsize = middle 67 | 68 | ignore_newline = yes 69 | 70 | stack_duplicates = true 71 | 72 | hide_duplicate_count = false 73 | 74 | show_indicators = no 75 | 76 | icon_position = left 77 | 78 | icon_size = 48 79 | 80 | max_icon_size = 80 81 | 82 | [urgency_low] 83 | # IMPORTANT: colors have to be defined in quotation marks. 84 | # Otherwise the "#" and following would be interpreted as a comment. 85 | background = "#061115" 86 | foreground = "#D9D7D6" 87 | highlight = "#D9D7D6" 88 | timeout = 6 89 | 90 | [urgency_normal] 91 | background = "#061115" 92 | foreground = "#D9D7D6" 93 | highlight = "#D9D7D6" 94 | highlight-background = "#08151a" 95 | timeout = 6 96 | 97 | [urgency_critical] 98 | background = "#061115" 99 | foreground = "#D9D7D6" 100 | highlight = "#D9D7D6" 101 | timeout = 10 102 | -------------------------------------------------------------------------------- /config/eww/scripts/getWorkspaces: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | workspaces() { 4 | ws1=1 5 | ws2=2 6 | ws3=3 7 | ws4=4 8 | ws5=5 9 | ws6=6 10 | # Unoccupied 11 | un="0" 12 | 13 | # check if Occupied 14 | o1=$(bspc query -D -d .occupied --names | grep "$ws1") 15 | o2=$(bspc query -D -d .occupied --names | grep "$ws2") 16 | o3=$(bspc query -D -d .occupied --names | grep "$ws3") 17 | o4=$(bspc query -D -d .occupied --names | grep "$ws4") 18 | o5=$(bspc query -D -d .occupied --names | grep "$ws5") 19 | o6=$(bspc query -D -d .occupied --names | grep "$ws6") 20 | 21 | # check if Focused 22 | f1=$(bspc query -D -d focused --names | grep "$ws1") 23 | f2=$(bspc query -D -d focused --names | grep "$ws2") 24 | f3=$(bspc query -D -d focused --names | grep "$ws3") 25 | f4=$(bspc query -D -d focused --names | grep "$ws4") 26 | f5=$(bspc query -D -d focused --names | grep "$ws5") 27 | f6=$(bspc query -D -d focused --names | grep "$ws6") 28 | 29 | # le spagetti 30 | content1="" 31 | content2="" 32 | content3="" 33 | content4="" 34 | content5="" 35 | content6="" 36 | if [ "$f1" ]; then 37 | content1="" 38 | fi 39 | if [ "$f2" ]; then 40 | content2="" 41 | fi 42 | if [ "$f3" ]; then 43 | content3="" 44 | fi 45 | if [ "$f4" ]; then 46 | content4="" 47 | fi 48 | if [ "$f5" ]; then 49 | content5="" 50 | fi 51 | if [ "$f6" ]; then 52 | content6="" 53 | fi 54 | 55 | echo "(box :class \"ws\" :orientation \"v\" :halign \"center\" :valign \"start\" :space-evenly \"false\" :spacing \"-5\" (button :onclick \"bspc desktop -f $ws1\" :class \"$un$o1$f1\" \"$content1\") (button :onclick \"bspc desktop -f $ws2\" :class \"$un$o2$f2\" \"$content2\") (button :onclick \"bspc desktop -f $ws3\" :class \"$un$o3$f3\" \"$content3\") (button :onclick \"bspc desktop -f $ws4\" :class \"$un$o4$f4\" \"$content4\") (button :onclick \"bspc desktop -f $ws5\" :class \"$un$o5$f5\" \"$content5\" ) (button :onclick \"bspc desktop -f $ws6\" :class \"$un$o6$f6\" \"$content6\"))" 56 | } 57 | 58 | workspaces 59 | bspc subscribe all | while read -r _ ; do 60 | workspaces 61 | done 62 | -------------------------------------------------------------------------------- /config/eww/src/yuck/_variables.yuck: -------------------------------------------------------------------------------- 1 | (defvar eww "eww -c $HOME/.config/eww/") 2 | 3 | ;; LAUNCHERS 4 | (defvar browser "firefox") 5 | (defvar terminal "st") 6 | (defvar rofi "rofi -show drun") 7 | (defvar chat "discord") 8 | 9 | ;; DATE VARS 10 | (defpoll minute :interval "1s" 11 | "date '+%M'") 12 | (defpoll hour :interval "1s" 13 | "date '+%H'") 14 | (defpoll weekday :interval "24h" 15 | "date '+%A'") 16 | (defpoll monthday :interval "24h" 17 | "date '+%d %b'") 18 | 19 | ;; SYSTEM INFO VARS 20 | (defpoll used_ram :interval "5s" 21 | "./scripts/getUsedRam") 22 | (defpoll volume :interval "2s" 23 | "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") 24 | (defpoll micro :interval "2s" 25 | "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") 26 | (defpoll brightness :interval "2s" 27 | "brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'") 28 | 29 | ;; MUSIC PLAYER VARS 30 | (defpoll art :interval "5s" 31 | "./scripts/echoSongArt") 32 | (defpoll song_art :interval "5s" 33 | "./scripts/getSongArt") 34 | (defpoll song_artist :interval "5s" 35 | "./scripts/getSongArtist") 36 | (defpoll song_title :interval "2s" 37 | "./scripts/getSongTitle") 38 | (defpoll song_title_full :interval "5s" 39 | "./scripts/getSongTitle full") 40 | (defpoll player_status :interval "2s" 41 | "./scripts/getPlayerStatus") 42 | 43 | ;; LOCK SCREEN VARS 44 | (defpoll username :interval "12h" 45 | "whoami") 46 | (defpoll hostname :interval "12h" 47 | "hostname") 48 | 49 | ;; WEATHER VARS 50 | (defpoll weather_temp :interval "5m" 51 | "./scripts/getWeather current_temp") 52 | (defpoll weather_desc :interval "5m" 53 | "./scripts/getWeather weather_desc") 54 | 55 | ;; CALENDAR VARS 56 | (defpoll calendar_day :interval "10h" 57 | "date '+%d'") 58 | (defpoll calendar_month :interval "10h" 59 | "./scripts/getCalendarMonth") 60 | (defpoll calendar_year :interval "10h" 61 | "date '+%Y'") 62 | 63 | ;; NETWORK VARS 64 | (defpoll network-icon :interval "5s" "scripts/getNetwork icon") 65 | (defpoll network-name :interval "5s" "scripts/getNetwork name") 66 | 67 | ;; Layout 68 | (defpoll layout :interval "1s" "scripts/getLayout") 69 | -------------------------------------------------------------------------------- /config/fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR __fish_initialized:3400 4 | SETUVAR _fisher_jorgebucaran_2F_fisher_files:/home/gabriel/\x2econfig/fish/functions/fisher\x2efish\x1e/home/gabriel/\x2econfig/fish/completions/fisher\x2efish 5 | SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:/home/gabriel/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e/home/gabriel/\x2econfig/fish/functions/_nvm_list\x2efish\x1e/home/gabriel/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e/home/gabriel/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e/home/gabriel/\x2econfig/fish/functions/nvm\x2efish\x1e/home/gabriel/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e/home/gabriel/\x2econfig/fish/completions/nvm\x2efish 6 | SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish 7 | SETUVAR fish_color_autosuggestion:555\x1ebrblack 8 | SETUVAR fish_color_cancel:\x2dr 9 | SETUVAR fish_color_command:brgreen 10 | SETUVAR fish_color_comment:990000 11 | SETUVAR fish_color_cwd:green 12 | SETUVAR fish_color_cwd_root:red 13 | SETUVAR fish_color_end:009900 14 | SETUVAR fish_color_error:brred 15 | SETUVAR fish_color_escape:00a6b2 16 | SETUVAR fish_color_history_current:\x2d\x2dbold 17 | SETUVAR fish_color_host:normal 18 | SETUVAR fish_color_host_remote:yellow 19 | SETUVAR fish_color_normal:brwhite 20 | SETUVAR fish_color_operator:00a6b2 21 | SETUVAR fish_color_param:brwhite 22 | SETUVAR fish_color_quote:bryellow 23 | SETUVAR fish_color_redirection:00afff 24 | SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack 25 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 26 | SETUVAR fish_color_status:red 27 | SETUVAR fish_color_user:brgreen 28 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 29 | SETUVAR fish_key_bindings:fish_vi_key_bindings 30 | SETUVAR fish_pager_color_completion:\x1d 31 | SETUVAR fish_pager_color_description:B3A06D\x1eyellow 32 | SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 33 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 34 | SETUVAR fish_pager_color_selected_background:\x2dr 35 | SETUVAR nvm_data:/home/gabriel/\x2elocal/share/nvm 36 | SETUVAR nvm_default_version:v14\x2e19\x2e1 37 | SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist 38 | -------------------------------------------------------------------------------- /config/dwm/scripts/widgets: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # colors 4 | fg=#b6beca 5 | bg=#101419 6 | contrast=#15191e 7 | lighter=#1a1e23 8 | 9 | black=#242931 10 | red=#e05f65 11 | green=#76b97f 12 | yellow=#f1cf8a 13 | blue=#70a5eb 14 | magenta="#c68aee" 15 | cyan="#74bee9" 16 | white="#dee1e6" 17 | 18 | # src 19 | percentage () { 20 | local val=$(echo $1 | tr '%' ' ' | awk '{print $1}') 21 | local icon1=$2 22 | local icon2=$3 23 | local icon3=$4 24 | local icon4=$5 25 | if [ "$val" -le 15 ]; then 26 | echo $icon1 27 | elif [ "$val" -le 30 ]; then 28 | echo $icon2 29 | elif [ "$val" -le 60 ]; then 30 | echo $icon3 31 | else 32 | echo $icon4 33 | fi 34 | } 35 | 36 | get_network_icon () { 37 | [ $(cat /sys/class/net/w*/operstate) = down ] && echo 睊 && exit 38 | echo  39 | } 40 | 41 | get_network () { 42 | id=$(iwgetid -r || echo "Disconnected") 43 | icon=$(get_network_icon) 44 | if [[ $id == "Disconnected" ]]; then 45 | printf "^b$red^^c$bg^ $icon ^b$bg^^c$red^ $id ^b$bg^" 46 | else 47 | printf "^b$blue^^c$bg^ $icon ^b$bg^^c$cyan^ $id ^b$bg^" 48 | fi 49 | } 50 | 51 | get_volume_icon () { 52 | local vol=$1 53 | echo $(percentage "$vol" "" "" "墳" "") 54 | } 55 | 56 | get_volume () { 57 | vol=$(amixer get Master |grep % |awk '{print $5}'|sed -e 's/\[//' -e 's/\]//' | head -n 1) 58 | icon=$(get_volume_icon $vol) 59 | vol=$(echo $vol | tr "%" " ") 60 | vol=$(echo "${vol% }") 61 | printf "^b$green^^c$bg^ $icon ^c$green^^b$bg^ $vol%% " 62 | } 63 | 64 | get_vpn () { 65 | ip=$(ifconfig tun0 2>/dev/null | grep inet | head -n 1 | awk '{print $2}') 66 | if [[ $ip == "" ]]; then 67 | echo "^c$magenta^^b$lighter^  ^b$bg^^c$magenta^ Disconnected ^b$bg^^c$fg^" 68 | else 69 | echo "^c$cyan^^b$lighter^  ^b$bg^^c$cyan^ $ip ^b$bg^^c$fg^" 70 | fi 71 | } 72 | 73 | get_date () { 74 | printf "^c$magenta^^b$lighter^  ^b$bg^ $(date +'%R') ^c$fg^^b$bg^" 75 | } 76 | 77 | get_ram () { 78 | printf "^b$lighter^^c$red^  ^b$bg^^c$red^ %.0f%% ^b$bg^^c$fg^\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') 79 | } 80 | 81 | get_brightness () { 82 | br=$(light -G | tr '.' ' ' | awk '{print $1}') 83 | icon=$(percentage "$br" "" "" "" "") 84 | printf "^c$yellow^ $icon ^b$bg^^c$yellow^ $br%% ^c$fg^^b$bg^" 85 | } 86 | 87 | get_title () { 88 | # using " " to get more margin in the bar (problems at patch, and idk how to really fix it lmao) 89 | echo "$(get_ram)$(get_brightness)$(get_vpn)$(get_network)$(get_date) " 90 | } 91 | 92 | while :; do 93 | xsetroot -name "$(get_title)" 94 | sleep 0.5 95 | done & 96 | 97 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Custom Dwm Build 2 | 3 | This is my custom dwm build which not uses dwmblocks or something similar for bar, i created a custom script approaching the status2d patch :3 4 | 5 | ![demonstration](./misc/demonstration.png) 6 | 7 | [Enjoy notes](#enjoy) 8 | 9 | ## Requirements 10 | 11 | - JetBrainsMono Nerd Font (general font) 12 | - Iosevka Nerd Font (for dashboard with eww) 13 | - MaterialDesign Font (download from [this](https://github.com/Templarian/MaterialDesign-Font/)) 14 | - eww (for dashboard) 15 | - fish (as shell) 16 | - feh 17 | - starship (for make fish prompt) 18 | - rofi (for select apps) 19 | - dunst (for notifications) 20 | - picom (compositor) 21 | - light (for get brightness) 22 | - exa (ls replacement) 23 | - bat (cat replacement) 24 | - alsa-utils (for amixer) 25 | - wireless\_tools (iwgetid) 26 | 27 | ## About this 28 | 29 | ### Dwm patches 30 | 31 | - statuspadding + status2d fix patch (extracted from chadwm and really manually modified by me) 32 | - barpadding 33 | - dragmfact 34 | - launchers 35 | - rainbowtags 36 | - warp 37 | - underlinetag 38 | - status2d 39 | - restartsig 40 | - rotatestack 41 | - fullgaps 42 | - bar-height 43 | - fixborders 44 | - notitle 45 | - pertag 46 | 47 | ### St 48 | 49 | The st config is based in [siduck's st build](https://github.com/siduck/st) 50 | 51 | ## Installation 52 | 53 | > First make sure u have all the [requirements](#requirements) installed on ur system 54 | 55 | 1. Clone the repo: 56 | 57 | ```sh 58 | git clone https://github.com/AlphaTechnolog/dwm.git dwm 59 | cd dwm 60 | ``` 61 | 62 | 2. Then, copy the configs: 63 | 64 | **IF EXISTS SOME CONFIGURATION FILES IN ~/.config | ~/.local/bin | ~/ IT'LL BE REPLACED** 65 | 66 | ```sh 67 | cp -r ./config/* ~/.config 68 | cp -r ./bin/* ~/.local/bin 69 | cp -r ./home/* ~/ 70 | ``` 71 | 72 | Use `xrdb` to merge `colors` 73 | 74 | ```sh 75 | xrdb merge ~/.Xresources 76 | ``` 77 | 78 | 3. Compile dwm 79 | 80 | ```sh 81 | cd ~/.config/dwm/src 82 | test -f config.h && rm config.h 83 | sudo make clean install 84 | ``` 85 | 86 | 4. Compile st 87 | 88 | ```sh 89 | cd ~/.config/st 90 | test -f config.h && rm config.h 91 | sudo make clean install 92 | ``` 93 | 94 | 5. Create the launcher 95 | 96 | If u're using a login manager like sddm or lightdm u can copy the .desktop to `/usr/share/xsessions` and replace in the file 97 | `/usr/share/xsessions/dwm.desktop` the name `gabriel` to ur username. 98 | 99 | ```sh 100 | sudo cp -r ./launchers/dwm.desktop /usr/share/xsessions 101 | sudo nvim /usr/share/xsessions/dwm.desktop # and change gabriel to ur username in the file 102 | ``` 103 | 104 | If u're using startx, u can copy the file xinitrc, that contains an example orders to execute dwm, feel tree to customize it: 105 | 106 | ```sh 107 | cp -r ./launchers/xinitrc ~/.xinitrc 108 | ``` 109 | 110 | Then startx: 111 | 112 | ```sh 113 | startx 114 | ``` 115 | 116 | ## Enjoy! 117 | 118 | I hope u like this :3 119 | 120 | if yes, please give me a star 121 | 122 | If u want to use neovim without terminal padding and at exit get back ur terminal padding, use `nv` in st terminal :3 123 | -------------------------------------------------------------------------------- /config/rofi/appmnu.rasi: -------------------------------------------------------------------------------- 1 | @import "colors/colors.rasi" 2 | 3 | configuration { 4 | show-icons: true; 5 | display-drun: "Applications"; 6 | drun-display-format: "{name}"; 7 | disable-history: false; 8 | hide-scrollbar: true; 9 | sidebar-mode: false; 10 | } 11 | 12 | window { 13 | transparency: "real"; 14 | font: "Iosevka Nerd Font 11"; 15 | width: 36%; 16 | } 17 | 18 | entry { 19 | background-color: @background-alt; 20 | text-color: @foreground; 21 | placeholder-color: @foreground; 22 | expand: true; 23 | horizontal-align: 0; 24 | placeholder: "  Type here to search..."; 25 | padding: 10px; 26 | margin: 0 1%; 27 | blink: true; 28 | border: 0px 0px 2px 0px; 29 | border-radius: 6px; 30 | border-color: @accent; 31 | } 32 | 33 | inputbar { 34 | children: [ entry ]; 35 | background-color: @background; 36 | text-color: @background; 37 | expand: false; 38 | margin: 0px 0px 0px 0px; 39 | padding: 1%; 40 | } 41 | 42 | listview { 43 | background-color: @background; 44 | padding: 10px; 45 | columns: 4; 46 | lines: 3; 47 | spacing: 0%; 48 | cycle: false; 49 | dynamic: true; 50 | layout: vertical; 51 | } 52 | 53 | mainbox { 54 | background-color: @background; 55 | children: [ inputbar, listview ]; 56 | spacing: 0%; 57 | padding: 10px; 58 | } 59 | 60 | element { 61 | orientation: vertical; 62 | background-color: @background; 63 | text-color: @foreground; 64 | border-radius: 0%; 65 | padding: 6px; 66 | } 67 | 68 | element-icon, element-text { 69 | background-color: inherit; 70 | text-color: inherit; 71 | } 72 | 73 | element-icon { 74 | horizontal-align: 0.5; 75 | vertical-align: 0.5; 76 | size: 42px; 77 | border: 16px; 78 | border-color: transparent; 79 | } 80 | 81 | element-text { 82 | expand: true; 83 | horizontal-align: 0.5; 84 | vertical-align: 0.5; 85 | margin: -12px 0px 12px 0px; 86 | } 87 | 88 | element selected { 89 | background-color: @background-alt; 90 | text-color: @foreground; 91 | border: 0px 0px 2px 0px; 92 | border-color: @border; 93 | border-radius: 10px; 94 | } 95 | -------------------------------------------------------------------------------- /config/st/hb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "st.h" 9 | 10 | void hbtransformsegment(XftFont *xfont, const Glyph *string, hb_codepoint_t *codepoints, int start, int length); 11 | hb_font_t *hbfindfont(XftFont *match); 12 | 13 | typedef struct { 14 | XftFont *match; 15 | hb_font_t *font; 16 | } HbFontMatch; 17 | 18 | static int hbfontslen = 0; 19 | static HbFontMatch *hbfontcache = NULL; 20 | 21 | void 22 | hbunloadfonts() 23 | { 24 | for (int i = 0; i < hbfontslen; i++) { 25 | hb_font_destroy(hbfontcache[i].font); 26 | XftUnlockFace(hbfontcache[i].match); 27 | } 28 | 29 | if (hbfontcache != NULL) { 30 | free(hbfontcache); 31 | hbfontcache = NULL; 32 | } 33 | hbfontslen = 0; 34 | } 35 | 36 | hb_font_t * 37 | hbfindfont(XftFont *match) 38 | { 39 | for (int i = 0; i < hbfontslen; i++) { 40 | if (hbfontcache[i].match == match) 41 | return hbfontcache[i].font; 42 | } 43 | 44 | /* Font not found in cache, caching it now. */ 45 | hbfontcache = realloc(hbfontcache, sizeof(HbFontMatch) * (hbfontslen + 1)); 46 | FT_Face face = XftLockFace(match); 47 | hb_font_t *font = hb_ft_font_create(face, NULL); 48 | if (font == NULL) 49 | die("Failed to load Harfbuzz font."); 50 | 51 | hbfontcache[hbfontslen].match = match; 52 | hbfontcache[hbfontslen].font = font; 53 | hbfontslen += 1; 54 | 55 | return font; 56 | } 57 | 58 | void 59 | hbtransform(XftGlyphFontSpec *specs, const Glyph *glyphs, size_t len, int x, int y) 60 | { 61 | int start = 0, length = 1, gstart = 0; 62 | hb_codepoint_t *codepoints = calloc(len, sizeof(hb_codepoint_t)); 63 | 64 | for (int idx = 1, specidx = 1; idx < len; idx++) { 65 | if (glyphs[idx].mode & ATTR_WDUMMY) { 66 | length += 1; 67 | continue; 68 | } 69 | 70 | if (specs[specidx].font != specs[start].font || ATTRCMP(glyphs[gstart], glyphs[idx]) || selected(x + idx, y) != selected(x + gstart, y)) { 71 | hbtransformsegment(specs[start].font, glyphs, codepoints, gstart, length); 72 | 73 | /* Reset the sequence. */ 74 | length = 1; 75 | start = specidx; 76 | gstart = idx; 77 | } else { 78 | length += 1; 79 | } 80 | 81 | specidx++; 82 | } 83 | 84 | /* EOL. */ 85 | hbtransformsegment(specs[start].font, glyphs, codepoints, gstart, length); 86 | 87 | /* Apply the transformation to glyph specs. */ 88 | for (int i = 0, specidx = 0; i < len; i++) { 89 | if (glyphs[i].mode & ATTR_WDUMMY) 90 | continue; 91 | if (glyphs[i].mode & ATTR_BOXDRAW) { 92 | specidx++; 93 | continue; 94 | } 95 | 96 | if (codepoints[i] != specs[specidx].glyph) 97 | ((Glyph *)glyphs)[i].mode |= ATTR_LIGA; 98 | 99 | specs[specidx++].glyph = codepoints[i]; 100 | } 101 | 102 | free(codepoints); 103 | } 104 | 105 | void 106 | hbtransformsegment(XftFont *xfont, const Glyph *string, hb_codepoint_t *codepoints, int start, int length) 107 | { 108 | hb_font_t *font = hbfindfont(xfont); 109 | if (font == NULL) 110 | return; 111 | 112 | Rune rune; 113 | ushort mode = USHRT_MAX; 114 | hb_buffer_t *buffer = hb_buffer_create(); 115 | hb_buffer_set_direction(buffer, HB_DIRECTION_LTR); 116 | 117 | /* Fill buffer with codepoints. */ 118 | for (int i = start; i < (start+length); i++) { 119 | rune = string[i].u; 120 | mode = string[i].mode; 121 | if (mode & ATTR_WDUMMY) 122 | rune = 0x0020; 123 | hb_buffer_add_codepoints(buffer, &rune, 1, 0, 1); 124 | } 125 | 126 | /* Shape the segment. */ 127 | hb_shape(font, buffer, NULL, 0); 128 | 129 | /* Get new glyph info. */ 130 | hb_glyph_info_t *info = hb_buffer_get_glyph_infos(buffer, NULL); 131 | 132 | /* Write new codepoints. */ 133 | for (int i = 0; i < length; i++) { 134 | hb_codepoint_t gid = info[i].codepoint; 135 | codepoints[start+i] = gid; 136 | } 137 | 138 | /* Cleanup. */ 139 | hb_buffer_destroy(buffer); 140 | } 141 | -------------------------------------------------------------------------------- /config/dwm/src/dwm.c.rej: -------------------------------------------------------------------------------- 1 | --- dwm.c 2 | +++ dwm.c 3 | @@ -85,7 +85,14 @@ enum { SchemeNorm, SchemeSel, SchemeDarker, 4 | SchemeBlack, SchemeWhite, 5 | SchemeBrRed, SchemeBrGreen, SchemeBrBlue, 6 | SchemeBrCyan, SchemeBrMagenta, SchemeBrYellow, 7 | - SchemeBrBlack, SchemeBrWhite, SchemeFloat }; /* color schemes */ 8 | + SchemeBrBlack, SchemeBrWhite, SchemeFloat, 9 | + SchemeTag, SchemeTag1, SchemeTag2, SchemeTag3, 10 | + SchemeTag4, SchemeTag5, SchemeTag6, SchemeTag7, 11 | + SchemeTag8, SchemeTag9, SchemeLayout, 12 | + SchemeTitle, SchemeTitleFloat, 13 | + SchemeTitle1, SchemeTitle2, SchemeTitle3, 14 | + SchemeTitle4, SchemeTitle5, SchemeTitle6, 15 | + SchemeTitle7, SchemeTitle8, SchemeTitle9 }; /* color schemes */ 16 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 17 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 18 | NetWMWindowTypeDialog, NetClientList, NetDesktopNames, 19 | @@ -162,6 +169,8 @@ struct Monitor { 20 | unsigned int sellt; 21 | unsigned int tagset[2]; 22 | unsigned int alttag; 23 | + unsigned int colorfultitle; 24 | + unsigned int colorfultag; 25 | unsigned int showvacanttags; 26 | int showbar; 27 | int topbar; 28 | @@ -1043,6 +1054,8 @@ createmon(void) 29 | m->gappov = gappov; 30 | m->showbar = showbar; 31 | m->topbar = topbar; 32 | + m->colorfultag = colorfultag ? colorfultag : 0; 33 | + m->colorfultitle = colorfultitle ? colorfultitle : 0; 34 | m->showvacanttags = showvacanttags ? showvacanttags : 0; 35 | m->lt[0] = &layouts[taglayouts[1] % LENGTH(layouts)]; 36 | m->lt[1] = &layouts[1 % LENGTH(layouts)]; 37 | @@ -1200,7 +1213,18 @@ drawbar(Monitor *m) 38 | wdelta = selmon->alttag 39 | ? (TEXTW(tagsalt[i]) - TEXTW(tags[i])) / 2 40 | : 0; 41 | - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); 42 | + if (selmon->colorfultag) 43 | + drw_setscheme( 44 | + drw, 45 | + scheme[m->tagset[m->seltags] & 1 << i 46 | + ? tagschemes[i] : SchemeTag] 47 | + ); 48 | + else 49 | + drw_setscheme( 50 | + drw, 51 | + scheme[m->tagset[m->seltags] & 1 << i 52 | + ? SchemeSel : SchemeTag] 53 | + ); 54 | drw_text( 55 | drw, x, 0, 56 | w, bh, wdelta + lrpad / 2, 57 | @@ -1230,7 +1254,7 @@ drawbar(Monitor *m) 58 | x += w; 59 | } 60 | w = TEXTW(m->ltsymbol); 61 | - drw_setscheme(drw, scheme[SchemeNorm]); 62 | + drw_setscheme(drw, scheme[SchemeLayout]); 63 | x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); 64 | 65 | if (m == selmon) { 66 | @@ -1241,7 +1265,19 @@ drawbar(Monitor *m) 67 | } 68 | if (w > bh) { 69 | if (m->sel) { 70 | - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); 71 | + if (selmon->colorfultitle) { 72 | + for (i = 0; i < LENGTH(tags); i++) 73 | + if (selmon->sel->tags & 1 << i) 74 | + drw_setscheme( 75 | + drw, 76 | + scheme[titleschemes[i]] 77 | + ); 78 | + } else { 79 | + int s = (m == selmon) && m->sel->isfloating 80 | + ? SchemeTitleFloat 81 | + : SchemeTitle; 82 | + drw_setscheme(drw, scheme[s]); 83 | + } 84 | drw_text( 85 | drw, 86 | x, 0, 87 | -------------------------------------------------------------------------------- /config/st/README.md: -------------------------------------------------------------------------------- 1 | # St (Suckless Terminal) 2 | 3 | ## Xresources live-reload demo 4 | 5 |

6 | 7 | ## Dependencies 8 | 9 | ``` 10 | # Void 11 | xbps-install libXft-devel libX11-devel harfbuzz-devel libXext-devel libXrender-devel libXinerama-devel 12 | 13 | # Debian (and ubuntu probably) 14 | apt install build-essential libxft-dev libharfbuzz-dev 15 | 16 | (most of these are already installed on Arch based distros) 17 | 18 | # Install font-symbola and libXft-bgra 19 | ``` 20 | 21 | ## Install 22 | 23 | ``` 24 | git clone https://github.com/siduck/st.git 25 | cd st 26 | sudo make install 27 | xrdb merge pathToXresourcesFile 28 | ``` 29 | 30 | (note : put the xrdb merge command in your wm's autostart or similar) 31 | 32 | ## Fonts 33 | 34 | - Install JetbrainsMono Mono Nerd Font or any nerd font from [here](https://www.nerdfonts.com/font-downloads) 35 | 36 | ## Patches: 37 | 38 | - Ligatures 39 | - sixel (check sixel branch) 40 | - scrollback 41 | - Clipboard 42 | - Alpha(Transparency) 43 | - Boxdraw 44 | - patch_column ( doesnt cut text while resizing) 45 | - font2 46 | - right click paste 47 | - st desktop entry 48 | - newterm 49 | - anygeometry 50 | - xresources 51 | - sync patch ( Better draw timing to reduce flicker/tearing and improve animation smoothness ) 52 | - live reload ( change colors/fonts on the fly ) 53 | and more... 54 |
55 | 56 | ## Xresources live-reload 57 | 58 | ``` 59 | # make an alias for this command 60 | 61 | alias rel="xrdb merge pathToXresourcesFile && kill -USR1 $(pidof st)" 62 | ``` 63 | 64 | ## Ram usage comparison with other terminals and speed test 65 |

66 |

67 |

68 | 69 | ( note : This benchmark was done on my low end machine which has a pentium cpu so the speed results might vary ) 70 | 71 | ## Default Keybindings
72 | 73 |
 74 | ctrl + shift + c        Copy  
75 | ctrl + shift + v Paste
76 | right click on the terminal ( will paste the copied thing ) 77 | 78 | (Zoom) 79 | alt + comma Zoom in
80 | alt + . Zoom out
81 | alt + g Reset Zoom
82 | 83 | (Transparency) 84 | alt + s Increase Transparency
85 | alt + a Decrease Transparency
86 | alt + m Reset Transparency
87 | 88 | alt + k scroll down 89 | alt + j scroll up 90 | 91 | mod + shift + enter open a new terminal with same cwd ( current working directory ) 92 |
93 | 94 | you can change all of these in config.h 95 |
96 | 97 | ## Themes/Fonts used 98 | 99 | - ls-icons: https://github.com/Yash-Handa/logo-ls
100 | - Xresources: onedark ( just xrdb merge xresourcesfile , do this everytime you make any change to xresources file ) from this repo itself.
101 | - Font: JetbrainsMono Nerd Font + material design icon fonts 102 | 103 | ## Screenshots: 104 | 105 |

106 |

107 |

108 |

109 | 110 | # Credits 111 | 112 | - [live-reload](https://github.com/nimaipatel/st) 113 | - [patch_column](https://github.com/nimaipatel/st/blob/all/patches/7672445bab01cb4e861651dc540566ac22e25812.diff) 114 | 115 | ## Other St builds
116 | 117 | 1. Sixel St (sixel branch , with sixel graphics support) 118 | 2. St with vim-browse (vim-browse branch , navigate within like vim) 119 | 3. Awesomewm users might face a weird gaps issue (#23) so they need to use the anysize branch. 120 | 121 | - Use a different st build ( clone its branch) 122 | 123 | `example: git clone https://github.com/siduck/st --branch sixel` 124 | -------------------------------------------------------------------------------- /config/st/st.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE for license details. */ 2 | 3 | #include 4 | #include 5 | 6 | /* macros */ 7 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) 8 | #define MAX(a, b) ((a) < (b) ? (b) : (a)) 9 | #define LEN(a) (sizeof(a) / sizeof(a)[0]) 10 | #define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) 11 | #define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) 12 | #define DEFAULT(a, b) (a) = (a) ? (a) : (b) 13 | #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) 14 | #define ATTRCMP(a, b) (((a).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) != ((b).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) || \ 15 | (a).fg != (b).fg || \ 16 | (a).bg != (b).bg) 17 | #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ 18 | (t1.tv_nsec-t2.tv_nsec)/1E6) 19 | #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) 20 | 21 | #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) 22 | #define IS_TRUECOL(x) (1 << 24 & (x)) 23 | 24 | enum glyph_attribute { 25 | ATTR_NULL = 0, 26 | ATTR_BOLD = 1 << 0, 27 | ATTR_FAINT = 1 << 1, 28 | ATTR_ITALIC = 1 << 2, 29 | ATTR_UNDERLINE = 1 << 3, 30 | ATTR_BLINK = 1 << 4, 31 | ATTR_REVERSE = 1 << 5, 32 | ATTR_INVISIBLE = 1 << 6, 33 | ATTR_STRUCK = 1 << 7, 34 | ATTR_WRAP = 1 << 8, 35 | ATTR_WIDE = 1 << 9, 36 | ATTR_WDUMMY = 1 << 10, 37 | ATTR_BOXDRAW = 1 << 11, 38 | ATTR_LIGA = 1 << 12, 39 | ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, 40 | }; 41 | 42 | enum drawing_mode { 43 | DRAW_NONE = 0, 44 | DRAW_BG = 1 << 0, 45 | DRAW_FG = 1 << 1, 46 | }; 47 | 48 | enum selection_mode { 49 | SEL_IDLE = 0, 50 | SEL_EMPTY = 1, 51 | SEL_READY = 2 52 | }; 53 | 54 | enum selection_type { 55 | SEL_REGULAR = 1, 56 | SEL_RECTANGULAR = 2 57 | }; 58 | 59 | enum selection_snap { 60 | SNAP_WORD = 1, 61 | SNAP_LINE = 2 62 | }; 63 | 64 | typedef unsigned char uchar; 65 | typedef unsigned int uint; 66 | typedef unsigned long ulong; 67 | typedef unsigned short ushort; 68 | 69 | typedef uint_least32_t Rune; 70 | 71 | #define Glyph Glyph_ 72 | typedef struct { 73 | Rune u; /* character code */ 74 | ushort mode; /* attribute flags */ 75 | uint32_t fg; /* foreground */ 76 | uint32_t bg; /* background */ 77 | } Glyph; 78 | 79 | typedef Glyph *Line; 80 | 81 | typedef union { 82 | int i; 83 | uint ui; 84 | float f; 85 | const void *v; 86 | } Arg; 87 | 88 | typedef struct { 89 | uint b; 90 | uint mask; 91 | void (*func)(const Arg *); 92 | const Arg arg; 93 | } MouseKey; 94 | 95 | void die(const char *, ...); 96 | void redraw(void); 97 | void draw(void); 98 | 99 | void externalpipe(const Arg *); 100 | void iso14755(const Arg *); 101 | void kscrolldown(const Arg *); 102 | void kscrollup(const Arg *); 103 | void newterm(const Arg *); 104 | void printscreen(const Arg *); 105 | void printsel(const Arg *); 106 | void sendbreak(const Arg *); 107 | void toggleprinter(const Arg *); 108 | 109 | int tattrset(int); 110 | int tisaltscr(void); 111 | void tnew(int, int); 112 | void tresize(int, int); 113 | void tsetdirtattr(int); 114 | void ttyhangup(void); 115 | int ttynew(char *, char *, char *, char **); 116 | size_t ttyread(void); 117 | void ttyresize(int, int); 118 | void ttywrite(const char *, size_t, int); 119 | 120 | void resettitle(void); 121 | 122 | void selclear(void); 123 | void selinit(void); 124 | void selstart(int, int, int); 125 | void selextend(int, int, int, int); 126 | int selected(int, int); 127 | char *getsel(void); 128 | 129 | size_t utf8encode(Rune, char *); 130 | 131 | void *xmalloc(size_t); 132 | void *xrealloc(void *, size_t); 133 | char *xstrdup(char *); 134 | 135 | int isboxdraw(Rune); 136 | ushort boxdrawindex(const Glyph *); 137 | #ifdef XFT_VERSION 138 | /* only exposed to x.c, otherwise we'll need Xft.h for the types */ 139 | void boxdraw_xinit(Display *, Colormap, XftDraw *, Visual *); 140 | void drawboxes(int, int, int, int, XftColor *, XftColor *, const XftGlyphFontSpec *, int); 141 | #endif 142 | 143 | /* config.h globals */ 144 | extern char *utmp; 145 | extern char *stty_args; 146 | extern char *vtiden; 147 | extern wchar_t *worddelimiters; 148 | extern int allowaltscreen; 149 | extern char *termname; 150 | extern unsigned int tabspaces; 151 | extern unsigned int defaultfg; 152 | extern unsigned int defaultbg; 153 | extern unsigned int defaultcs; 154 | extern const int boxdraw, boxdraw_bold, boxdraw_braille; 155 | extern float alpha; 156 | extern MouseKey mkeys[]; 157 | extern int ximspot_update_interval; 158 | -------------------------------------------------------------------------------- /config/st/st.info: -------------------------------------------------------------------------------- 1 | st| simpleterm, 2 | acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 3 | am, 4 | bce, 5 | bel=^G, 6 | blink=\E[5m, 7 | bold=\E[1m, 8 | cbt=\E[Z, 9 | cvvis=\E[?25h, 10 | civis=\E[?25l, 11 | clear=\E[H\E[2J, 12 | cnorm=\E[?12l\E[?25h, 13 | colors#8, 14 | cols#80, 15 | cr=^M, 16 | csr=\E[%i%p1%d;%p2%dr, 17 | cub=\E[%p1%dD, 18 | cub1=^H, 19 | cud1=^J, 20 | cud=\E[%p1%dB, 21 | cuf1=\E[C, 22 | cuf=\E[%p1%dC, 23 | cup=\E[%i%p1%d;%p2%dH, 24 | cuu1=\E[A, 25 | cuu=\E[%p1%dA, 26 | dch=\E[%p1%dP, 27 | dch1=\E[P, 28 | dim=\E[2m, 29 | dl=\E[%p1%dM, 30 | dl1=\E[M, 31 | ech=\E[%p1%dX, 32 | ed=\E[J, 33 | el=\E[K, 34 | el1=\E[1K, 35 | enacs=\E)0, 36 | flash=\E[?5h$<80/>\E[?5l, 37 | fsl=^G, 38 | home=\E[H, 39 | hpa=\E[%i%p1%dG, 40 | hs, 41 | ht=^I, 42 | hts=\EH, 43 | ich=\E[%p1%d@, 44 | il1=\E[L, 45 | il=\E[%p1%dL, 46 | ind=^J, 47 | indn=\E[%p1%dS, 48 | invis=\E[8m, 49 | is2=\E[4l\E>\E[?1034l, 50 | it#8, 51 | kel=\E[1;2F, 52 | ked=\E[1;5F, 53 | ka1=\E[1~, 54 | ka3=\E[5~, 55 | kc1=\E[4~, 56 | kc3=\E[6~, 57 | kbs=\177, 58 | kcbt=\E[Z, 59 | kb2=\EOu, 60 | kcub1=\EOD, 61 | kcud1=\EOB, 62 | kcuf1=\EOC, 63 | kcuu1=\EOA, 64 | kDC=\E[3;2~, 65 | kent=\EOM, 66 | kEND=\E[1;2F, 67 | kIC=\E[2;2~, 68 | kNXT=\E[6;2~, 69 | kPRV=\E[5;2~, 70 | kHOM=\E[1;2H, 71 | kLFT=\E[1;2D, 72 | kRIT=\E[1;2C, 73 | kind=\E[1;2B, 74 | kri=\E[1;2A, 75 | kclr=\E[3;5~, 76 | kdl1=\E[3;2~, 77 | kdch1=\E[3~, 78 | kich1=\E[2~, 79 | kend=\E[4~, 80 | kf1=\EOP, 81 | kf2=\EOQ, 82 | kf3=\EOR, 83 | kf4=\EOS, 84 | kf5=\E[15~, 85 | kf6=\E[17~, 86 | kf7=\E[18~, 87 | kf8=\E[19~, 88 | kf9=\E[20~, 89 | kf10=\E[21~, 90 | kf11=\E[23~, 91 | kf12=\E[24~, 92 | kf13=\E[1;2P, 93 | kf14=\E[1;2Q, 94 | kf15=\E[1;2R, 95 | kf16=\E[1;2S, 96 | kf17=\E[15;2~, 97 | kf18=\E[17;2~, 98 | kf19=\E[18;2~, 99 | kf20=\E[19;2~, 100 | kf21=\E[20;2~, 101 | kf22=\E[21;2~, 102 | kf23=\E[23;2~, 103 | kf24=\E[24;2~, 104 | kf25=\E[1;5P, 105 | kf26=\E[1;5Q, 106 | kf27=\E[1;5R, 107 | kf28=\E[1;5S, 108 | kf29=\E[15;5~, 109 | kf30=\E[17;5~, 110 | kf31=\E[18;5~, 111 | kf32=\E[19;5~, 112 | kf33=\E[20;5~, 113 | kf34=\E[21;5~, 114 | kf35=\E[23;5~, 115 | kf36=\E[24;5~, 116 | kf37=\E[1;6P, 117 | kf38=\E[1;6Q, 118 | kf39=\E[1;6R, 119 | kf40=\E[1;6S, 120 | kf41=\E[15;6~, 121 | kf42=\E[17;6~, 122 | kf43=\E[18;6~, 123 | kf44=\E[19;6~, 124 | kf45=\E[20;6~, 125 | kf46=\E[21;6~, 126 | kf47=\E[23;6~, 127 | kf48=\E[24;6~, 128 | kf49=\E[1;3P, 129 | kf50=\E[1;3Q, 130 | kf51=\E[1;3R, 131 | kf52=\E[1;3S, 132 | kf53=\E[15;3~, 133 | kf54=\E[17;3~, 134 | kf55=\E[18;3~, 135 | kf56=\E[19;3~, 136 | kf57=\E[20;3~, 137 | kf58=\E[21;3~, 138 | kf59=\E[23;3~, 139 | kf60=\E[24;3~, 140 | kf61=\E[1;4P, 141 | kf62=\E[1;4Q, 142 | kf63=\E[1;4R, 143 | khome=\E[1~, 144 | kil1=\E[2;5~, 145 | krmir=\E[2;2~, 146 | knp=\E[6~, 147 | kmous=\E[M, 148 | kpp=\E[5~, 149 | lines#24, 150 | mir, 151 | msgr, 152 | npc, 153 | op=\E[39;49m, 154 | pairs#64, 155 | mc0=\E[i, 156 | mc4=\E[4i, 157 | mc5=\E[5i, 158 | rc=\E8, 159 | rev=\E[7m, 160 | ri=\EM, 161 | ritm=\E[23m, 162 | rmacs=\E(B, 163 | rmcup=\E[?1049l, 164 | rmir=\E[4l, 165 | rmkx=\E[?1l\E>, 166 | rmso=\E[27m, 167 | rmul=\E[24m, 168 | rs1=\Ec, 169 | rs2=\E[4l\E>\E[?1034l, 170 | sc=\E7, 171 | setab=\E[4%p1%dm, 172 | setaf=\E[3%p1%dm, 173 | setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 174 | setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 175 | sgr0=\E[0m, 176 | sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, 177 | sitm=\E[3m, 178 | smacs=\E(0, 179 | smcup=\E[?1049h, 180 | smir=\E[4h, 181 | smkx=\E[?1h\E=, 182 | smso=\E[7m, 183 | smul=\E[4m, 184 | tbc=\E[3g, 185 | tsl=\E]0;, 186 | xenl, 187 | vpa=\E[%i%p1%dd, 188 | # XTerm extensions 189 | rmxx=\E[29m, 190 | smxx=\E[9m, 191 | # tmux extensions, see TERMINFO EXTENSIONS in tmux(1) 192 | Tc, 193 | Ms=\E]52;%p1%s;%p2%s\007, 194 | Se=\E[2 q, 195 | Ss=\E[%p1%d q, 196 | 197 | st-256color| simpleterm with 256 colors, 198 | use=st, 199 | ccc, 200 | colors#256, 201 | oc=\E]104\007, 202 | pairs#32767, 203 | # Nicked from xterm-256color 204 | initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, 205 | setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, 206 | setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, 207 | 208 | st-meta| simpleterm with meta key, 209 | use=st, 210 | km, 211 | rmm=\E[?1034l, 212 | smm=\E[?1034h, 213 | rs2=\E[4l\E>\E[?1034h, 214 | is2=\E[4l\E>\E[?1034h, 215 | 216 | st-meta-256color| simpleterm with meta key and 256 colors, 217 | use=st-256color, 218 | km, 219 | rmm=\E[?1034l, 220 | smm=\E[?1034h, 221 | rs2=\E[4l\E>\E[?1034h, 222 | is2=\E[4l\E>\E[?1034h, 223 | -------------------------------------------------------------------------------- /config/st/st.1: -------------------------------------------------------------------------------- 1 | .TH ST 1 st\-VERSION 2 | .SH NAME 3 | st \- simple terminal (Luke Smith (https://lukesmith.xyz)'s build) 4 | .SH SYNOPSIS 5 | .B st 6 | .RB [ \-aiv ] 7 | .RB [ \-c 8 | .IR class ] 9 | .RB [ \-f 10 | .IR font ] 11 | .RB [ \-g 12 | .IR geometry ] 13 | .RB [ \-n 14 | .IR name ] 15 | .RB [ \-o 16 | .IR iofile ] 17 | .RB [ \-T 18 | .IR title ] 19 | .RB [ \-t 20 | .IR title ] 21 | .RB [ \-l 22 | .IR line ] 23 | .RB [ \-w 24 | .IR windowid ] 25 | .RB [[ \-e ] 26 | .IR command 27 | .RI [ arguments ...]] 28 | .PP 29 | .B st 30 | .RB [ \-aiv ] 31 | .RB [ \-c 32 | .IR class ] 33 | .RB [ \-f 34 | .IR font ] 35 | .RB [ \-g 36 | .IR geometry ] 37 | .RB [ \-n 38 | .IR name ] 39 | .RB [ \-o 40 | .IR iofile ] 41 | .RB [ \-T 42 | .IR title ] 43 | .RB [ \-t 44 | .IR title ] 45 | .RB [ \-w 46 | .IR windowid ] 47 | .RB \-l 48 | .IR line 49 | .RI [ stty_args ...] 50 | .SH DESCRIPTION 51 | .B st 52 | is a simple terminal emulator. 53 | .SH OPTIONS 54 | .TP 55 | .B \-a 56 | disable alternate screens in terminal 57 | .TP 58 | .BI \-c " class" 59 | defines the window class (default $TERM). 60 | .TP 61 | .BI \-f " font" 62 | defines the 63 | .I font 64 | to use when st is run. 65 | .TP 66 | .BI \-g " geometry" 67 | defines the X11 geometry string. 68 | The form is [=][{xX}][{+-}{+-}]. See 69 | .BR XParseGeometry (3) 70 | for further details. 71 | .TP 72 | .B \-i 73 | will fixate the position given with the -g option. 74 | .TP 75 | .BI \-n " name" 76 | defines the window instance name (default $TERM). 77 | .TP 78 | .BI \-o " iofile" 79 | writes all the I/O to 80 | .I iofile. 81 | This feature is useful when recording st sessions. A value of "-" means 82 | standard output. 83 | .TP 84 | .BI \-T " title" 85 | defines the window title (default 'st'). 86 | .TP 87 | .BI \-t " title" 88 | defines the window title (default 'st'). 89 | .TP 90 | .BI \-w " windowid" 91 | embeds st within the window identified by 92 | .I windowid 93 | .TP 94 | .BI \-l " line" 95 | use a tty 96 | .I line 97 | instead of a pseudo terminal. 98 | .I line 99 | should be a (pseudo-)serial device (e.g. /dev/ttyS0 on Linux for serial port 100 | 0). 101 | When this flag is given 102 | remaining arguments are used as flags for 103 | .BR stty(1). 104 | By default st initializes the serial line to 8 bits, no parity, 1 stop bit 105 | and a 38400 baud rate. The speed is set by appending it as last argument 106 | (e.g. 'st -l /dev/ttyS0 115200'). Arguments before the last one are 107 | .BR stty(1) 108 | flags. If you want to set odd parity on 115200 baud use for example 'st -l 109 | /dev/ttyS0 parenb parodd 115200'. Set the number of bits by using for 110 | example 'st -l /dev/ttyS0 cs7 115200'. See 111 | .BR stty(1) 112 | for more arguments and cases. 113 | .TP 114 | .B \-v 115 | prints version information to stderr, then exits. 116 | .TP 117 | .BI \-e " command " [ " arguments " "... ]" 118 | st executes 119 | .I command 120 | instead of the shell. If this is used it 121 | .B must be the last option 122 | on the command line, as in xterm / rxvt. 123 | This option is only intended for compatibility, 124 | and all the remaining arguments are used as a command 125 | even without it. 126 | .SH SHORTCUTS 127 | .TP 128 | .B Alt-j/k or Alt-Up/Down or Alt-Mouse Wheel 129 | Scroll up/down one line at a time. 130 | .TP 131 | .B Alt-u/d or Alt-Page Up/Page Down 132 | Scroll up/down one screen at a time. 133 | .TP 134 | .B Alt-Shift-k/j or Alt-Shift-Page Up/Page Down or Alt-Shift-Mouse Wheel 135 | Increase or decrease font size. 136 | .TP 137 | .B Alt-Home 138 | Reset to default font size. 139 | .TP 140 | .B Shift-Insert or Alt-v 141 | Paste from clipboard. 142 | .TP 143 | .B Alt-c 144 | Copy to clipboard. 145 | .TP 146 | .B Alt-p 147 | Paste/input primary selection. 148 | .TP 149 | .B Alt-l 150 | Show dmenu menu of all URLs on screen and choose one to open. 151 | .TP 152 | .B Alt-y 153 | Show dmenu menu of all URLs on screen and choose one to copy. 154 | .TP 155 | .B Alt-o 156 | Show dmenu menu of all recently run commands and copy the output of the chosen command to the clipboard. 157 | .I xclip 158 | required. 159 | .TP 160 | .B Alt-a/s 161 | Increase or decrease opacity/alpha value (make window more or less transparent). 162 | .TP 163 | .B Break 164 | Send a break in the serial line. 165 | Break key is obtained in PC keyboards 166 | pressing at the same time control and pause. 167 | .TP 168 | .B Ctrl-Print Screen 169 | Toggle if st should print to the 170 | .I iofile. 171 | .TP 172 | .B Shift-Print Screen 173 | Print the full screen to the 174 | .I iofile. 175 | .TP 176 | .B Print Screen 177 | Print the selection to the 178 | .I iofile. 179 | .TP 180 | .B Alt-Ctrl 181 | Launch dmenu to enter a unicode codepoint and send the corresponding glyph 182 | to st. 183 | .SH CUSTOMIZATION 184 | .B st 185 | can be customized by creating a custom config.h and (re)compiling the source 186 | code. This keeps it fast, secure and simple. 187 | .SH AUTHORS 188 | See the LICENSE file for the authors. 189 | .SH LICENSE 190 | See the LICENSE file for the terms of redistribution. 191 | .SH SEE ALSO 192 | .BR tabbed (1), 193 | .BR utmp (1), 194 | .BR stty (1) 195 | .SH BUGS 196 | See the TODO file in the distribution. 197 | 198 | -------------------------------------------------------------------------------- /config/fish/functions/fish_right_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_right_prompt 2 | set -l cmd_status $status 3 | if test $cmd_status -ne 0 4 | echo -n (set_color red)"✘ $cmd_status" 5 | end 6 | 7 | if not command -sq git 8 | set_color normal 9 | return 10 | end 11 | 12 | # Get the git directory for later use. 13 | # Return if not inside a Git repository work tree. 14 | if not set -l git_dir (command git rev-parse --git-dir 2>/dev/null) 15 | set_color normal 16 | return 17 | end 18 | 19 | # Get the current action ("merge", "rebase", etc.) 20 | # and if there's one get the current commit hash too. 21 | set -l commit '' 22 | if set -l action (fish_print_git_action "$git_dir") 23 | set commit (command git rev-parse HEAD 2> /dev/null | string sub -l 7) 24 | end 25 | 26 | # Get either the branch name or a branch descriptor. 27 | set -l branch_detached 0 28 | if not set -l branch (command git symbolic-ref --short HEAD 2>/dev/null) 29 | set branch_detached 1 30 | set branch (command git describe --contains --all HEAD 2>/dev/null) 31 | end 32 | 33 | # Get the commit difference counts between local and remote. 34 | command git rev-list --count --left-right 'HEAD...@{upstream}' 2>/dev/null \ 35 | | read -d \t -l status_ahead status_behind 36 | if test $status -ne 0 37 | set status_ahead 0 38 | set status_behind 0 39 | end 40 | 41 | # Get the stash status. 42 | # (git stash list) is very slow. => Avoid using it. 43 | set -l status_stashed 0 44 | if test -f "$git_dir/refs/stash" 45 | set status_stashed 1 46 | else if test -r "$git_dir/commondir" 47 | read -l commondir <"$git_dir/commondir" 48 | if test -f "$commondir/refs/stash" 49 | set status_stashed 1 50 | end 51 | end 52 | 53 | # git-status' porcelain v1 format starts with 2 letters on each line: 54 | # The first letter (X) denotes the index state. 55 | # The second letter (Y) denotes the working directory state. 56 | # 57 | # The following table presents the possible combinations: 58 | # * The underscore character denotes whitespace. 59 | # * The cell values stand for the following file states: 60 | # a: added 61 | # d: deleted 62 | # m: modified 63 | # r: renamed 64 | # u: unmerged 65 | # t: untracked 66 | # * Cells with more than one letter signify that both states 67 | # are simultaneously the case. This is possible since the git index 68 | # and working directory operate independently of each other. 69 | # * Cells which are empty are unhandled by this code. 70 | # * T (= type change) is undocumented. 71 | # See Git v1.7.8.2 release notes for more information. 72 | # 73 | # \ Y→ 74 | # X \ 75 | # ↓ | A | C | D | M | R | T | U | X | B | ? | _ 76 | # ----+----+----+----+----+----+----+----+----+----+----+---- 77 | # A | u | | ad | am | r | am | u | | | | a 78 | # C | | | ad | am | r | am | u | | | | a 79 | # D | | | u | am | r | am | u | | | | a 80 | # M | | | ad | am | r | am | u | | | | a 81 | # R | r | r | rd | rm | r | rm | ur | r | r | r | r 82 | # T | | | ad | am | r | am | u | | | | a 83 | # U | u | u | u | um | ur | um | u | u | u | u | u 84 | # X | | | | m | r | m | u | | | | 85 | # B | | | | m | r | m | u | | | | 86 | # ? | | | | m | r | m | u | | | t | 87 | # _ | | | d | m | r | m | u | | | | 88 | set -l porcelain_status (command git status --porcelain | string sub -l2) 89 | 90 | set -l status_added 0 91 | if string match -qr '[ACDMT][ MT]|[ACMT]D' $porcelain_status 92 | set status_added 1 93 | end 94 | set -l status_deleted 0 95 | if string match -qr '[ ACMRT]D' $porcelain_status 96 | set status_deleted 1 97 | end 98 | set -l status_modified 0 99 | if string match -qr '[MT]$' $porcelain_status 100 | set status_modified 1 101 | end 102 | set -l status_renamed 0 103 | if string match -qe R $porcelain_status 104 | set status_renamed 1 105 | end 106 | set -l status_unmerged 0 107 | if string match -qr 'AA|DD|U' $porcelain_status 108 | set status_unmerged 1 109 | end 110 | set -l status_untracked 0 111 | if string match -qe '\?\?' $porcelain_status 112 | set status_untracked 1 113 | end 114 | 115 | set_color -o 116 | 117 | if test -n "$branch" 118 | if test $branch_detached -ne 0 119 | set_color brmagenta 120 | else 121 | set_color green 122 | end 123 | echo -n " $branch" 124 | end 125 | if test -n "$commit" 126 | echo -n ' '(set_color yellow)"$commit" 127 | end 128 | if test -n "$action" 129 | set_color normal 130 | echo -n (set_color white)':'(set_color -o brred)"$action" 131 | end 132 | if test $status_ahead -ne 0 133 | echo -n ' '(set_color brmagenta)'⬆' 134 | end 135 | if test $status_behind -ne 0 136 | echo -n ' '(set_color brmagenta)'⬇' 137 | end 138 | if test $status_stashed -ne 0 139 | echo -n ' '(set_color cyan)'✭' 140 | end 141 | if test $status_added -ne 0 142 | echo -n ' '(set_color green)'✚' 143 | end 144 | if test $status_deleted -ne 0 145 | echo -n ' '(set_color red)'✖' 146 | end 147 | if test $status_modified -ne 0 148 | echo -n ' '(set_color blue)'✱' 149 | end 150 | if test $status_renamed -ne 0 151 | echo -n ' '(set_color magenta)'➜' 152 | end 153 | if test $status_unmerged -ne 0 154 | echo -n ' '(set_color yellow)'═' 155 | end 156 | if test $status_untracked -ne 0 157 | echo -n ' '(set_color white)'◼' 158 | end 159 | 160 | set_color normal 161 | end 162 | -------------------------------------------------------------------------------- /config/dwm/src/dwm.1: -------------------------------------------------------------------------------- 1 | .TH DWM 1 dwm\-VERSION 2 | .SH NAME 3 | dwm \- dynamic window manager 4 | .SH SYNOPSIS 5 | .B dwm 6 | .RB [ \-v ] 7 | .SH DESCRIPTION 8 | dwm is a dynamic window manager for X. It manages windows in tiled, monocle 9 | and floating layouts. Either layout can be applied dynamically, optimising the 10 | environment for the application in use and the task performed. 11 | .P 12 | In tiled layouts windows are managed in a master and stacking area. The master 13 | area on the left contains one window by default, and the stacking area on the 14 | right contains all other windows. The number of master area windows can be 15 | adjusted from zero to an arbitrary number. In monocle layout all windows are 16 | maximised to the screen size. In floating layout windows can be resized and 17 | moved freely. Dialog windows are always managed floating, regardless of the 18 | layout applied. 19 | .P 20 | Windows are grouped by tags. Each window can be tagged with one or multiple 21 | tags. Selecting certain tags displays all windows with these tags. 22 | .P 23 | Each screen contains a small status bar which displays all available tags, the 24 | layout, the title of the focused window, and the text read from the root window 25 | name property, if the screen is focused. A floating window is indicated with an 26 | empty square and a maximised floating window is indicated with a filled square 27 | before the windows title. The selected tags are indicated with a different 28 | color. The tags of the focused window are indicated with a filled square in the 29 | top left corner. The tags which are applied to one or more windows are 30 | indicated with an empty square in the top left corner. 31 | .P 32 | dwm draws a small border around windows to indicate the focus state. 33 | .SH OPTIONS 34 | .TP 35 | .B \-v 36 | prints version information to stderr, then exits. 37 | .SH USAGE 38 | .SS Status bar 39 | .TP 40 | .B X root window name 41 | is read and displayed in the status text area. It can be set with the 42 | .BR xsetroot (1) 43 | command. 44 | .TP 45 | .B Button1 46 | click on a tag label to display all windows with that tag, click on the layout 47 | label toggles between tiled and floating layout. 48 | .TP 49 | .B Button3 50 | click on a tag label adds/removes all windows with that tag to/from the view. 51 | .TP 52 | .B Mod1\-Button1 53 | click on a tag label applies that tag to the focused window. 54 | .TP 55 | .B Mod1\-Button3 56 | click on a tag label adds/removes that tag to/from the focused window. 57 | .SS Keyboard commands 58 | .TP 59 | .B Mod1\-Shift\-Return 60 | Start 61 | .BR st(1). 62 | .TP 63 | .B Mod1\-p 64 | Spawn 65 | .BR dmenu(1) 66 | for launching other programs. 67 | .TP 68 | .B Mod1\-, 69 | Focus previous screen, if any. 70 | .TP 71 | .B Mod1\-. 72 | Focus next screen, if any. 73 | .TP 74 | .B Mod1\-Shift\-, 75 | Send focused window to previous screen, if any. 76 | .TP 77 | .B Mod1\-Shift\-. 78 | Send focused window to next screen, if any. 79 | .TP 80 | .B Mod1\-b 81 | Toggles bar on and off. 82 | .TP 83 | .B Mod1\-t 84 | Sets tiled layout. 85 | .TP 86 | .B Mod1\-f 87 | Sets floating layout. 88 | .TP 89 | .B Mod1\-m 90 | Sets monocle layout. 91 | .TP 92 | .B Mod1\-space 93 | Toggles between current and previous layout. 94 | .TP 95 | .B Mod1\-j 96 | Focus next window. 97 | .TP 98 | .B Mod1\-k 99 | Focus previous window. 100 | .TP 101 | .B Mod1\-i 102 | Increase number of windows in master area. 103 | .TP 104 | .B Mod1\-d 105 | Decrease number of windows in master area. 106 | .TP 107 | .B Mod1\-l 108 | Increase master area size. 109 | .TP 110 | .B Mod1\-h 111 | Decrease master area size. 112 | .TP 113 | .B Mod1\-Return 114 | Zooms/cycles focused window to/from master area (tiled layouts only). 115 | .TP 116 | .B Mod1\-Shift\-c 117 | Close focused window. 118 | .TP 119 | .B Mod1\-Shift\-space 120 | Toggle focused window between tiled and floating state. 121 | .TP 122 | .B Mod1\-Tab 123 | Toggles to the previously selected tags. 124 | .TP 125 | .B Mod1\-Shift\-[1..n] 126 | Apply nth tag to focused window. 127 | .TP 128 | .B Mod1\-Shift\-0 129 | Apply all tags to focused window. 130 | .TP 131 | .B Mod1\-Control\-Shift\-[1..n] 132 | Add/remove nth tag to/from focused window. 133 | .TP 134 | .B Mod1\-[1..n] 135 | View all windows with nth tag. 136 | .TP 137 | .B Mod1\-0 138 | View all windows with any tag. 139 | .TP 140 | .B Mod1\-Control\-[1..n] 141 | Add/remove all windows with nth tag to/from the view. 142 | .TP 143 | .B Mod1\-Shift\-q 144 | Quit dwm. 145 | .TP 146 | .B Mod1\-Control\-Shift\-q 147 | Restart dwm. 148 | .SS Mouse commands 149 | .TP 150 | .B Mod1\-Button1 151 | Move focused window while dragging. Tiled windows will be toggled to the floating state. 152 | .TP 153 | .B Mod1\-Button2 154 | Toggles focused window between floating and tiled state. 155 | .TP 156 | .B Mod1\-Button3 157 | Resize focused window while dragging. Tiled windows will be toggled to the floating state. 158 | .SH CUSTOMIZATION 159 | dwm is customized by creating a custom config.h and (re)compiling the source 160 | code. This keeps it fast, secure and simple. 161 | .SH SIGNALS 162 | .TP 163 | .B SIGHUP - 1 164 | Restart the dwm process. 165 | .TP 166 | .B SIGTERM - 15 167 | Cleanly terminate the dwm process. 168 | .SH SEE ALSO 169 | .BR dmenu (1), 170 | .BR st (1) 171 | .SH ISSUES 172 | Java applications which use the XToolkit/XAWT backend may draw grey windows 173 | only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early 174 | JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds 175 | are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the 176 | environment variable 177 | .BR AWT_TOOLKIT=MToolkit 178 | (to use the older Motif backend instead) or running 179 | .B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D 180 | or 181 | .B wmname LG3D 182 | (to pretend that a non-reparenting window manager is running that the 183 | XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable 184 | .BR _JAVA_AWT_WM_NONREPARENTING=1 . 185 | .SH BUGS 186 | Send all bug reports with a patch to hackers@suckless.org. 187 | -------------------------------------------------------------------------------- /config/eww/src/scss/bar/widgets/_systray.scss: -------------------------------------------------------------------------------- 1 | .sys-tray-box { 2 | background-color: $bg; 3 | // border-radius: 6px; 4 | padding: 2em; 5 | 6 | .first-row { 7 | .sys-tray-box-left { 8 | .network { 9 | background-color: $contrastbg; 10 | border-radius: 6px; 11 | 12 | .title { 13 | color: $fgDim; 14 | margin-left: 1em; 15 | margin-top: 1em; 16 | } 17 | 18 | .ssid { 19 | margin-left: -8px; 20 | margin-bottom: 0.3em; 21 | font-size: 20px; 22 | font-weight: bolder; 23 | } 24 | } 25 | 26 | .date { 27 | background-color: $contrastbg; 28 | border-radius: 6px; 29 | margin-top: 1em; 30 | 31 | .weekday { 32 | color: $fgDim; 33 | margin-top: 1em; 34 | margin-left: 1em; 35 | } 36 | 37 | .monthday { 38 | margin-left: -2.4em; 39 | margin-bottom: 0.3em; 40 | font-size: 24px; 41 | font-weight: bold; 42 | } 43 | } 44 | } 45 | 46 | .sys-tray-box-right { 47 | margin: 1em 0em 0em 1.5em; 48 | 49 | .ram { 50 | .ram-progress { 51 | background-color: $contrastbg; 52 | color: $red; 53 | 54 | .ram-icon { 55 | margin: 1em; 56 | font-size: 40px; 57 | font-family: "Material Icons"; 58 | color: $red; 59 | } 60 | } 61 | } 62 | } 63 | } 64 | 65 | .second-row { 66 | margin-top: 1em; 67 | 68 | .music-player { 69 | .song-art { 70 | background-color: $contrastbg; 71 | background-size: 58% 100%; 72 | background-repeat: no-repeat; 73 | border-radius: 6px; 74 | 75 | min-width: 20em; 76 | margin-right: 15px; 77 | 78 | .music-info { 79 | all: unset; 80 | background-color: transparent; 81 | border-radius: 6px; 82 | 83 | margin-top: 10px; 84 | margin-left: -9.1rem; 85 | 86 | .np { 87 | margin-bottom: 6px; 88 | } 89 | 90 | .title { 91 | font-size: 16px; 92 | font-weight: bolder; 93 | } 94 | .artist { 95 | color: $fgDim; 96 | } 97 | } 98 | } 99 | 100 | .song-controls { 101 | background-color: $contrastbg; 102 | padding: 0em 1em; 103 | margin-left: 6px; 104 | border-radius: 6px; 105 | 106 | button { 107 | font-family: "Material Icons"; 108 | font-size: 24px; 109 | 110 | &:hover { 111 | color: $accent; 112 | } 113 | } 114 | } 115 | } 116 | } 117 | 118 | .third-row { 119 | margin-top: 2em; 120 | 121 | .system-info { 122 | margin: 0em 1em 0em .7em; 123 | 124 | .volume { 125 | margin: 0.5em 0em; 126 | 127 | .volume-icon { 128 | margin: 0rem 1rem; 129 | color: $green; 130 | font-size: 26px; 131 | } 132 | 133 | scale trough { 134 | background-color: $contrastbg; 135 | border-radius: 10px; 136 | min-height: .7em; 137 | min-width: 19em; 138 | margin: 0.5rem 0; 139 | } 140 | 141 | .volbar trough highlight { 142 | background-image: linear-gradient(to right, #87c7a1, $green); 143 | border-radius: 10px; 144 | } 145 | } 146 | .brightness { 147 | margin: 0.75em 0em; 148 | 149 | .brightness-icon { 150 | margin: 0rem 1rem; 151 | color: $yellow; 152 | font-size: 26px; 153 | } 154 | 155 | scale trough { 156 | background-color: $contrastbg; 157 | border-radius: 10px; 158 | min-height: .7em; 159 | min-width: 19em; 160 | margin: 0.5rem 0; 161 | } 162 | 163 | .bribar trough highlight { 164 | background-image: linear-gradient(to right, #de8f78, $yellow); 165 | border-radius: 10px; 166 | } 167 | } 168 | .mic { 169 | margin: 0.5em 0em; 170 | 171 | .mic-icon { 172 | margin: 0rem 1rem; 173 | color: $blue; 174 | font-size: 26px; 175 | } 176 | 177 | scale trough { 178 | background-color: $contrastbg; 179 | border-radius: 10px; 180 | min-height: .7em; 181 | min-width: 19em; 182 | margin: 0.5rem 0; 183 | } 184 | 185 | .micbar trough highlight { 186 | background-image: linear-gradient(to right, $blue-desaturated, $blue); 187 | border-radius: 10px; 188 | } 189 | } 190 | } 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /config/st/boxdraw.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Avi Halachmi (:avih) avihpit@yahoo.com https://github.com/avih 3 | * MIT/X Consortium License 4 | */ 5 | 6 | #include 7 | #include "st.h" 8 | #include "boxdraw_data.h" 9 | 10 | /* Rounded non-negative integers division of n / d */ 11 | #define DIV(n, d) (((n) + (d) / 2) / (d)) 12 | 13 | static Display *xdpy; 14 | static Colormap xcmap; 15 | static XftDraw *xd; 16 | static Visual *xvis; 17 | 18 | static void drawbox(int, int, int, int, XftColor *, XftColor *, ushort); 19 | static void drawboxlines(int, int, int, int, XftColor *, ushort); 20 | 21 | /* public API */ 22 | 23 | void 24 | boxdraw_xinit(Display *dpy, Colormap cmap, XftDraw *draw, Visual *vis) 25 | { 26 | xdpy = dpy; xcmap = cmap; xd = draw, xvis = vis; 27 | } 28 | 29 | int 30 | isboxdraw(Rune u) 31 | { 32 | Rune block = u & ~0xff; 33 | return (boxdraw && block == 0x2500 && boxdata[(uint8_t)u]) || 34 | (boxdraw_braille && block == 0x2800); 35 | } 36 | 37 | /* the "index" is actually the entire shape data encoded as ushort */ 38 | ushort 39 | boxdrawindex(const Glyph *g) 40 | { 41 | if (boxdraw_braille && (g->u & ~0xff) == 0x2800) 42 | return BRL | (uint8_t)g->u; 43 | if (boxdraw_bold && (g->mode & ATTR_BOLD)) 44 | return BDB | boxdata[(uint8_t)g->u]; 45 | return boxdata[(uint8_t)g->u]; 46 | } 47 | 48 | void 49 | drawboxes(int x, int y, int cw, int ch, XftColor *fg, XftColor *bg, 50 | const XftGlyphFontSpec *specs, int len) 51 | { 52 | for ( ; len-- > 0; x += cw, specs++) 53 | drawbox(x, y, cw, ch, fg, bg, (ushort)specs->glyph); 54 | } 55 | 56 | /* implementation */ 57 | 58 | void 59 | drawbox(int x, int y, int w, int h, XftColor *fg, XftColor *bg, ushort bd) 60 | { 61 | ushort cat = bd & ~(BDB | 0xff); /* mask out bold and data */ 62 | if (bd & (BDL | BDA)) { 63 | /* lines (light/double/heavy/arcs) */ 64 | drawboxlines(x, y, w, h, fg, bd); 65 | 66 | } else if (cat == BBD) { 67 | /* lower (8-X)/8 block */ 68 | int d = DIV((uint8_t)bd * h, 8); 69 | XftDrawRect(xd, fg, x, y + d, w, h - d); 70 | 71 | } else if (cat == BBU) { 72 | /* upper X/8 block */ 73 | XftDrawRect(xd, fg, x, y, w, DIV((uint8_t)bd * h, 8)); 74 | 75 | } else if (cat == BBL) { 76 | /* left X/8 block */ 77 | XftDrawRect(xd, fg, x, y, DIV((uint8_t)bd * w, 8), h); 78 | 79 | } else if (cat == BBR) { 80 | /* right (8-X)/8 block */ 81 | int d = DIV((uint8_t)bd * w, 8); 82 | XftDrawRect(xd, fg, x + d, y, w - d, h); 83 | 84 | } else if (cat == BBQ) { 85 | /* Quadrants */ 86 | int w2 = DIV(w, 2), h2 = DIV(h, 2); 87 | if (bd & TL) 88 | XftDrawRect(xd, fg, x, y, w2, h2); 89 | if (bd & TR) 90 | XftDrawRect(xd, fg, x + w2, y, w - w2, h2); 91 | if (bd & BL) 92 | XftDrawRect(xd, fg, x, y + h2, w2, h - h2); 93 | if (bd & BR) 94 | XftDrawRect(xd, fg, x + w2, y + h2, w - w2, h - h2); 95 | 96 | } else if (bd & BBS) { 97 | /* Shades - data is 1/2/3 for 25%/50%/75% alpha, respectively */ 98 | int d = (uint8_t)bd; 99 | XftColor xfc; 100 | XRenderColor xrc = { .alpha = 0xffff }; 101 | 102 | xrc.red = DIV(fg->color.red * d + bg->color.red * (4 - d), 4); 103 | xrc.green = DIV(fg->color.green * d + bg->color.green * (4 - d), 4); 104 | xrc.blue = DIV(fg->color.blue * d + bg->color.blue * (4 - d), 4); 105 | 106 | XftColorAllocValue(xdpy, xvis, xcmap, &xrc, &xfc); 107 | XftDrawRect(xd, &xfc, x, y, w, h); 108 | XftColorFree(xdpy, xvis, xcmap, &xfc); 109 | 110 | } else if (cat == BRL) { 111 | /* braille, each data bit corresponds to one dot at 2x4 grid */ 112 | int w1 = DIV(w, 2); 113 | int h1 = DIV(h, 4), h2 = DIV(h, 2), h3 = DIV(3 * h, 4); 114 | 115 | if (bd & 1) XftDrawRect(xd, fg, x, y, w1, h1); 116 | if (bd & 2) XftDrawRect(xd, fg, x, y + h1, w1, h2 - h1); 117 | if (bd & 4) XftDrawRect(xd, fg, x, y + h2, w1, h3 - h2); 118 | if (bd & 8) XftDrawRect(xd, fg, x + w1, y, w - w1, h1); 119 | if (bd & 16) XftDrawRect(xd, fg, x + w1, y + h1, w - w1, h2 - h1); 120 | if (bd & 32) XftDrawRect(xd, fg, x + w1, y + h2, w - w1, h3 - h2); 121 | if (bd & 64) XftDrawRect(xd, fg, x, y + h3, w1, h - h3); 122 | if (bd & 128) XftDrawRect(xd, fg, x + w1, y + h3, w - w1, h - h3); 123 | 124 | } 125 | } 126 | 127 | void 128 | drawboxlines(int x, int y, int w, int h, XftColor *fg, ushort bd) 129 | { 130 | /* s: stem thickness. width/8 roughly matches underscore thickness. */ 131 | /* We draw bold as 1.5 * normal-stem and at least 1px thicker. */ 132 | /* doubles draw at least 3px, even when w or h < 3. bold needs 6px. */ 133 | int mwh = MIN(w, h); 134 | int base_s = MAX(1, DIV(mwh, 8)); 135 | int bold = (bd & BDB) && mwh >= 6; /* possibly ignore boldness */ 136 | int s = bold ? MAX(base_s + 1, DIV(3 * base_s, 2)) : base_s; 137 | int w2 = DIV(w - s, 2), h2 = DIV(h - s, 2); 138 | /* the s-by-s square (x + w2, y + h2, s, s) is the center texel. */ 139 | /* The base length (per direction till edge) includes this square. */ 140 | 141 | int light = bd & (LL | LU | LR | LD); 142 | int double_ = bd & (DL | DU | DR | DD); 143 | 144 | if (light) { 145 | /* d: additional (negative) length to not-draw the center */ 146 | /* texel - at arcs and avoid drawing inside (some) doubles */ 147 | int arc = bd & BDA; 148 | int multi_light = light & (light - 1); 149 | int multi_double = double_ & (double_ - 1); 150 | /* light crosses double only at DH+LV, DV+LH (ref. shapes) */ 151 | int d = arc || (multi_double && !multi_light) ? -s : 0; 152 | 153 | if (bd & LL) 154 | XftDrawRect(xd, fg, x, y + h2, w2 + s + d, s); 155 | if (bd & LU) 156 | XftDrawRect(xd, fg, x + w2, y, s, h2 + s + d); 157 | if (bd & LR) 158 | XftDrawRect(xd, fg, x + w2 - d, y + h2, w - w2 + d, s); 159 | if (bd & LD) 160 | XftDrawRect(xd, fg, x + w2, y + h2 - d, s, h - h2 + d); 161 | } 162 | 163 | /* double lines - also align with light to form heavy when combined */ 164 | if (double_) { 165 | /* 166 | * going clockwise, for each double-ray: p is additional length 167 | * to the single-ray nearer to the previous direction, and n to 168 | * the next. p and n adjust from the base length to lengths 169 | * which consider other doubles - shorter to avoid intersections 170 | * (p, n), or longer to draw the far-corner texel (n). 171 | */ 172 | int dl = bd & DL, du = bd & DU, dr = bd & DR, dd = bd & DD; 173 | if (dl) { 174 | int p = dd ? -s : 0, n = du ? -s : dd ? s : 0; 175 | XftDrawRect(xd, fg, x, y + h2 + s, w2 + s + p, s); 176 | XftDrawRect(xd, fg, x, y + h2 - s, w2 + s + n, s); 177 | } 178 | if (du) { 179 | int p = dl ? -s : 0, n = dr ? -s : dl ? s : 0; 180 | XftDrawRect(xd, fg, x + w2 - s, y, s, h2 + s + p); 181 | XftDrawRect(xd, fg, x + w2 + s, y, s, h2 + s + n); 182 | } 183 | if (dr) { 184 | int p = du ? -s : 0, n = dd ? -s : du ? s : 0; 185 | XftDrawRect(xd, fg, x + w2 - p, y + h2 - s, w - w2 + p, s); 186 | XftDrawRect(xd, fg, x + w2 - n, y + h2 + s, w - w2 + n, s); 187 | } 188 | if (dd) { 189 | int p = dr ? -s : 0, n = dl ? -s : dr ? s : 0; 190 | XftDrawRect(xd, fg, x + w2 + s, y + h2 - p, s, h - h2 + p); 191 | XftDrawRect(xd, fg, x + w2 - s, y + h2 - n, s, h - h2 + n); 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /config/st/boxdraw_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Avi Halachmi (:avih) avihpit@yahoo.com https://github.com/avih 3 | * MIT/X Consortium License 4 | */ 5 | 6 | /* 7 | * U+25XX codepoints data 8 | * 9 | * References: 10 | * http://www.unicode.org/charts/PDF/U2500.pdf 11 | * http://www.unicode.org/charts/PDF/U2580.pdf 12 | * 13 | * Test page: 14 | * https://github.com/GNOME/vte/blob/master/doc/boxes.txt 15 | */ 16 | 17 | /* Each shape is encoded as 16-bits. Higher bits are category, lower are data */ 18 | /* Categories (mutually exclusive except BDB): */ 19 | /* For convenience, BDL/BDA/BBS/BDB are 1 bit each, the rest are enums */ 20 | #define BDL (1<<8) /* Box Draw Lines (light/double/heavy) */ 21 | #define BDA (1<<9) /* Box Draw Arc (light) */ 22 | 23 | #define BBD (1<<10) /* Box Block Down (lower) X/8 */ 24 | #define BBL (2<<10) /* Box Block Left X/8 */ 25 | #define BBU (3<<10) /* Box Block Upper X/8 */ 26 | #define BBR (4<<10) /* Box Block Right X/8 */ 27 | #define BBQ (5<<10) /* Box Block Quadrants */ 28 | #define BRL (6<<10) /* Box Braille (data is lower byte of U28XX) */ 29 | 30 | #define BBS (1<<14) /* Box Block Shades */ 31 | #define BDB (1<<15) /* Box Draw is Bold */ 32 | 33 | /* (BDL/BDA) Light/Double/Heavy x Left/Up/Right/Down/Horizontal/Vertical */ 34 | /* Heavy is light+double (literally drawing light+double align to form heavy) */ 35 | #define LL (1<<0) 36 | #define LU (1<<1) 37 | #define LR (1<<2) 38 | #define LD (1<<3) 39 | #define LH (LL+LR) 40 | #define LV (LU+LD) 41 | 42 | #define DL (1<<4) 43 | #define DU (1<<5) 44 | #define DR (1<<6) 45 | #define DD (1<<7) 46 | #define DH (DL+DR) 47 | #define DV (DU+DD) 48 | 49 | #define HL (LL+DL) 50 | #define HU (LU+DU) 51 | #define HR (LR+DR) 52 | #define HD (LD+DD) 53 | #define HH (HL+HR) 54 | #define HV (HU+HD) 55 | 56 | /* (BBQ) Quadrants Top/Bottom x Left/Right */ 57 | #define TL (1<<0) 58 | #define TR (1<<1) 59 | #define BL (1<<2) 60 | #define BR (1<<3) 61 | 62 | /* Data for U+2500 - U+259F except dashes/diagonals */ 63 | static const unsigned short boxdata[256] = { 64 | /* light lines */ 65 | [0x00] = BDL + LH, /* light horizontal */ 66 | [0x02] = BDL + LV, /* light vertical */ 67 | [0x0c] = BDL + LD + LR, /* light down and right */ 68 | [0x10] = BDL + LD + LL, /* light down and left */ 69 | [0x14] = BDL + LU + LR, /* light up and right */ 70 | [0x18] = BDL + LU + LL, /* light up and left */ 71 | [0x1c] = BDL + LV + LR, /* light vertical and right */ 72 | [0x24] = BDL + LV + LL, /* light vertical and left */ 73 | [0x2c] = BDL + LH + LD, /* light horizontal and down */ 74 | [0x34] = BDL + LH + LU, /* light horizontal and up */ 75 | [0x3c] = BDL + LV + LH, /* light vertical and horizontal */ 76 | [0x74] = BDL + LL, /* light left */ 77 | [0x75] = BDL + LU, /* light up */ 78 | [0x76] = BDL + LR, /* light right */ 79 | [0x77] = BDL + LD, /* light down */ 80 | 81 | /* heavy [+light] lines */ 82 | [0x01] = BDL + HH, 83 | [0x03] = BDL + HV, 84 | [0x0d] = BDL + HR + LD, 85 | [0x0e] = BDL + HD + LR, 86 | [0x0f] = BDL + HD + HR, 87 | [0x11] = BDL + HL + LD, 88 | [0x12] = BDL + HD + LL, 89 | [0x13] = BDL + HD + HL, 90 | [0x15] = BDL + HR + LU, 91 | [0x16] = BDL + HU + LR, 92 | [0x17] = BDL + HU + HR, 93 | [0x19] = BDL + HL + LU, 94 | [0x1a] = BDL + HU + LL, 95 | [0x1b] = BDL + HU + HL, 96 | [0x1d] = BDL + HR + LV, 97 | [0x1e] = BDL + HU + LD + LR, 98 | [0x1f] = BDL + HD + LR + LU, 99 | [0x20] = BDL + HV + LR, 100 | [0x21] = BDL + HU + HR + LD, 101 | [0x22] = BDL + HD + HR + LU, 102 | [0x23] = BDL + HV + HR, 103 | [0x25] = BDL + HL + LV, 104 | [0x26] = BDL + HU + LD + LL, 105 | [0x27] = BDL + HD + LU + LL, 106 | [0x28] = BDL + HV + LL, 107 | [0x29] = BDL + HU + HL + LD, 108 | [0x2a] = BDL + HD + HL + LU, 109 | [0x2b] = BDL + HV + HL, 110 | [0x2d] = BDL + HL + LD + LR, 111 | [0x2e] = BDL + HR + LL + LD, 112 | [0x2f] = BDL + HH + LD, 113 | [0x30] = BDL + HD + LH, 114 | [0x31] = BDL + HD + HL + LR, 115 | [0x32] = BDL + HR + HD + LL, 116 | [0x33] = BDL + HH + HD, 117 | [0x35] = BDL + HL + LU + LR, 118 | [0x36] = BDL + HR + LU + LL, 119 | [0x37] = BDL + HH + LU, 120 | [0x38] = BDL + HU + LH, 121 | [0x39] = BDL + HU + HL + LR, 122 | [0x3a] = BDL + HU + HR + LL, 123 | [0x3b] = BDL + HH + HU, 124 | [0x3d] = BDL + HL + LV + LR, 125 | [0x3e] = BDL + HR + LV + LL, 126 | [0x3f] = BDL + HH + LV, 127 | [0x40] = BDL + HU + LH + LD, 128 | [0x41] = BDL + HD + LH + LU, 129 | [0x42] = BDL + HV + LH, 130 | [0x43] = BDL + HU + HL + LD + LR, 131 | [0x44] = BDL + HU + HR + LD + LL, 132 | [0x45] = BDL + HD + HL + LU + LR, 133 | [0x46] = BDL + HD + HR + LU + LL, 134 | [0x47] = BDL + HH + HU + LD, 135 | [0x48] = BDL + HH + HD + LU, 136 | [0x49] = BDL + HV + HL + LR, 137 | [0x4a] = BDL + HV + HR + LL, 138 | [0x4b] = BDL + HV + HH, 139 | [0x78] = BDL + HL, 140 | [0x79] = BDL + HU, 141 | [0x7a] = BDL + HR, 142 | [0x7b] = BDL + HD, 143 | [0x7c] = BDL + HR + LL, 144 | [0x7d] = BDL + HD + LU, 145 | [0x7e] = BDL + HL + LR, 146 | [0x7f] = BDL + HU + LD, 147 | 148 | /* double [+light] lines */ 149 | [0x50] = BDL + DH, 150 | [0x51] = BDL + DV, 151 | [0x52] = BDL + DR + LD, 152 | [0x53] = BDL + DD + LR, 153 | [0x54] = BDL + DR + DD, 154 | [0x55] = BDL + DL + LD, 155 | [0x56] = BDL + DD + LL, 156 | [0x57] = BDL + DL + DD, 157 | [0x58] = BDL + DR + LU, 158 | [0x59] = BDL + DU + LR, 159 | [0x5a] = BDL + DU + DR, 160 | [0x5b] = BDL + DL + LU, 161 | [0x5c] = BDL + DU + LL, 162 | [0x5d] = BDL + DL + DU, 163 | [0x5e] = BDL + DR + LV, 164 | [0x5f] = BDL + DV + LR, 165 | [0x60] = BDL + DV + DR, 166 | [0x61] = BDL + DL + LV, 167 | [0x62] = BDL + DV + LL, 168 | [0x63] = BDL + DV + DL, 169 | [0x64] = BDL + DH + LD, 170 | [0x65] = BDL + DD + LH, 171 | [0x66] = BDL + DD + DH, 172 | [0x67] = BDL + DH + LU, 173 | [0x68] = BDL + DU + LH, 174 | [0x69] = BDL + DH + DU, 175 | [0x6a] = BDL + DH + LV, 176 | [0x6b] = BDL + DV + LH, 177 | [0x6c] = BDL + DH + DV, 178 | 179 | /* (light) arcs */ 180 | [0x6d] = BDA + LD + LR, 181 | [0x6e] = BDA + LD + LL, 182 | [0x6f] = BDA + LU + LL, 183 | [0x70] = BDA + LU + LR, 184 | 185 | /* Lower (Down) X/8 block (data is 8 - X) */ 186 | [0x81] = BBD + 7, [0x82] = BBD + 6, [0x83] = BBD + 5, [0x84] = BBD + 4, 187 | [0x85] = BBD + 3, [0x86] = BBD + 2, [0x87] = BBD + 1, [0x88] = BBD + 0, 188 | 189 | /* Left X/8 block (data is X) */ 190 | [0x89] = BBL + 7, [0x8a] = BBL + 6, [0x8b] = BBL + 5, [0x8c] = BBL + 4, 191 | [0x8d] = BBL + 3, [0x8e] = BBL + 2, [0x8f] = BBL + 1, 192 | 193 | /* upper 1/2 (4/8), 1/8 block (X), right 1/2, 1/8 block (8-X) */ 194 | [0x80] = BBU + 4, [0x94] = BBU + 1, 195 | [0x90] = BBR + 4, [0x95] = BBR + 7, 196 | 197 | /* Quadrants */ 198 | [0x96] = BBQ + BL, 199 | [0x97] = BBQ + BR, 200 | [0x98] = BBQ + TL, 201 | [0x99] = BBQ + TL + BL + BR, 202 | [0x9a] = BBQ + TL + BR, 203 | [0x9b] = BBQ + TL + TR + BL, 204 | [0x9c] = BBQ + TL + TR + BR, 205 | [0x9d] = BBQ + TR, 206 | [0x9e] = BBQ + BL + TR, 207 | [0x9f] = BBQ + BL + TR + BR, 208 | 209 | /* Shades, data is an alpha value in 25% units (1/4, 1/2, 3/4) */ 210 | [0x91] = BBS + 1, [0x92] = BBS + 2, [0x93] = BBS + 3, 211 | 212 | /* U+2504 - U+250B, U+254C - U+254F: unsupported (dashes) */ 213 | /* U+2571 - U+2573: unsupported (diagonals) */ 214 | }; 215 | -------------------------------------------------------------------------------- /config/eww/src/yuck/bar/_widgets.yuck: -------------------------------------------------------------------------------- 1 | (defwidget launcher [] 2 | (box :class "launcher" :orientation "h" :space-evenly "false" 3 | (button :tooltip "Dashboard" :class "launcher-btn" :onclick "sh ./scripts/openSysTray.sh" "") 4 | ) 5 | ) 6 | 7 | (defwidget terminal [] 8 | (box :class "terminal" :orientation "h" :space-evenly "false" 9 | (button :tooltip "Spawn: ${terminal}" :class "terminal-btn" :onclick "notify-send 'Spawning ${terminal}' ; ${terminal} &" "") 10 | ) 11 | ) 12 | 13 | (defwidget chat [] 14 | (box :class "chat" :orientation "h" :space-evenly "false" 15 | (button :tooltip "Spawn: ${chat}" :class "chat-btn" :onclick "notify-send 'Spawning ${chat}' ; ${chat} &" "ﭮ") 16 | ) 17 | ) 18 | 19 | (defwidget browser [] 20 | (box :class "browser" :orientation "h" :space-evenly "false" 21 | (button :tooltip "Spawn: ${browser}" :class "browser-btn" :onclick "notify-send 'Spawning ${browser}' ; ${browser} &" "") 22 | ) 23 | ) 24 | 25 | (defwidget rofi [] 26 | (box :class "rofi" :orientation "h" :space-evenly "false" 27 | (button :tooltip "Launch Apps" :class "rofi-btn" :onclick "notify-send 'Spawning ${rofi}' ; ${rofi} &" "異") 28 | ) 29 | ) 30 | 31 | (defwidget workspaces [] 32 | (literal :content workspace)) 33 | (deflisten workspace "scripts/getWorkspaces") 34 | 35 | (defwidget vpn [] 36 | (literal :content vpn)) 37 | (defpoll vpn :interval "1s" "scripts/getVpn") 38 | 39 | (defwidget vpn-popup [] 40 | (box :class "vpn-popup" :orientation "h" 41 | (box :orientation "v" :valign "center" 42 | (label :class "title" :text "VPN") 43 | (label :class class :text ip) 44 | )) 45 | ) 46 | (defpoll ip :interval "1s" "scripts/getVpn get") 47 | (defpoll class :interval "1s" "scripts/getVpn get-class") 48 | 49 | (defwidget power [] 50 | (eventbox :onhover "${eww} update power=true" :onhoverlost "${eww} update power=false" 51 | (box :orientation "v" :space-evenly "false" :vexpand "false" :class "powermenu" 52 | (revealer :transition "slideup" 53 | :reveal power 54 | :duration "600ms" 55 | (box :orientation "v" :space-evenly "false" 56 | (button :class "shutdown-btn" :tooltip "Shutdown" :onclick "systemctl poweroff" ""))) 57 | (button :class "power-btn" :tooltip "Manage power" :onclick "$HOME/.local/bin/notifcntr" "")))) 58 | (defvar power false) 59 | 60 | (defwidget time [] 61 | (box :orientation "v" 62 | :class "time" 63 | :valign "end" 64 | (button :onclick "sh scripts/openCalendar.sh" 65 | :class "time-hour" hour) 66 | (button :onclick "sh scripts/openCalendar.sh" 67 | :class "time-min" minute) 68 | ) 69 | ) 70 | 71 | (defwidget separator [] 72 | (box :orientation "h" 73 | (label :class "separator" :text "———") 74 | ) 75 | ) 76 | 77 | (defwidget cal [] 78 | (box :class "cal-box" :orientation "v" 79 | (calendar :class "cal" :day calendar_day :month calendar_month :year calendar_year) 80 | ) 81 | ) 82 | 83 | (defwidget sys-tray [] 84 | (box :class "sys-tray-box" :orientation "v" 85 | (box :class "first-row" :orientation "h" 86 | (box :class "sys-tray-box-left" :orientation "v" :space-evenly "false" 87 | (box :class "network" :orientation "v" :space-evenly "false" 88 | (box :orientation "h" :space-evenly "false" 89 | (label :class "title" :text "Connected to") 90 | ) 91 | (label :class "ssid" :text "${network-name}") 92 | ) 93 | (box :class "date" :orientation "v" :space-evenly "false" 94 | (box :orientation "h" :space-evenly "false" 95 | (label :class "weekday" :text "${weekday}") 96 | ) 97 | (label :class "monthday" :text "${monthday}") 98 | ) 99 | ) 100 | (box :class "sys-tray-box-right" :orientation "v" :space-evenly "false" 101 | (box :class "ram" :orientation "h" 102 | (circular-progress :class "ram-progress" 103 | :value used_ram 104 | :thickness 6 105 | :clockwise "true" 106 | :tooltip "Used RAM: ${used_ram}%" 107 | ; :onchange "amixer -D pulse sset Master {}%" 108 | (label :class "ram-icon" :text "") 109 | ) 110 | ) 111 | ) 112 | ) 113 | (box :class "second-row" :orientation "h" 114 | (box :class "music-player" :orientation "h" :space-evenly "false" 115 | (box :class "song-art" :style "background-image: url('${art}')" :tooltip "${song_artist} - ${song_title_full}" song_art 116 | (box :class "music-info" :orientation "v" :space-evenly "false" 117 | (box :class "np" :orientation "h" :space-evenly "false" 118 | (label :class "now-playing" :text "Now Playing") 119 | ) 120 | (box :class "title" :orientation "h" :space-evenly "false" 121 | (label :class "song-title" :text song_title) 122 | ) 123 | (box :class "artist" :orientation "h" :space-evenly "false" 124 | (label :class "song-artist" :text "by ${song_artist}") 125 | ) 126 | ) 127 | ) 128 | (box :class "song-controls" :orientation "v" 129 | (button :onclick "playerctl next" "") 130 | (button :class "play-pause" :onclick "playerctl play-pause" player_status) 131 | (button :onclick "playerctl previous" "") 132 | ) 133 | ) 134 | ) 135 | (box :class "third-row" :orientation "h" :space-evenly "false" 136 | (box :class "system-info" :orientation "v" :space-evenly "false" 137 | (box :class "volume" :orientation "h" :space-evenly "false" 138 | (label :class "volume-icon" :text "") 139 | (scale :min 0 140 | :max 101 141 | :value volume 142 | :orientation "h" 143 | :tooltip "Volume: ${volume}%" 144 | :onchange "amixer -D pulse sset Master {}%" 145 | :class "volbar" 146 | ) 147 | ) 148 | (box :class "brightness" :orientation "h" :space-evenly "false" 149 | (label :class "brightness-icon" :text "") 150 | (scale :min 0 151 | :max 101 152 | :value brightness 153 | :orientation "h" 154 | :tooltip "Brightness: ${brightness}%" 155 | :onchange "brightnessctl set {}%" 156 | :class "bribar" 157 | ) 158 | ) 159 | (box :class "mic" :orientation "h" :space-evenly "false" 160 | (label :class "mic-icon" :text "") 161 | (scale :min 0 162 | :max 101 163 | :value micro 164 | :orientation "h" 165 | :tooltip "Microphone Volume: ${micro}%" 166 | :onchange "amixer -D pulse sset Capture {}%" 167 | :class "micbar" 168 | ) 169 | ) 170 | ) 171 | ) 172 | ) 173 | ) 174 | 175 | ;; BAR IS SEPARATED INTO THREE PARTS: TOP, CENTER AND BOTTOM 176 | ;; TOP WIDGETS 177 | (defwidget top [] 178 | (box :class "top" :orientation "v" :space-evenly "false" :valign "start" 179 | (launcher) 180 | (browser) 181 | (terminal) 182 | (chat) 183 | (rofi))) 184 | 185 | ;; CENTER WIDGETS 186 | (defwidget center [] 187 | (box :orientation "v" :space-evenly "false" :valign "center" 188 | (workspaces))) 189 | 190 | ;; BOTTOM WIDGETS 191 | (defwidget bottom [] 192 | (box :orientation "v" :space-evenly "false" :valign "end" 193 | (vpn) 194 | (separator) 195 | (time) 196 | (separator) 197 | (power))) 198 | 199 | (defwidget bar [] 200 | (box :class "eww-bar" :orientation "v" :valign "false" :halign "false" 201 | (top) 202 | (center) 203 | (bottom))) 204 | -------------------------------------------------------------------------------- /config/dwm/src/config.def.h.orig: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | /* appearance */ 4 | static const unsigned int borderpx = 0; /* border pixel of windows */ 5 | static const unsigned int gappx = 8; /* gaps between windows */ 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const int scalepreview = 4; /* tag preview scaling */ 8 | static const int showbar = 1; /* 0 means no bar */ 9 | static const int topbar = 1; /* 0 means bottom bar */ 10 | static const int vertpad = 9; /* vertical padding of bar */ 11 | static const int sidepad = 9; /* horizontal padding of bar */ 12 | static const int user_bh = 33; 13 | static const int horizpadbar = 10; 14 | static const int vertpadbar = 10; 15 | static const char *fonts[] = { "JetBrainsMono Nerd Font:size=9" }; 16 | static const char dmenufont[] = "JetBrainsMono Nerd Font:size=9"; 17 | static const char col_gray1[] = "#171B20"; 18 | static const char col_gray2[] = "#1a1e24"; 19 | static const char col_gray3[] = "#485263"; 20 | static const char col_gray4[] = "#1a1e24"; 21 | static const char col_cyan[] = "#78DBA9"; 22 | static const char col_borderbar[] = "#171B20"; 23 | static const char *colors[][3] = { 24 | /* fg bg border */ 25 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 26 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 27 | }; 28 | 29 | /* tagging */ 30 | static const char *tags[] = { "", "亂", "", "", "", "ﭮ" }; 31 | 32 | static const unsigned int ulinepad = 4; /* horizontal padding between the underline and tag */ 33 | static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ 34 | static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ 35 | static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ 36 | 37 | static const char *tagsel[][2] = { 38 | { "#f1cf8a", "#171B20" }, 39 | { "#78DBA9", "#171B20" }, 40 | { "#7ddac5", "#171B20" }, 41 | { "#c68aee", "#171B20" }, 42 | { "#e05f65", "#171B20" }, 43 | { "#70a5eb", "#171B20" }, 44 | }; 45 | 46 | /* launcher commands (They must be NULL terminated) */ 47 | static const char* apps[] = { "rofi", "-show", "drun", NULL }; 48 | static const char* dashboard[] = { "eww", "open", "--toggle", "system-tray", NULL }; 49 | 50 | static const Launcher launchers[] = { 51 | /* command name to display */ 52 | { dashboard, "舘" }, 53 | { apps, "異" }, 54 | }; 55 | 56 | static const Rule rules[] = { 57 | /* xprop(1): 58 | * WM_CLASS(STRING) = instance, class 59 | * WM_NAME(STRING) = title 60 | */ 61 | /* class instance title tags mask isfloating monitor */ 62 | { "Gimp", NULL, NULL, 0, 1, -1 }, 63 | }; 64 | 65 | /* layout(s) */ 66 | static const float mfact = 0.52; /* factor of master area size [0.05..0.95] */ 67 | static const int nmaster = 1; /* number of clients in master area */ 68 | static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 69 | static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 70 | 71 | static const Layout layouts[] = { 72 | /* symbol arrange function */ 73 | { "[]=", tile }, 74 | { "><>", NULL }, 75 | }; 76 | 77 | /* key definitions */ 78 | #define MODKEY Mod4Mask 79 | #define TAGKEYS(KEY,TAG) \ 80 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 81 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 82 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 83 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 84 | 85 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 86 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 87 | 88 | /* commands */ 89 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 90 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 91 | static const char *roficmd[] = { "rofi", "-show", "drun", NULL }; 92 | static const char *termcmd[] = { "st", NULL }; 93 | static const char *browsercmd[] = { "firefox", NULL }; 94 | static const char *dashboardcmd[] = { "eww", "open", "--toggle", "system-tray", NULL }; 95 | static const char *xcolorpick[] = { "/home/gabriel/.local/bin/xcolor-pick", NULL }; 96 | 97 | static Key keys[] = { 98 | /* modifier key function argument */ 99 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = roficmd } }, 100 | { MODKEY|ControlMask|ShiftMask, XK_Return, spawn, {.v = dashboardcmd } }, 101 | { MODKEY, XK_Return, spawn, {.v = termcmd } }, 102 | { MODKEY, XK_b, spawn, {.v = browsercmd } }, 103 | { MODKEY, XK_x, spawn, {.v = xcolorpick } }, 104 | 105 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 106 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 107 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 108 | { MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } }, 109 | { MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} }, 110 | { MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} }, 111 | { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } }, 112 | { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } }, 113 | 114 | { MODKEY, XK_Return, zoom, {0} }, 115 | { MODKEY, XK_Tab, setlayout, {0} }, 116 | { MODKEY, XK_w, killclient, {0} }, 117 | { MODKEY, XK_m, setlayout, {.v = &layouts[0]} }, 118 | { MODKEY, XK_t, setlayout, {.v = &layouts[1]} }, 119 | { MODKEY, XK_space, togglefloating, {0} }, 120 | { MODKEY, XK_0, view, {.ui = ~0 } }, 121 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 122 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 123 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 124 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 125 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 126 | { MODKEY, XK_minus, setgaps, {.i = -1 } }, 127 | { MODKEY, XK_equal, setgaps, {.i = +1 } }, 128 | { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 129 | TAGKEYS( XK_1, 0) 130 | TAGKEYS( XK_2, 1) 131 | TAGKEYS( XK_3, 2) 132 | TAGKEYS( XK_4, 3) 133 | TAGKEYS( XK_5, 4) 134 | TAGKEYS( XK_6, 5) 135 | { MODKEY|ShiftMask, XK_q, quit, {0} }, 136 | { MODKEY|ShiftMask, XK_r, quit, {1} }, 137 | }; 138 | 139 | /* button definitions */ 140 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 141 | static Button buttons[] = { 142 | /* click event mask button function argument */ 143 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 144 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 145 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 146 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 147 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 148 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 149 | { ClkTagBar, 0, Button1, view, {0} }, 150 | { ClkTagBar, 0, Button3, toggleview, {0} }, 151 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 152 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 153 | }; 154 | 155 | -------------------------------------------------------------------------------- /config/fish/functions/nvm.fish: -------------------------------------------------------------------------------- 1 | function nvm --argument-names cmd v --description "Node version manager" 2 | if test -z "$v" && contains -- "$cmd" install use 3 | for file in .nvmrc .node-version 4 | set file (_nvm_find_up $PWD $file) && read v <$file && break 5 | end 6 | if test -z "$v" 7 | echo "nvm: Invalid version or missing \".nvmrc\" file" >&2 8 | return 1 9 | end 10 | end 11 | 12 | set --local their_version $v 13 | 14 | switch "$cmd" 15 | case -v --version 16 | echo "nvm, version 2.2.7" 17 | case "" -h --help 18 | echo "Usage: nvm install Download and activate the specified Node version" 19 | echo " nvm install Install version from nearest .nvmrc file" 20 | echo " nvm use Activate a version in the current shell" 21 | echo " nvm use Activate version from nearest .nvmrc file" 22 | echo " nvm list List installed versions" 23 | echo " nvm list-remote List versions available to install" 24 | echo " nvm list-remote List versions matching a given regular expression" 25 | echo " nvm current Print the currently-active version" 26 | echo " nvm uninstall Uninstall a version" 27 | echo "Options:" 28 | echo " -v or --version Print version" 29 | echo " -h or --help Print this help message" 30 | echo "Variables:" 31 | echo " nvm_arch Override architecture, e.g. x64-musl" 32 | echo " nvm_mirror Set the Node download mirror" 33 | echo " nvm_default_version Set the default version for new shells" 34 | case install 35 | _nvm_index_update $nvm_mirror $nvm_data/.index || return 36 | 37 | string match --entire --regex -- (_nvm_version_match $v) <$nvm_data/.index | read v alias 38 | 39 | if ! set --query v[1] 40 | echo "nvm: Invalid version number or alias: \"$their_version\"" >&2 41 | return 1 42 | end 43 | 44 | if test ! -e $nvm_data/$v 45 | set --local os (command uname -s | string lower) 46 | set --local ext tar.gz 47 | set --local arch (command uname -m) 48 | 49 | switch $os 50 | case aix 51 | set arch ppc64 52 | case sunos 53 | case linux 54 | case darwin 55 | case {MSYS_NT,MINGW\*_NT}\* 56 | set os win 57 | set ext zip 58 | case \* 59 | echo "nvm: Unsupported operating system: \"$os\"" >&2 60 | return 1 61 | end 62 | 63 | switch $arch 64 | case i\*86 65 | set arch x86 66 | case x86_64 67 | set arch x64 68 | case arm64 69 | string match --regex --quiet "v(?\d+)" $v 70 | if test "$os" = darwin -a $major -lt 16 71 | set arch x64 72 | end 73 | case armv6 armv6l 74 | set arch armv6l 75 | case armv7 armv7l 76 | set arch armv7l 77 | case armv8 armv8l aarch64 78 | set arch arm64 79 | end 80 | 81 | set --query nvm_arch && set arch $nvm_arch 82 | 83 | set --local dir "node-$v-$os-$arch" 84 | set --local url $nvm_mirror/$v/$dir.$ext 85 | 86 | command mkdir -p $nvm_data/$v 87 | 88 | echo -e "Installing Node \x1b[1m$v\x1b[22m $alias" 89 | echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m" 90 | 91 | if ! command curl --progress-bar --location $url \ 92 | | command tar --extract --gzip --directory $nvm_data/$v 2>/dev/null 93 | command rm -rf $nvm_data/$v 94 | echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2 95 | return 1 96 | end 97 | 98 | echo -en "\033[F\33[2K\x1b[0m" 99 | 100 | if test "$os" = win 101 | command mv $nvm_data/$v/$dir $nvm_data/$v/bin 102 | else 103 | command mv $nvm_data/$v/$dir/* $nvm_data/$v 104 | command rm -rf $nvm_data/$v/$dir 105 | end 106 | end 107 | 108 | if test $v != "$nvm_current_version" 109 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 110 | _nvm_version_activate $v 111 | end 112 | 113 | printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) 114 | case use 115 | test $v = default && set v $nvm_default_version 116 | _nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __ 117 | 118 | if ! set --query v[1] 119 | echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2 120 | return 1 121 | end 122 | 123 | if test $v != "$nvm_current_version" 124 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 125 | test $v != system && _nvm_version_activate $v 126 | end 127 | 128 | printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) 129 | case uninstall 130 | if test -z "$v" 131 | echo "nvm: Not enough arguments for command: \"$cmd\"" >&2 132 | return 1 133 | end 134 | 135 | test $v = default && test ! -z "$nvm_default_version" && set v $nvm_default_version 136 | 137 | _nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __ 138 | 139 | if ! set -q v[1] 140 | echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2 141 | return 1 142 | end 143 | 144 | printf "Uninstalling Node %s %s\n" $v (string replace ~ \~ "$nvm_data/$v/bin/node") 145 | 146 | _nvm_version_deactivate $v 147 | 148 | command rm -rf $nvm_data/$v 149 | case current 150 | _nvm_current 151 | case ls list 152 | _nvm_list | _nvm_list_format (_nvm_current) $argv[2] 153 | case lsr {ls,list}-remote 154 | _nvm_index_update $nvm_mirror $nvm_data/.index || return 155 | _nvm_list | command awk ' 156 | FILENAME == "-" && (is_local[$1] = FNR == NR) { next } { 157 | print $0 (is_local[$1] ? " ✓" : "") 158 | } 159 | ' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2] 160 | case \* 161 | echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h)" >&2 162 | return 1 163 | end 164 | end 165 | 166 | function _nvm_find_up --argument-names path file 167 | test -e "$path/$file" && echo $path/$file || begin 168 | test "$path" != / || return 169 | _nvm_find_up (command dirname $path) $file 170 | end 171 | end 172 | 173 | function _nvm_version_match --argument-names v 174 | string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $v | 175 | string replace --filter --regex -- '^v?(\d+)' 'v$1' | 176 | string escape --style=regex || 177 | string lower '\b'$v'(?:/\w+)?$' 178 | end 179 | 180 | function _nvm_list_format --argument-names current regex 181 | command awk -v current="$current" -v regex="$regex" ' 182 | $0 ~ regex { 183 | aliases[versions[i++] = $1] = $2 " " $3 184 | pad = (n = length($1)) > pad ? n : pad 185 | } 186 | END { 187 | if (!i) exit 1 188 | while (i--) 189 | printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n", 190 | versions[i], aliases[versions[i]]) 191 | } 192 | ' 193 | end 194 | 195 | function _nvm_current 196 | command --search --quiet node || return 197 | set --query nvm_current_version && echo $nvm_current_version || echo system 198 | end 199 | 200 | function _nvm_node_info 201 | set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm))) 202 | test -f $npm_path/package.json || set --local npm_version_default (command npm --version) 203 | command node --eval " 204 | console.log(process.version) 205 | console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version) 206 | console.log(process.execPath.replace(require('os').homedir(), '~')) 207 | " 208 | end 209 | -------------------------------------------------------------------------------- /config/dwm/src/config.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | /* appearance */ 4 | static const unsigned int borderpx = 0; /* border pixel of windows */ 5 | static const unsigned int gappx = 12; /* gaps between windows */ 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const unsigned int colorfultitle = 0; 8 | static const unsigned int colorfultag = 1; 9 | static const int scalepreview = 4; /* tag preview scaling */ 10 | static const int showbar = 1; /* 0 means no bar */ 11 | static const int topbar = 1; /* 0 means bottom bar */ 12 | static const int vertpad = 13; /* vertical padding of bar */ 13 | static const int sidepad = 13; /* horizontal padding of bar */ 14 | static const int user_bh = 33; 15 | static const int horizpadbar = 10; 16 | static const int vertpadbar = 9; 17 | static const char *fonts[] = { "Iosevka Nerd Font:size=10" }; 18 | static const char dmenufont[] = "Iosevka Nerd Font:size=10"; 19 | static const char col_gray1[] = "#101419"; 20 | static const char col_gray2[] = "#15191e"; 21 | static const char col_gray3[] = "#485263"; 22 | static const char col_gray4[] = "#15191e"; 23 | static const char col_yellow[] = "#f1cf8a"; 24 | static const char col_green[] = "#76b97f"; 25 | static const char col_teal[] = "#70a5eb"; 26 | static const char col_magenta[] = "#c68aee"; 27 | static const char col_red[] = "#e05f65"; 28 | static const char col_blue[] = "#70a5eb"; 29 | static const char col_cyan[] = "#74bee9"; 30 | static const char col_borderbar[] = "#101419"; 31 | static const char *colors[][3] = { 32 | /* fg bg border */ 33 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 34 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 35 | [SchemeTag] = { col_gray3, col_gray1, col_gray1 }, 36 | [SchemeTag1] = { col_yellow, col_gray1, col_gray1 }, 37 | [SchemeTag2] = { col_green, col_gray1, col_gray1 }, 38 | [SchemeTag3] = { col_cyan, col_gray1, col_gray1 }, 39 | [SchemeTag4] = { col_magenta, col_gray1, col_gray1 }, 40 | [SchemeTag5] = { col_red, col_gray1, col_gray1 }, 41 | [SchemeTag6] = { col_blue, col_gray1, col_gray1 }, 42 | [SchemeLayout] = { col_green, col_gray1, col_gray1 }, 43 | [SchemeLaunchers] = { col_blue, col_gray1, col_gray1 }, 44 | }; 45 | 46 | static const int tagschemes[] = { SchemeTag1, SchemeTag2, SchemeTag3, 47 | SchemeTag4, SchemeTag5, SchemeTag6, 48 | SchemeTag7, SchemeTag8, SchemeTag9 }; 49 | 50 | /* tagging */ 51 | static const char *tags[] = { "", "亂", "", "", "", "ﭮ" }; 52 | 53 | static const unsigned int ulinepad = 4; /* horizontal padding between the underline and tag */ 54 | static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ 55 | static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ 56 | static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ 57 | 58 | /* launcher commands (They must be NULL terminated) */ 59 | static const char* apps[] = { "rofi", "-show", "drun", NULL }; 60 | static const char* dashboard[] = { "eww", "open", "--toggle", "system-tray", NULL }; 61 | 62 | static const Launcher launchers[] = { 63 | /* command name to display */ 64 | { dashboard, "舘" }, 65 | { apps, "異" }, 66 | }; 67 | 68 | static const Rule rules[] = { 69 | /* xprop(1): 70 | * WM_CLASS(STRING) = instance, class 71 | * WM_NAME(STRING) = title 72 | */ 73 | /* class instance title tags mask isfloating monitor */ 74 | { "Gimp", NULL, NULL, 0, 1, -1 }, 75 | }; 76 | 77 | /* layout(s) */ 78 | static const float mfact = 0.52; /* factor of master area size [0.05..0.95] */ 79 | static const int nmaster = 1; /* number of clients in master area */ 80 | static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 81 | static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 82 | 83 | static const Layout layouts[] = { 84 | /* symbol arrange function */ 85 | { "[]=", tile }, 86 | { "><>", NULL }, 87 | }; 88 | 89 | /* key definitions */ 90 | #define MODKEY Mod4Mask 91 | #define TAGKEYS(KEY,TAG) \ 92 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 93 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 94 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 95 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 96 | 97 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 98 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 99 | 100 | /* commands */ 101 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 102 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 103 | static const char *roficmd[] = { "rofi", "-show", "drun", NULL }; 104 | static const char *termcmd[] = { "st", NULL }; 105 | static const char *browsercmd[] = { "firefox", NULL }; 106 | static const char *dashboardcmd[] = { "eww", "open", "--toggle", "system-tray", NULL }; 107 | static const char *xcolorpick[] = { "/home/gabriel/.local/bin/xcolor-pick", NULL }; 108 | 109 | static Key keys[] = { 110 | /* modifier key function argument */ 111 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = roficmd } }, 112 | { MODKEY|ControlMask|ShiftMask, XK_Return, spawn, {.v = dashboardcmd } }, 113 | { MODKEY, XK_Return, spawn, {.v = termcmd } }, 114 | { MODKEY, XK_b, spawn, {.v = browsercmd } }, 115 | { MODKEY, XK_x, spawn, {.v = xcolorpick } }, 116 | 117 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 118 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 119 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 120 | { MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } }, 121 | { MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} }, 122 | { MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} }, 123 | { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } }, 124 | { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } }, 125 | 126 | { MODKEY, XK_Return, zoom, {0} }, 127 | { MODKEY, XK_Tab, setlayout, {0} }, 128 | { MODKEY, XK_w, killclient, {0} }, 129 | { MODKEY, XK_m, setlayout, {.v = &layouts[0]} }, 130 | { MODKEY, XK_t, setlayout, {.v = &layouts[1]} }, 131 | { MODKEY, XK_space, togglefloating, {0} }, 132 | { MODKEY, XK_0, view, {.ui = ~0 } }, 133 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 134 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 135 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 136 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 137 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 138 | { MODKEY, XK_minus, setgaps, {.i = -1 } }, 139 | { MODKEY, XK_equal, setgaps, {.i = +1 } }, 140 | { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 141 | TAGKEYS( XK_1, 0) 142 | TAGKEYS( XK_2, 1) 143 | TAGKEYS( XK_3, 2) 144 | TAGKEYS( XK_4, 3) 145 | TAGKEYS( XK_5, 4) 146 | TAGKEYS( XK_6, 5) 147 | { MODKEY|ShiftMask, XK_q, quit, {0} }, 148 | { MODKEY|ShiftMask, XK_r, quit, {1} }, 149 | }; 150 | 151 | /* button definitions */ 152 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 153 | static Button buttons[] = { 154 | /* click event mask button function argument */ 155 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 156 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 157 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 158 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 159 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 160 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 161 | { ClkTagBar, 0, Button1, view, {0} }, 162 | { ClkTagBar, 0, Button3, toggleview, {0} }, 163 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 164 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 165 | }; 166 | 167 | -------------------------------------------------------------------------------- /config/dwm/src/config.def.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | /* appearance */ 4 | static const unsigned int borderpx = 0; /* border pixel of windows */ 5 | static const unsigned int gappx = 12; /* gaps between windows */ 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const unsigned int colorfultitle = 0; 8 | static const unsigned int colorfultag = 1; 9 | static const int scalepreview = 4; /* tag preview scaling */ 10 | static const int showbar = 1; /* 0 means no bar */ 11 | static const int topbar = 1; /* 0 means bottom bar */ 12 | static const int vertpad = 13; /* vertical padding of bar */ 13 | static const int sidepad = 13; /* horizontal padding of bar */ 14 | static const int user_bh = 33; 15 | static const int horizpadbar = 10; 16 | static const int vertpadbar = 9; 17 | static const char *fonts[] = { "Iosevka Nerd Font:size=10" }; 18 | static const char dmenufont[] = "Iosevka Nerd Font:size=10"; 19 | static const char col_gray1[] = "#101419"; 20 | static const char col_gray2[] = "#15191e"; 21 | static const char col_gray3[] = "#485263"; 22 | static const char col_gray4[] = "#15191e"; 23 | static const char col_yellow[] = "#f1cf8a"; 24 | static const char col_green[] = "#76b97f"; 25 | static const char col_teal[] = "#70a5eb"; 26 | static const char col_magenta[] = "#c68aee"; 27 | static const char col_red[] = "#e05f65"; 28 | static const char col_blue[] = "#70a5eb"; 29 | static const char col_cyan[] = "#74bee9"; 30 | static const char col_borderbar[] = "#101419"; 31 | static const char *colors[][3] = { 32 | /* fg bg border */ 33 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 34 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 35 | [SchemeTag] = { col_gray3, col_gray1, col_gray1 }, 36 | [SchemeTag1] = { col_yellow, col_gray1, col_gray1 }, 37 | [SchemeTag2] = { col_green, col_gray1, col_gray1 }, 38 | [SchemeTag3] = { col_cyan, col_gray1, col_gray1 }, 39 | [SchemeTag4] = { col_magenta, col_gray1, col_gray1 }, 40 | [SchemeTag5] = { col_red, col_gray1, col_gray1 }, 41 | [SchemeTag6] = { col_blue, col_gray1, col_gray1 }, 42 | [SchemeLayout] = { col_green, col_gray1, col_gray1 }, 43 | [SchemeLaunchers] = { col_blue, col_gray1, col_gray1 }, 44 | }; 45 | 46 | static const int tagschemes[] = { SchemeTag1, SchemeTag2, SchemeTag3, 47 | SchemeTag4, SchemeTag5, SchemeTag6, 48 | SchemeTag7, SchemeTag8, SchemeTag9 }; 49 | 50 | /* tagging */ 51 | static const char *tags[] = { "", "亂", "", "", "", "ﭮ" }; 52 | 53 | static const unsigned int ulinepad = 4; /* horizontal padding between the underline and tag */ 54 | static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ 55 | static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ 56 | static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ 57 | 58 | /* launcher commands (They must be NULL terminated) */ 59 | static const char* apps[] = { "rofi", "-show", "drun", NULL }; 60 | static const char* dashboard[] = { "eww", "open", "--toggle", "system-tray", NULL }; 61 | 62 | static const Launcher launchers[] = { 63 | /* command name to display */ 64 | { dashboard, "舘" }, 65 | { apps, "異" }, 66 | }; 67 | 68 | static const Rule rules[] = { 69 | /* xprop(1): 70 | * WM_CLASS(STRING) = instance, class 71 | * WM_NAME(STRING) = title 72 | */ 73 | /* class instance title tags mask isfloating monitor */ 74 | { "Gimp", NULL, NULL, 0, 1, -1 }, 75 | }; 76 | 77 | /* layout(s) */ 78 | static const float mfact = 0.52; /* factor of master area size [0.05..0.95] */ 79 | static const int nmaster = 1; /* number of clients in master area */ 80 | static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 81 | static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 82 | 83 | static const Layout layouts[] = { 84 | /* symbol arrange function */ 85 | { "[]=", tile }, 86 | { "><>", NULL }, 87 | }; 88 | 89 | /* key definitions */ 90 | #define MODKEY Mod4Mask 91 | #define TAGKEYS(KEY,TAG) \ 92 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 93 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 94 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 95 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 96 | 97 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 98 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 99 | 100 | /* commands */ 101 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 102 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 103 | static const char *roficmd[] = { "rofi", "-show", "drun", NULL }; 104 | static const char *termcmd[] = { "st", NULL }; 105 | static const char *browsercmd[] = { "firefox", NULL }; 106 | static const char *dashboardcmd[] = { "eww", "open", "--toggle", "system-tray", NULL }; 107 | static const char *xcolorpick[] = { "/home/gabriel/.local/bin/xcolor-pick", NULL }; 108 | 109 | static Key keys[] = { 110 | /* modifier key function argument */ 111 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = roficmd } }, 112 | { MODKEY|ControlMask|ShiftMask, XK_Return, spawn, {.v = dashboardcmd } }, 113 | { MODKEY, XK_Return, spawn, {.v = termcmd } }, 114 | { MODKEY, XK_b, spawn, {.v = browsercmd } }, 115 | { MODKEY, XK_x, spawn, {.v = xcolorpick } }, 116 | 117 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 118 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 119 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 120 | { MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } }, 121 | { MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} }, 122 | { MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} }, 123 | { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } }, 124 | { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } }, 125 | 126 | { MODKEY, XK_Return, zoom, {0} }, 127 | { MODKEY, XK_Tab, setlayout, {0} }, 128 | { MODKEY, XK_w, killclient, {0} }, 129 | { MODKEY, XK_m, setlayout, {.v = &layouts[0]} }, 130 | { MODKEY, XK_t, setlayout, {.v = &layouts[1]} }, 131 | { MODKEY, XK_space, togglefloating, {0} }, 132 | { MODKEY, XK_0, view, {.ui = ~0 } }, 133 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 134 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 135 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 136 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 137 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 138 | { MODKEY, XK_minus, setgaps, {.i = -1 } }, 139 | { MODKEY, XK_equal, setgaps, {.i = +1 } }, 140 | { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 141 | TAGKEYS( XK_1, 0) 142 | TAGKEYS( XK_2, 1) 143 | TAGKEYS( XK_3, 2) 144 | TAGKEYS( XK_4, 3) 145 | TAGKEYS( XK_5, 4) 146 | TAGKEYS( XK_6, 5) 147 | { MODKEY|ShiftMask, XK_q, quit, {0} }, 148 | { MODKEY|ShiftMask, XK_r, quit, {1} }, 149 | }; 150 | 151 | /* button definitions */ 152 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 153 | static Button buttons[] = { 154 | /* click event mask button function argument */ 155 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 156 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 157 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 158 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 159 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 160 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 161 | { ClkTagBar, 0, Button1, view, {0} }, 162 | { ClkTagBar, 0, Button3, toggleview, {0} }, 163 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 164 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 165 | }; 166 | 167 | -------------------------------------------------------------------------------- /config/fish/functions/fisher.fish: -------------------------------------------------------------------------------- 1 | function fisher --argument-names cmd --description "A plugin manager for Fish" 2 | set --query fisher_path || set --local fisher_path $__fish_config_dir 3 | set --local fisher_version 4.3.1 4 | set --local fish_plugins $__fish_config_dir/fish_plugins 5 | 6 | switch "$cmd" 7 | case -v --version 8 | echo "fisher, version $fisher_version" 9 | case "" -h --help 10 | echo "Usage: fisher install Install plugins" 11 | echo " fisher remove Remove installed plugins" 12 | echo " fisher update Update installed plugins" 13 | echo " fisher update Update all installed plugins" 14 | echo " fisher list [] List installed plugins matching regex" 15 | echo "Options:" 16 | echo " -v or --version Print version" 17 | echo " -h or --help Print this help message" 18 | echo "Variables:" 19 | echo " \$fisher_path Plugin installation path. Default: ~/.config/fish" 20 | case ls list 21 | string match --entire --regex -- "$argv[2]" $_fisher_plugins 22 | case install update remove 23 | isatty || read --local --null --array stdin && set --append argv $stdin 24 | 25 | set --local install_plugins 26 | set --local update_plugins 27 | set --local remove_plugins 28 | set --local arg_plugins $argv[2..-1] 29 | set --local old_plugins $_fisher_plugins 30 | set --local new_plugins 31 | 32 | if ! set --query argv[2] 33 | if test "$cmd" != update 34 | echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 35 | else if test ! -e $fish_plugins 36 | echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 37 | end 38 | set arg_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) 39 | end 40 | 41 | for plugin in $arg_plugins 42 | test -e "$plugin" && set plugin (realpath $plugin) 43 | contains -- "$plugin" $new_plugins || set --append new_plugins $plugin 44 | end 45 | 46 | if set --query argv[2] 47 | for plugin in $new_plugins 48 | if contains -- "$plugin" $old_plugins 49 | test "$cmd" = remove && 50 | set --append remove_plugins $plugin || 51 | set --append update_plugins $plugin 52 | else if test "$cmd" = install 53 | set --append install_plugins $plugin 54 | else 55 | echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 56 | end 57 | end 58 | else 59 | for plugin in $new_plugins 60 | contains -- "$plugin" $old_plugins && 61 | set --append update_plugins $plugin || 62 | set --append install_plugins $plugin 63 | end 64 | 65 | for plugin in $old_plugins 66 | contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin 67 | end 68 | end 69 | 70 | set --local pid_list 71 | set --local source_plugins 72 | set --local fetch_plugins $update_plugins $install_plugins 73 | echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) 74 | 75 | for plugin in $fetch_plugins 76 | set --local source (command mktemp -d) 77 | set --append source_plugins $source 78 | 79 | command mkdir -p $source/{completions,conf.d,functions} 80 | 81 | fish --command " 82 | if test -e $plugin 83 | command cp -Rf $plugin/* $source 84 | else 85 | set temp (command mktemp -d) 86 | set name (string split \@ $plugin) || set name[2] HEAD 87 | set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2] 88 | 89 | echo Fetching (set_color --underline)\$url(set_color normal) 90 | 91 | if curl --silent \$url | tar -xzC \$temp -f - 2>/dev/null 92 | command cp -Rf \$temp/*/* $source 93 | else 94 | echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 95 | command rm -rf $source 96 | end 97 | command rm -rf \$temp 98 | end 99 | 100 | set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files 101 | " & 102 | 103 | set --append pid_list (jobs --last --pid) 104 | end 105 | 106 | wait $pid_list 2>/dev/null 107 | 108 | for plugin in $fetch_plugins 109 | if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source 110 | if set --local index (contains --index -- "$plugin" $install_plugins) 111 | set --erase install_plugins[$index] 112 | else 113 | set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] 114 | end 115 | end 116 | end 117 | 118 | for plugin in $update_plugins $remove_plugins 119 | if set --local index (contains --index -- "$plugin" $_fisher_plugins) 120 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 121 | 122 | if contains -- "$plugin" $remove_plugins 123 | for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) 124 | emit {$name}_uninstall 125 | end 126 | printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var 127 | end 128 | 129 | command rm -rf $$plugin_files_var 130 | functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) 131 | 132 | for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) 133 | complete --erase --command $name 134 | end 135 | 136 | set --erase _fisher_plugins[$index] 137 | set --erase $plugin_files_var 138 | end 139 | end 140 | 141 | if set --query update_plugins[1] || set --query install_plugins[1] 142 | command mkdir -p $fisher_path/{functions,conf.d,completions} 143 | end 144 | 145 | for plugin in $update_plugins $install_plugins 146 | set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] 147 | set --local files $source/{functions,conf.d,completions}/* 148 | 149 | if set --local index (contains --index -- $plugin $install_plugins) 150 | set --local user_files $fisher_path/{functions,conf.d,completions}/* 151 | set --local conflict_files 152 | 153 | for file in (string replace -- $source/ $fisher_path/ $files) 154 | contains -- $file $user_files && set --append conflict_files $file 155 | end 156 | 157 | if set --query conflict_files[1] && set --erase install_plugins[$index] 158 | echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 159 | continue 160 | end 161 | end 162 | 163 | for file in (string replace -- $source/ "" $files) 164 | command cp -Rf $source/$file $fisher_path/$file 165 | end 166 | 167 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 168 | set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files) 169 | 170 | contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin 171 | contains -- $plugin $install_plugins && set --local event install || set --local event update 172 | 173 | printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var 174 | 175 | for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var) 176 | source $file 177 | if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) 178 | emit {$name}_$event 179 | end 180 | end 181 | end 182 | 183 | command rm -rf $source_plugins 184 | 185 | set --query _fisher_plugins[1] || set --erase _fisher_plugins 186 | set --query _fisher_plugins && 187 | printf "%s\n" $_fisher_plugins >$fish_plugins || 188 | command rm -f $fish_plugins 189 | 190 | set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) 191 | test "$total" != "0 0 0" && echo (string join ", " ( 192 | test $total[1] = 0 || echo "Installed $total[1]") ( 193 | test $total[2] = 0 || echo "Updated $total[2]") ( 194 | test $total[3] = 0 || echo "Removed $total[3]") 195 | ) plugin/s 196 | case \* 197 | echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 198 | end 199 | end 200 | 201 | ## Migrations ## 202 | function _fisher_fish_postexec --on-event fish_postexec 203 | if functions --query _fisher_list 204 | fisher update >/dev/null 2>/dev/null 205 | set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share 206 | test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher 207 | functions --erase _fisher_list _fisher_plugin_parse 208 | set --erase fisher_data 209 | end 210 | functions --erase _fisher_fish_postexec 211 | end 212 | -------------------------------------------------------------------------------- /config/dwm/src/drw.c.orig: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "drw.h" 9 | #include "util.h" 10 | 11 | #define UTF_INVALID 0xFFFD 12 | #define UTF_SIZ 4 13 | 14 | static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; 15 | static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; 16 | static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; 17 | static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; 18 | 19 | static long 20 | utf8decodebyte(const char c, size_t *i) 21 | { 22 | for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) 23 | if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) 24 | return (unsigned char)c & ~utfmask[*i]; 25 | return 0; 26 | } 27 | 28 | static size_t 29 | utf8validate(long *u, size_t i) 30 | { 31 | if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) 32 | *u = UTF_INVALID; 33 | for (i = 1; *u > utfmax[i]; ++i) 34 | ; 35 | return i; 36 | } 37 | 38 | static size_t 39 | utf8decode(const char *c, long *u, size_t clen) 40 | { 41 | size_t i, j, len, type; 42 | long udecoded; 43 | 44 | *u = UTF_INVALID; 45 | if (!clen) 46 | return 0; 47 | udecoded = utf8decodebyte(c[0], &len); 48 | if (!BETWEEN(len, 1, UTF_SIZ)) 49 | return 1; 50 | for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { 51 | udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); 52 | if (type) 53 | return j; 54 | } 55 | if (j < len) 56 | return 0; 57 | *u = udecoded; 58 | utf8validate(u, len); 59 | 60 | return len; 61 | } 62 | 63 | Drw * 64 | drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) 65 | { 66 | Drw *drw = ecalloc(1, sizeof(Drw)); 67 | 68 | drw->dpy = dpy; 69 | drw->screen = screen; 70 | drw->root = root; 71 | drw->w = w; 72 | drw->h = h; 73 | drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); 74 | drw->gc = XCreateGC(dpy, root, 0, NULL); 75 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); 76 | 77 | return drw; 78 | } 79 | 80 | void 81 | drw_resize(Drw *drw, unsigned int w, unsigned int h) 82 | { 83 | if (!drw) 84 | return; 85 | 86 | drw->w = w; 87 | drw->h = h; 88 | if (drw->drawable) 89 | XFreePixmap(drw->dpy, drw->drawable); 90 | drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); 91 | } 92 | 93 | void 94 | drw_free(Drw *drw) 95 | { 96 | XFreePixmap(drw->dpy, drw->drawable); 97 | XFreeGC(drw->dpy, drw->gc); 98 | drw_fontset_free(drw->fonts); 99 | free(drw); 100 | } 101 | 102 | /* This function is an implementation detail. Library users should use 103 | * drw_fontset_create instead. 104 | */ 105 | static Fnt * 106 | xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) 107 | { 108 | Fnt *font; 109 | XftFont *xfont = NULL; 110 | FcPattern *pattern = NULL; 111 | 112 | if (fontname) { 113 | /* Using the pattern found at font->xfont->pattern does not yield the 114 | * same substitution results as using the pattern returned by 115 | * FcNameParse; using the latter results in the desired fallback 116 | * behaviour whereas the former just results in missing-character 117 | * rectangles being drawn, at least with some fonts. */ 118 | if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { 119 | fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); 120 | return NULL; 121 | } 122 | if (!(pattern = FcNameParse((FcChar8 *) fontname))) { 123 | fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); 124 | XftFontClose(drw->dpy, xfont); 125 | return NULL; 126 | } 127 | } else if (fontpattern) { 128 | if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { 129 | fprintf(stderr, "error, cannot load font from pattern.\n"); 130 | return NULL; 131 | } 132 | } else { 133 | die("no font specified."); 134 | } 135 | 136 | /* Do not allow using color fonts. This is a workaround for a BadLength 137 | * error from Xft with color glyphs. Modelled on the Xterm workaround. See 138 | * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 139 | * https://lists.suckless.org/dev/1701/30932.html 140 | * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 141 | * and lots more all over the internet. 142 | */ 143 | FcBool iscol; 144 | if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { 145 | XftFontClose(drw->dpy, xfont); 146 | return NULL; 147 | } 148 | 149 | font = ecalloc(1, sizeof(Fnt)); 150 | font->xfont = xfont; 151 | font->pattern = pattern; 152 | font->h = xfont->ascent + xfont->descent; 153 | font->dpy = drw->dpy; 154 | 155 | return font; 156 | } 157 | 158 | static void 159 | xfont_free(Fnt *font) 160 | { 161 | if (!font) 162 | return; 163 | if (font->pattern) 164 | FcPatternDestroy(font->pattern); 165 | XftFontClose(font->dpy, font->xfont); 166 | free(font); 167 | } 168 | 169 | Fnt* 170 | drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) 171 | { 172 | Fnt *cur, *ret = NULL; 173 | size_t i; 174 | 175 | if (!drw || !fonts) 176 | return NULL; 177 | 178 | for (i = 1; i <= fontcount; i++) { 179 | if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { 180 | cur->next = ret; 181 | ret = cur; 182 | } 183 | } 184 | return (drw->fonts = ret); 185 | } 186 | 187 | void 188 | drw_fontset_free(Fnt *font) 189 | { 190 | if (font) { 191 | drw_fontset_free(font->next); 192 | xfont_free(font); 193 | } 194 | } 195 | 196 | void 197 | drw_clr_create(Drw *drw, Clr *dest, const char *clrname) 198 | { 199 | if (!drw || !dest || !clrname) 200 | return; 201 | 202 | if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), 203 | DefaultColormap(drw->dpy, drw->screen), 204 | clrname, dest)) 205 | die("error, cannot allocate color '%s'", clrname); 206 | } 207 | 208 | /* Wrapper to create color schemes. The caller has to call free(3) on the 209 | * returned color scheme when done using it. */ 210 | Clr * 211 | drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) 212 | { 213 | size_t i; 214 | Clr *ret; 215 | 216 | /* need at least two colors for a scheme */ 217 | if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) 218 | return NULL; 219 | 220 | for (i = 0; i < clrcount; i++) 221 | drw_clr_create(drw, &ret[i], clrnames[i]); 222 | return ret; 223 | } 224 | 225 | void 226 | drw_setfontset(Drw *drw, Fnt *set) 227 | { 228 | if (drw) 229 | drw->fonts = set; 230 | } 231 | 232 | void 233 | drw_setscheme(Drw *drw, Clr *scm) 234 | { 235 | if (drw) 236 | drw->scheme = scm; 237 | } 238 | 239 | void 240 | drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) 241 | { 242 | if (!drw || !drw->scheme) 243 | return; 244 | XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); 245 | if (filled) 246 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 247 | else 248 | XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); 249 | } 250 | 251 | int 252 | drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) 253 | { 254 | char buf[1024]; 255 | int ty; 256 | unsigned int ew; 257 | XftDraw *d = NULL; 258 | Fnt *usedfont, *curfont, *nextfont; 259 | size_t i, len; 260 | int utf8strlen, utf8charlen, render = x || y || w || h; 261 | long utf8codepoint = 0; 262 | const char *utf8str; 263 | FcCharSet *fccharset; 264 | FcPattern *fcpattern; 265 | FcPattern *match; 266 | XftResult result; 267 | int charexists = 0; 268 | 269 | if (!drw || (render && !drw->scheme) || !text || !drw->fonts) 270 | return 0; 271 | 272 | if (!render) { 273 | w = ~w; 274 | } else { 275 | XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); 276 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 277 | d = XftDrawCreate(drw->dpy, drw->drawable, 278 | DefaultVisual(drw->dpy, drw->screen), 279 | DefaultColormap(drw->dpy, drw->screen)); 280 | x += lpad; 281 | w -= lpad; 282 | } 283 | 284 | usedfont = drw->fonts; 285 | while (1) { 286 | utf8strlen = 0; 287 | utf8str = text; 288 | nextfont = NULL; 289 | while (*text) { 290 | utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); 291 | for (curfont = drw->fonts; curfont; curfont = curfont->next) { 292 | charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); 293 | if (charexists) { 294 | if (curfont == usedfont) { 295 | utf8strlen += utf8charlen; 296 | text += utf8charlen; 297 | } else { 298 | nextfont = curfont; 299 | } 300 | break; 301 | } 302 | } 303 | 304 | if (!charexists || nextfont) 305 | break; 306 | else 307 | charexists = 0; 308 | } 309 | 310 | if (utf8strlen) { 311 | drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); 312 | /* shorten text if necessary */ 313 | for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) 314 | drw_font_getexts(usedfont, utf8str, len, &ew, NULL); 315 | 316 | if (len) { 317 | memcpy(buf, utf8str, len); 318 | buf[len] = '\0'; 319 | if (len < utf8strlen) 320 | for (i = len; i && i > len - 3; buf[--i] = '.') 321 | ; /* NOP */ 322 | 323 | if (render) { 324 | ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; 325 | XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], 326 | usedfont->xfont, x, ty, (XftChar8 *)buf, len); 327 | } 328 | x += ew; 329 | w -= ew; 330 | } 331 | } 332 | 333 | if (!*text) { 334 | break; 335 | } else if (nextfont) { 336 | charexists = 0; 337 | usedfont = nextfont; 338 | } else { 339 | /* Regardless of whether or not a fallback font is found, the 340 | * character must be drawn. */ 341 | charexists = 1; 342 | 343 | fccharset = FcCharSetCreate(); 344 | FcCharSetAddChar(fccharset, utf8codepoint); 345 | 346 | if (!drw->fonts->pattern) { 347 | /* Refer to the comment in xfont_create for more information. */ 348 | die("the first font in the cache must be loaded from a font string."); 349 | } 350 | 351 | fcpattern = FcPatternDuplicate(drw->fonts->pattern); 352 | FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); 353 | FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); 354 | FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); 355 | 356 | FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); 357 | FcDefaultSubstitute(fcpattern); 358 | match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); 359 | 360 | FcCharSetDestroy(fccharset); 361 | FcPatternDestroy(fcpattern); 362 | 363 | if (match) { 364 | usedfont = xfont_create(drw, NULL, match); 365 | if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { 366 | for (curfont = drw->fonts; curfont->next; curfont = curfont->next) 367 | ; /* NOP */ 368 | curfont->next = usedfont; 369 | } else { 370 | xfont_free(usedfont); 371 | usedfont = drw->fonts; 372 | } 373 | } 374 | } 375 | } 376 | if (d) 377 | XftDrawDestroy(d); 378 | 379 | return x + (render ? w : 0); 380 | } 381 | 382 | void 383 | drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) 384 | { 385 | if (!drw) 386 | return; 387 | 388 | XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); 389 | XSync(drw->dpy, False); 390 | } 391 | 392 | unsigned int 393 | drw_fontset_getwidth(Drw *drw, const char *text) 394 | { 395 | if (!drw || !drw->fonts || !text) 396 | return 0; 397 | return drw_text(drw, 0, 0, 0, 0, 0, text, 0); 398 | } 399 | 400 | void 401 | drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) 402 | { 403 | XGlyphInfo ext; 404 | 405 | if (!font || !text) 406 | return; 407 | 408 | XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); 409 | if (w) 410 | *w = ext.xOff; 411 | if (h) 412 | *h = font->h; 413 | } 414 | 415 | Cur * 416 | drw_cur_create(Drw *drw, int shape) 417 | { 418 | Cur *cur; 419 | 420 | if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) 421 | return NULL; 422 | 423 | cur->cursor = XCreateFontCursor(drw->dpy, shape); 424 | 425 | return cur; 426 | } 427 | 428 | void 429 | drw_cur_free(Drw *drw, Cur *cursor) 430 | { 431 | if (!cursor) 432 | return; 433 | 434 | XFreeCursor(drw->dpy, cursor->cursor); 435 | free(cursor); 436 | } 437 | --------------------------------------------------------------------------------