├── .config ├── karabiner │ └── karabiner.json └── sketchybar │ ├── plugins │ ├── airpods_battery.sh │ ├── brightness.sh │ ├── clock.sh │ ├── cpu.sh │ ├── cpu_graph.sh │ ├── disk.sh │ ├── dndIndicator.sh │ ├── gitNotifications.sh │ ├── githubIndicator.sh │ ├── hide_bar.sh │ ├── io_speed.sh │ ├── mailIndicator.sh │ ├── messages.sh │ ├── music.sh │ ├── music_click.sh │ ├── net.sh │ ├── network.sh │ ├── network_graph.sh │ ├── package_monitor.sh │ ├── power.sh │ ├── ram.sh │ ├── space.sh │ ├── spotifyIndicator.sh │ ├── test.sh │ ├── topmem.sh │ ├── topproc.sh │ ├── volume.sh │ ├── vpn.sh │ ├── weather.sh │ ├── yabai_float.sh │ ├── yabai_float_click.sh │ ├── yabai_mode.sh │ └── yabai_mode_click.sh │ └── sketchybarrc ├── .doom.d ├── config.el ├── custom.el ├── init.el └── packages.el ├── .hammerspoon ├── Spoons │ ├── KSheet.spoon.zip │ ├── MenuHammer.spoon.zip │ ├── MouseCircle.spoon.zip │ └── Shade.spoon.zip ├── init.lua ├── menuHammerCustomConfig.lua ├── slowq.lua └── stackline │ ├── README.md │ ├── bin │ └── yabai-get-stack-idx │ ├── conf.lua │ ├── lib │ ├── debug.lua │ ├── json.lua │ ├── utils.lua │ └── valid.lua │ └── stackline │ ├── configmanager.lua │ ├── query.lua │ ├── stack.lua │ ├── stackline.lua │ ├── stackmanager.lua │ └── window.lua ├── .limelightrc ├── .p10k.zsh ├── .scripts ├── .border ├── .gaps ├── .hide_bar ├── .space_change ├── .terminal ├── .uber ├── Unused │ ├── toggle_monocle_mode │ └── undock.sh └── color-scripts │ ├── .random-color │ ├── color-scripts │ ├── alpha │ ├── arch │ ├── blocks1 │ ├── blocks2 │ ├── bloks │ ├── colorbars │ ├── colortest │ ├── colortest-slim │ ├── colorview │ ├── colorwheel │ ├── crunch │ ├── crunchbang │ ├── crunchbang-mini │ ├── darthvader │ ├── dotx │ ├── elfman │ ├── faces │ ├── fade │ ├── ghosts │ ├── illumina │ ├── jangofett │ ├── monster │ ├── mouseface │ ├── mouseface2 │ ├── not-working │ │ ├── bars │ │ ├── crowns │ │ ├── dna │ │ ├── guns │ │ ├── hex │ │ ├── hex-block │ │ ├── pacman │ │ ├── panes │ │ ├── pipes1 │ │ ├── pipes2 │ │ ├── pipes2-slim │ │ ├── space-invaders │ │ ├── spectrum │ │ └── zwaves │ ├── pinguco │ ├── pukeskull │ ├── rails │ ├── rally-x │ ├── rupees │ ├── spectrum │ ├── square │ ├── tanks │ ├── thebat │ ├── thebat2 │ ├── tiefighter1 │ ├── tiefighter1-no-invo │ ├── tiefighter1row │ ├── tiefighter2 │ └── unowns.py │ └── test-color-support │ ├── README.md │ ├── ansi │ ├── color-support1.pl │ ├── color-support2 │ └── print-colors.py ├── .skhdrc ├── .spacevim.d └── init.toml ├── .tmux ├── .tmux.conf ├── plugins │ ├── tmux-battery │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── battery.tmux │ │ ├── screenshots │ │ │ ├── battery_charging_tier1.png │ │ │ ├── battery_charging_tier2.png │ │ │ ├── battery_charging_tier3.png │ │ │ ├── battery_charging_tier4.png │ │ │ ├── battery_charging_tier5.png │ │ │ ├── battery_charging_tier6.png │ │ │ ├── battery_charging_tier7.png │ │ │ ├── battery_charging_tier8.png │ │ │ ├── battery_discharging_tier1.png │ │ │ ├── battery_discharging_tier2.png │ │ │ ├── battery_discharging_tier3.png │ │ │ ├── battery_discharging_tier4.png │ │ │ ├── battery_discharging_tier5.png │ │ │ ├── battery_discharging_tier6.png │ │ │ ├── battery_discharging_tier7.png │ │ │ ├── battery_discharging_tier8.png │ │ │ ├── battery_status_attached.png │ │ │ └── battery_status_unknown.png │ │ └── scripts │ │ │ ├── battery_color.sh │ │ │ ├── battery_color_charge.sh │ │ │ ├── battery_color_status.sh │ │ │ ├── battery_graph.sh │ │ │ ├── battery_icon.sh │ │ │ ├── battery_icon_charge.sh │ │ │ ├── battery_icon_status.sh │ │ │ ├── battery_percentage.sh │ │ │ ├── battery_remain.sh │ │ │ ├── battery_status_bg.sh │ │ │ ├── battery_status_fg.sh │ │ │ └── helpers.sh │ ├── tmux-copycat │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── Vagrantfile │ │ ├── copycat.tmux │ │ ├── docs │ │ │ ├── customizations.md │ │ │ ├── defining_new_stored_searches.md │ │ │ ├── installation_for_tmux_2.3.md │ │ │ └── limitations.md │ │ ├── run-tests │ │ ├── scripts │ │ │ ├── check_tmux_version.sh │ │ │ ├── copycat_generate_results.sh │ │ │ ├── copycat_git_special.sh │ │ │ ├── copycat_jump.sh │ │ │ ├── copycat_mode_bindings.sh │ │ │ ├── copycat_mode_quit.sh │ │ │ ├── copycat_mode_start.sh │ │ │ ├── copycat_search.sh │ │ │ ├── helpers.sh │ │ │ ├── stored_search_helpers.sh │ │ │ └── variables.sh │ │ ├── test │ │ │ ├── README.md │ │ │ ├── helpers │ │ │ │ ├── expect_copycat_assertions.exp │ │ │ │ ├── expect_copycat_helpers.exp │ │ │ │ ├── expect_helpers.exp │ │ │ │ ├── run_tmux.exp │ │ │ │ ├── setup.exp │ │ │ │ ├── setup_tmux_conf.sh │ │ │ │ ├── setup_tmux_conf_with_custom_searches.sh │ │ │ │ ├── setup_with_custom_searches.exp │ │ │ │ └── test.exp │ │ │ ├── run-tests-within-vm │ │ │ ├── test_digit_search.exp │ │ │ ├── test_file_search.exp │ │ │ ├── test_free_search.exp │ │ │ ├── test_git_hash_search.exp │ │ │ ├── test_git_status_search.exp │ │ │ ├── test_url_search.exp │ │ │ └── test_user_defined_search.exp │ │ ├── vagrant_ubuntu_provisioning_two_five.sh │ │ └── video │ │ │ ├── README.md │ │ │ ├── screencast_img.png │ │ │ └── script.md │ ├── tmux-online-status │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── online_status.tmux │ │ ├── screenshots │ │ │ ├── offline_indicator.png │ │ │ ├── offline_indicator_linux.png │ │ │ ├── online_indicator.png │ │ │ └── online_indicator_linux.png │ │ └── scripts │ │ │ ├── online_status_icon.sh │ │ │ └── shared.sh │ ├── tmux-open │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── open.tmux │ │ ├── scripts │ │ │ ├── helpers.sh │ │ │ └── tmux_open_error_message.sh │ │ └── video │ │ │ ├── screencast_img.png │ │ │ └── script.md │ ├── tmux-plugin-sysstat │ │ ├── LICENSE │ │ ├── readme.md │ │ ├── screenshots │ │ │ ├── cpu_thresholds.png │ │ │ └── intro.png │ │ ├── scripts │ │ │ ├── cpu.sh │ │ │ ├── cpu_collect.sh │ │ │ ├── helpers.sh │ │ │ ├── loadavg.sh │ │ │ ├── mem.sh │ │ │ └── swap.sh │ │ └── sysstat.tmux │ ├── tmux-prefix-highlight │ │ ├── LICENSE │ │ ├── README.md │ │ ├── prefix_highlight.tmux │ │ └── screenshots │ │ │ ├── prefix_off.png │ │ │ └── prefix_on.png │ ├── tmux-sidebar │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── docs │ │ │ └── options.md │ │ ├── screenshot.gif │ │ ├── scripts │ │ │ ├── check_tmux_version.sh │ │ │ ├── custom_tree.sh │ │ │ ├── helpers.sh │ │ │ ├── save_sidebar_width.sh │ │ │ ├── toggle.sh │ │ │ ├── tree_helpers.sh │ │ │ └── variables.sh │ │ └── sidebar.tmux │ └── tpm │ │ ├── CHANGELOG.md │ │ ├── HOW_TO_PLUGIN.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── bin │ │ ├── clean_plugins │ │ ├── install_plugins │ │ └── update_plugins │ │ ├── bindings │ │ ├── clean_plugins │ │ ├── install_plugins │ │ └── update_plugins │ │ ├── docs │ │ ├── automatic_tpm_installation.md │ │ ├── changing_plugins_install_dir.md │ │ ├── how_to_create_plugin.md │ │ ├── managing_plugins_via_cmd_line.md │ │ └── tpm_not_working.md │ │ ├── scripts │ │ ├── check_tmux_version.sh │ │ ├── clean_plugins.sh │ │ ├── helpers │ │ │ ├── plugin_functions.sh │ │ │ ├── shell_echo_functions.sh │ │ │ ├── tmux_echo_functions.sh │ │ │ ├── tmux_utils.sh │ │ │ └── utility.sh │ │ ├── install_plugins.sh │ │ ├── source_plugins.sh │ │ ├── update_plugin.sh │ │ ├── update_plugin_prompt_handler.sh │ │ └── variables.sh │ │ ├── tests │ │ ├── expect_failed_plugin_download │ │ ├── expect_successful_clean_plugins │ │ ├── expect_successful_multiple_plugins_download │ │ ├── expect_successful_plugin_download │ │ ├── expect_successful_update_of_a_single_plugin │ │ ├── expect_successful_update_of_all_plugins │ │ ├── helpers │ │ │ └── tpm.sh │ │ ├── test_plugin_clean.sh │ │ ├── test_plugin_installation.sh │ │ ├── test_plugin_installation_legacy.sh │ │ ├── test_plugin_sourcing.sh │ │ └── test_plugin_update.sh │ │ └── tpm ├── renew_env.sh ├── tmux.remote.conf └── yank.sh ├── .yabairc ├── .zshrc ├── LICENSE ├── Library └── Application Support │ ├── code │ └── user │ │ ├── keybindings.json │ │ └── settings.json │ └── Übersicht │ └── widgets │ └── list ├── README.md ├── SwiftBar ├── Package.4h.sh └── yabai.1d.sh ├── Wallpapers ├── Big-Nord-BG.png └── Big-Nord.png └── images ├── Screen Shot 2021-04-14 at T02.57.29.png ├── Screen Shot 2021-04-14 at T03.33.21.png └── Screen Shot 2021-04-14 at T04.33.05.png /.config/sketchybar/plugins/airpods_battery.sh: -------------------------------------------------------------------------------- 1 | DEVICES="$(system_profiler SPBluetoothDataType -json -detailLevel basic 2>/dev/null | jq '.SPBluetoothDataType' | jq '.[0]' | jq '.device_title' | jq -r '.[] | keys[] as $k | "\($k) \(.[$k] | .device_isconnected) \(.[$k] | .device_minorClassOfDevice_string)"' | grep 'attrib_Yes' | grep 'Headphones')" 2 | 3 | if [ "$DEVICES" = "" ]; then 4 | sketchybar -m --set $NAME drawing=off 5 | else 6 | sketchybar -m --set $NAME drawing=on 7 | # Left 8 | LEFT="$(defaults read /Library/Preferences/com.apple.Bluetooth | grep BatteryPercentLeft | tr -d \; | awk '{ printf("%02d", $3) }')"% 9 | 10 | # Right 11 | RIGHT="$(defaults read /Library/Preferences/com.apple.Bluetooth | grep BatteryPercentRight | tr -d \; | awk '{ printf("%02d", $3) }')"% 12 | 13 | # Case 14 | CASE="$(defaults read /Library/Preferences/com.apple.Bluetooth | grep BatteryPercentCase | tr -d \; | awk '{ printf("%02d", $3) }')"% 15 | 16 | echo $CASE 17 | 18 | if [ $LEFT = 00% ]; then 19 | LEFT="-" 20 | fi 21 | 22 | if [ $RIGHT = 00% ]; then 23 | RIGHT="-" 24 | fi 25 | 26 | if [ $CASE = 00% ]; then 27 | CASE="-" 28 | fi 29 | 30 | sketchybar -m --set $NAME label="$LEFT $CASE $RIGHT" 31 | echo "$LEFT $CASE $RIGHT" 32 | fi -------------------------------------------------------------------------------- /.config/sketchybar/plugins/brightness.sh: -------------------------------------------------------------------------------- 1 | LABEL=$(brightness -l | awk 'NR==2 {printf("%02.0f", $4*100)}')% 2 | 3 | sketchybar -m --set $NAME label=$LABEL -------------------------------------------------------------------------------- /.config/sketchybar/plugins/clock.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sketchybar -m --set $NAME label="$(date '++Y%Y-%m-%d-W%W-0%u-T%H:%M:%S%z')" 4 | # sketchybar -m --set $NAME label="$(date '+%d/%m %H:%M')" 5 | 6 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/cpu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CORE_COUNT=$(sysctl -n machdep.cpu.thread_count) 4 | CPU_INFO=$(ps -eo pcpu,user) 5 | CPU_SYS=$(echo "$CPU_INFO" | grep -v $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") 6 | CPU_USER=$(echo "$CPU_INFO" | grep $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") 7 | 8 | sketchybar -m --set cpu_percent label=$(echo "$CPU_SYS $CPU_USER" | awk '{ printf("%02.0f\n", ($1 + $2)*100) }')% -------------------------------------------------------------------------------- /.config/sketchybar/plugins/cpu_graph.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CORE_COUNT=$(sysctl -n machdep.cpu.thread_count) 4 | CPU_INFO=$(ps -eo pcpu,user) 5 | CPU_SYS=$(echo "$CPU_INFO" | grep -v $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") 6 | CPU_USER=$(echo "$CPU_INFO" | grep $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") 7 | 8 | sketchybar -m --push cpu_sys $CPU_SYS \ 9 | --push cpu_user $CPU_USER 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/disk.sh: -------------------------------------------------------------------------------- 1 | sketchybar -m --set disk_percentage label=$(df -lh | grep /dev/disk1s2 | awk '{ printf ("%02.0f\n", $5) }')% -------------------------------------------------------------------------------- /.config/sketchybar/plugins/dndIndicator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Thanks to reddit:rudypaul 4 | BIN_DIR="/usr/bin" 5 | 6 | PLUTIL="${BIN_DIR}/plutil" 7 | XPATH="${BIN_DIR}/xpath" 8 | BASE64="${BIN_DIR}/base64" 9 | 10 | dnd_enabled=$( 11 | "${PLUTIL}" -extract dnd_prefs xml1 -o - ~/Library/Preferences/com.apple.ncprefs.plist | 12 | "${XPATH}" -q -e 'string(//data)' | 13 | "${BASE64}" -D | 14 | "${PLUTIL}" -convert xml1 - -o - | 15 | "${XPATH}" -q -e 'boolean(//key[text()="userPref"]/following-sibling::dict/key[text()="enabled"])' 16 | ) 17 | 18 | if [ $dnd_enabled -eq 1 ]; then 19 | sketchybar -m --set $NAME drawing=on 20 | else 21 | sketchybar -m --set $NAME drawing=off 22 | fi 23 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/gitNotifications.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | NOTIFICATIONS="$(gh api notifications | jq '.[]')" 4 | 5 | if [ "$NOTIFICATIONS" = "" ]; then 6 | sketchybar -m --set $NAME icon= 7 | else 8 | sketchybar -m --set $NAME icon= 9 | fi 10 | 11 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/githubIndicator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | COUNT=0 4 | COUNT=$(curl https://github.com/users/FelixKratz/contributions | grep $(date '+%Y-%m-%d') | sed -nr 's/.*data-count=\"([^"]+).*/\1/p') 5 | 6 | echo $COUNT 7 | if [ $COUNT -gt 0 ]; then 8 | sketchybar -m --set $NAME icon.color=0xff48aa2a label.padding_left=4 label="$COUNT" 9 | else 10 | sketchybar -m --set $NAME icon.color=0xaaffffff label.padding_left=0 label="" 11 | fi 12 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/hide_bar.sh: -------------------------------------------------------------------------------- 1 | if [[ $(yabai -m query --spaces --space | grep "native-fullscreen") == *"0"* ]]; then 2 | sketchybar -m --bar hidden=off 3 | else 4 | sketchybar -m --bar hidden=on 5 | fi -------------------------------------------------------------------------------- /.config/sketchybar/plugins/io_speed.sh: -------------------------------------------------------------------------------- 1 | sketchybar -m --set io_speed label=$(iostat | awk 'NR == 3 { printf("%02.02f MB/s", $6) }') -------------------------------------------------------------------------------- /.config/sketchybar/plugins/mailIndicator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | RUNNING=$(osascript -e 'if application "Mail" is running then return 0') 3 | COUNT=0 4 | 5 | if [ $RUNNING == 0 ]; then 6 | COUNT=$(osascript -e 'tell application "Mail" to return the unread count of inbox') 7 | sketchybar -m --set $NAME label="$COUNT" 8 | else 9 | sketchybar -m --set $NAME label= 10 | fi 11 | 12 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/messages.sh: -------------------------------------------------------------------------------- 1 | TEXT=$(sqlite3 ~/Library/Messages/chat.db "SELECT text FROM message WHERE is_read=0 AND is_from_me=0 AND text!='' AND date_read=0" | wc -l | awk '{$1=$1};1') 2 | 3 | if [ $TEXT = 0 ]; then 4 | sketchybar -m --set messages drawing=off 5 | else 6 | sketchybar -m --set messages drawing=on 7 | sketchybar -m --set messages label="$TEXT" 8 | echo "$TEXT" 9 | fi -------------------------------------------------------------------------------- /.config/sketchybar/plugins/music.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | APP_STATE=$(pgrep -x Music) 4 | if [[ ! $APP_STATE ]]; then 5 | sketchybar -m --set music_info drawing=on 6 | exit 0 7 | fi 8 | 9 | PLAYER_STATE=$(osascript -e "tell application \"Music\" to set playerState to (get player state) as text") 10 | if [[ $PLAYER_STATE == "stopped" ]]; then 11 | sketchybar -m --set music_info drawing=on 12 | exit 0 13 | fi 14 | 15 | TITLE=$(osascript -e 'tell application "Music" to get name of current track') 16 | ARTIST=$(osascript -e 'tell application "Music" to get artist of current track') 17 | # ALBUM=$(osascript -e 'tell application "Music" to get album of current track') 18 | LOVED=$(osascript -l JavaScript -e "Application('Music').currentTrack().loved()") 19 | 20 | if [[ $LOVED == "true" ]]; then 21 | ICON= 22 | else 23 | [[ $PLAYER_STATE == "paused" ]] && ICON= || ICON= 24 | fi 25 | 26 | if [[ ${#TITLE} -gt 25 ]]; then 27 | TITLE=$(printf "$(echo $TITLE | cut -c 1-25)…") 28 | fi 29 | 30 | if [[ ${#ARTIST} -gt 25 ]]; then 31 | ARTIST=$(printf "$(echo $ARTIST | cut -c 1-25)…") 32 | fi 33 | 34 | # if [[ ${#ALBUM} -gt 25 ]]; then 35 | # ALBUM=$(printf "$(echo $ALBUM | cut -c 1-12)…") 36 | # fi 37 | 38 | sketchybar -m --set music_info icon="$ICON" \ 39 | --set music_info label="${TITLE} x ${ARTIST}" \ 40 | --set music_info drawing=off -------------------------------------------------------------------------------- /.config/sketchybar/plugins/music_click.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | 3 | tell application "Music" 4 | if loved of current track is true then 5 | set loved of current track to false 6 | do shell script "sketchybar -m --set music_info icon=" 7 | else 8 | set loved of current track to true 9 | do shell script "sketchybar -m --set music_info icon=" 10 | end if 11 | end tell 12 | 13 | delay 1 14 | 15 | do shell script "sh $HOME/.config/sketchybar/plugins/music.sh" 16 | 17 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/net.sh: -------------------------------------------------------------------------------- 1 | LABEL=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk 'NR==13 {print $2}') 2 | 3 | sketchybar -m --set $NAME label=$LABEL -------------------------------------------------------------------------------- /.config/sketchybar/plugins/network.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | UPDOWN=$(ifstat -i "en0" -b 0.1 1 | tail -n1) 4 | DOWN=$(echo $UPDOWN | awk "{ print \$1 }" | cut -f1 -d ".") 5 | UP=$(echo $UPDOWN | awk "{ print \$2 }" | cut -f1 -d ".") 6 | 7 | DOWN_FORMAT="" 8 | if [ "$DOWN" -gt "999" ]; then 9 | DOWN_FORMAT=$(echo $DOWN | awk '{ printf "%03.0f Mbps", $1 / 1000}') 10 | else 11 | DOWN_FORMAT=$(echo $DOWN | awk '{ printf "%03.0f kbps", $1}') 12 | fi 13 | 14 | UP_FORMAT="" 15 | if [ "$UP" -gt "999" ]; then 16 | UP_FORMAT=$(echo $UP | awk '{ printf "%03.0f Mbps", $1 / 1000}') 17 | else 18 | UP_FORMAT=$(echo $UP | awk '{ printf "%03.0f kbps", $1}') 19 | fi 20 | 21 | sketchybar -m --set network_down label="$DOWN_FORMAT" icon.highlight=$(if [ "$DOWN" -gt "0" ]; then echo "on"; else echo "off"; fi) \ 22 | --set network_up label="$UP_FORMAT" icon.highlight=$(if [ "$UP" -gt "0" ]; then echo "on"; else echo "off"; fi) -------------------------------------------------------------------------------- /.config/sketchybar/plugins/network_graph.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | MAX_DOWN=110000 3 | MAX_UP=45000 4 | UPDOWN=$(ifstat -i "en0" -b 0.1 1 | tail -n1) 5 | DOWN=$(echo $UPDOWN | awk "{ print \$1 }" | cut -f1 -d ".") 6 | UP=$(echo $UPDOWN | awk "{ print \$2 }" | cut -f1 -d ".") 7 | 8 | sketchybar -m --push network_down $(echo $UPDOWN | awk "{ print \$1 / (1.0 * $MAX_DOWN) }") 9 | --push network_up $(echo $UPDOWN | awk "{ print \$2 / (1.0 * $MAX_UP) }") 10 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/power.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BATT_PERCENT=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) 4 | CHARGING=$(pmset -g batt | grep 'AC Power') 5 | 6 | if [[ $CHARGING != "" ]]; then 7 | sketchybar -m --set battery \ 8 | icon.color=0xFFEBCB8B \ 9 | icon= \ 10 | label=$(printf "${BATT_PERCENT}%%") 11 | exit 0 12 | fi 13 | 14 | [[ ${BATT_PERCENT} -gt 10 ]] && COLOR=0xFF${color5:1} || COLOR=0xFFFF0000 15 | 16 | case ${BATT_PERCENT} in 17 | 100) ICON="" ;; 18 | 9[0-9]) ICON="" ;; 19 | 8[0-9]) ICON="" ;; 20 | 7[0-9]) ICON="" ;; 21 | 6[0-9]) ICON="" ;; 22 | 5[0-9]) ICON="" ;; 23 | 4[0-9]) ICON="" ;; 24 | 3[0-9]) ICON="" ;; 25 | 2[0-9]) ICON="" ;; 26 | 1[0-9]) ICON="" ;; 27 | *) ICON="" 28 | esac 29 | 30 | sketchybar -m --set battery\ 31 | icon.color=$COLOR \ 32 | icon= \ 33 | label=$(printf "${BATT_PERCENT}%%") 34 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/ram.sh: -------------------------------------------------------------------------------- 1 | sketchybar -m --set ram_percentage label=$(memory_pressure | grep "System-wide memory free percentage:" | awk '{ printf("%02.0f\n", 100-$5"%") }')% -------------------------------------------------------------------------------- /.config/sketchybar/plugins/space.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | update() { 4 | if [ "$SELECTED" = "true" ]; then 5 | sketchybar -m --set $NAME label.highlight=on icon.highlight=on background.drawing=on 6 | else 7 | sketchybar -m --set $NAME label.highlight=off icon.highlight=off background.drawing=off 8 | fi 9 | } 10 | 11 | mouse_entered() { 12 | sketchybar -m --set $NAME icon.highlight=on \ 13 | label.highlight=on 14 | } 15 | 16 | mouse_exited() { 17 | sketchybar -m --set $NAME icon.highlight=off \ 18 | label.highlight=off 19 | } 20 | 21 | case "$SENDER" in 22 | "mouse.entered") mouse_entered 23 | ;; 24 | "mouse.exited") mouse_exited 25 | ;; 26 | *) update 27 | ;; 28 | esac -------------------------------------------------------------------------------- /.config/sketchybar/plugins/spotifyIndicator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | RUNNING=$(osascript -e 'if application "Spotify" is running then return 0') 3 | if [ "$RUNNING" == "" ]; then 4 | RUNNING=1 5 | fi 6 | PLAYING=1 7 | TRACK="" 8 | ALBUM="" 9 | ARTIST="" 10 | if [ "$(osascript -e 'if application "Spotify" is running then tell application "Spotify" to get player state')" == "playing" ]; then 11 | PLAYING=0 12 | TRACK=$(osascript -e 'tell application "Spotify" to get name of current track') 13 | ARTIST=$(osascript -e 'tell application "Spotify" to get artist of current track') 14 | ALBUM=$(osascript -e 'tell application "Spotify" to get album of current track') 15 | fi 16 | if [ $RUNNING -eq 0 ] && [ $PLAYING -eq 0 ]; then 17 | if [ "$ARTIST" == "" ]; then 18 | sketchybar -m --set $NAME label=" $TRACK  $ALBUM" 19 | else 20 | sketchybar -m --set $NAME label=" $TRACK  $ARTIST" 21 | fi 22 | else 23 | sketchybar -m --set $NAME label="" 24 | fi 25 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/test.sh: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/topmem.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TOPMEM=$(ps axo "rss,ucomm" | sort -nr | tail +1 | head -n1 | awk '{printf "%.0fMB %s\n", $1 / 1024, $2}' | sed -e 's/com.apple.//g') 4 | MEM=$(echo $TOPMEM | sed -nr 's/([^MB]+).*/\1/p') 5 | 6 | if [ $MEM -gt 2048 ]; then 7 | sketchybar -m --set $NAME label=" $TOPMEM" 8 | else 9 | sketchybar -m --set $NAME label="" 10 | fi 11 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/topproc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TOPPROC=$(ps axo "%cpu,ucomm" | sort -nr | tail +1 | head -n1 | awk '{printf "%.0f%% %s\n", $1, $2}' | sed -e 's/com.apple.//g') 4 | CPUP=$(echo $TOPPROC | sed -nr 's/([^\%]+).*/\1/p') 5 | 6 | if [ $CPUP -gt 75 ]; then 7 | sketchybar -m --set $NAME label="異 $TOPPROC" 8 | else 9 | sketchybar -m --set $NAME label="" 10 | fi 11 | 12 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/volume.sh: -------------------------------------------------------------------------------- 1 | LABEL=$(osascript -e 'output volume of (get volume settings)')% 2 | 3 | sketchybar -m --set $NAME label=$LABEL -------------------------------------------------------------------------------- /.config/sketchybar/plugins/vpn.sh: -------------------------------------------------------------------------------- 1 | VPN=$(scutil --nc list | grep Connected | sed -E 's/.*"(.*)".*/\1/') 2 | 3 | if [[ $VPN != "" ]]; then 4 | sketchybar -m --set vpn icon= \ 5 | label="$VPN" \ 6 | drawing=on 7 | else 8 | sketchybar -m --set vpn drawing=off 9 | fi -------------------------------------------------------------------------------- /.config/sketchybar/plugins/weather.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | WEATHER="$(curl -s 'wttr.in/Spring?format=%c%f')" 4 | LABEL="$(echo "${WEATHER:3:-1}")" 5 | ICON="$(echo "${WEATHER:0:1}")" 6 | 7 | echo $LABEL 8 | echo $ICON 9 | 10 | sketchybar -m --set $NAME label=$LABEL 11 | 12 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/yabai_float.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | case "$(yabai -m query --windows --window | jq .floating)" in 4 | 0) 5 | sketchybar -m --set yabai_float icon="" 6 | ;; 7 | 1) 8 | sketchybar -m --set yabai_float icon="" 9 | ;; 10 | esac 11 | 12 | -------------------------------------------------------------------------------- /.config/sketchybar/plugins/yabai_float_click.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | yabai -m window --toggle float 4 | sketchybar -m --trigger float_change -------------------------------------------------------------------------------- /.config/sketchybar/plugins/yabai_mode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | case "$(yabai -m query --spaces --display | jq -r 'map(select(."focused" == 1))[-1].type')" in 4 | bsp) 5 | sketchybar -m --set yabai_mode icon="" 6 | ;; 7 | stack) 8 | sketchybar -m --set yabai_mode icon="﯅" 9 | ;; 10 | float) 11 | sketchybar -m --set yabai_mode icon="" 12 | ;; 13 | esac -------------------------------------------------------------------------------- /.config/sketchybar/plugins/yabai_mode_click.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Add mode changed event 4 | 5 | case "$(yabai -m query --spaces --display | jq -r 'map(select(."focused" == 1))[-1].type')" in 6 | bsp) 7 | yabai -m config layout stack && sketchybar -m --set yabai_mode label="﯅" 8 | ;; 9 | stack) 10 | yabai -m config layout float && sketchybar -m --set yabai_mode label="" 11 | ;; 12 | float) 13 | yabai -m config layout bsp && sketchybar -m --set yabai_mode label="" 14 | ;; 15 | esac -------------------------------------------------------------------------------- /.doom.d/custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables 2 | ;; custom-set-variables was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | '(custom-safe-themes 7 | '("37768a79b479684b0756dec7c0fc7652082910c37d8863c35b702db3f16000f8" default)) 8 | '(package-selected-packages '(nord-theme))) 9 | (custom-set-faces 10 | ;; custom-set-faces was added by Custom. 11 | ;; If you edit it by hand, you could mess it up, so be careful. 12 | ;; Your init file should contain only one such instance. 13 | ;; If there is more than one, they won't work right. 14 | ) 15 | -------------------------------------------------------------------------------- /.doom.d/packages.el: -------------------------------------------------------------------------------- 1 | ;; -*- no-byte-compile: t; -*- 2 | ;;; $DOOMDIR/packages.el 3 | 4 | ;; To install a package with Doom you must declare them here and run 'doom sync' 5 | ;; on the command line, then restart Emacs for the changes to take effect -- or 6 | ;; use 'M-x doom/reload'. 7 | 8 | 9 | ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: 10 | ;(package! some-package) 11 | 12 | ;; To install a package directly from a remote git repo, you must specify a 13 | ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: 14 | ;; https://github.com/raxod502/straight.el#the-recipe-format 15 | ;(package! another-package 16 | ; :recipe (:host github :repo "username/repo")) 17 | 18 | ;; If the package you are trying to install does not contain a PACKAGENAME.el 19 | ;; file, or is located in a subdirectory of the repo, you'll need to specify 20 | ;; `:files' in the `:recipe': 21 | ;(package! this-package 22 | ; :recipe (:host github :repo "username/repo" 23 | ; :files ("some-file.el" "src/lisp/*.el"))) 24 | 25 | ;; If you'd like to disable a package included with Doom, you can do so here 26 | ;; with the `:disable' property: 27 | ;(package! builtin-package :disable t) 28 | 29 | ;; You can override the recipe of a built in package without having to specify 30 | ;; all the properties for `:recipe'. These will inherit the rest of its recipe 31 | ;; from Doom or MELPA/ELPA/Emacsmirror: 32 | ;(package! builtin-package :recipe (:nonrecursive t)) 33 | ;(package! builtin-package-2 :recipe (:repo "myfork/package")) 34 | 35 | ;; Specify a `:branch' to install a package from a particular branch or tag. 36 | ;; This is required for some packages whose default branch isn't 'master' (which 37 | ;; our package manager can't deal with; see raxod502/straight.el#279) 38 | ;(package! builtin-package :recipe (:branch "develop")) 39 | 40 | ;; Use `:pin' to specify a particular commit to install. 41 | ;(package! builtin-package :pin "1a2b3c4d5e") 42 | 43 | 44 | ;; Doom's packages are pinned to a specific commit and updated from release to 45 | ;; release. The `unpin!' macro allows you to unpin single packages... 46 | ;(unpin! pinned-package) 47 | ;; ...or multiple packages 48 | ;(unpin! pinned-package another-pinned-package) 49 | ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) 50 | ;(unpin! t) 51 | 52 | (package! ewal) 53 | (package! ewal-doom-themes) 54 | (package! doom-themes) 55 | (package! nord-theme) 56 | -------------------------------------------------------------------------------- /.hammerspoon/Spoons/KSheet.spoon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.hammerspoon/Spoons/KSheet.spoon.zip -------------------------------------------------------------------------------- /.hammerspoon/Spoons/MenuHammer.spoon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.hammerspoon/Spoons/MenuHammer.spoon.zip -------------------------------------------------------------------------------- /.hammerspoon/Spoons/MouseCircle.spoon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.hammerspoon/Spoons/MouseCircle.spoon.zip -------------------------------------------------------------------------------- /.hammerspoon/Spoons/Shade.spoon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.hammerspoon/Spoons/Shade.spoon.zip -------------------------------------------------------------------------------- /.hammerspoon/init.lua: -------------------------------------------------------------------------------- 1 | hs.loadSpoon("KSheet") 2 | hs.loadSpoon("MouseCircle") 3 | hs.loadSpoon("TimeMachineProgress") 4 | 5 | -- Mouse Circle 6 | spoon.MouseCircle:bindHotkeys( 7 | { 8 | show = { 9 | { 10 | "ctrl","cmd" 11 | }, 12 | "z" 13 | } 14 | } 15 | ) 16 | 17 | -- KSheet 18 | -- spoon.KSheet:bindHotkeys({ 19 | -- toggle = { { "ctrl", "alt" }, "space" } 20 | -- }) 21 | 22 | -- Command Q 23 | -- config: number of seconds to hold Command-Q to quit application 24 | cmdQDelay = 2 25 | 26 | cmdQTimer = nil 27 | cmdQAlert = nil 28 | 29 | function cmdQCleanup() 30 | hs.alert.closeSpecific(cmdQAlert) 31 | cmdQTimer = nil 32 | cmdQAlert = nil 33 | end 34 | 35 | function stopCmdQ() 36 | if cmdQTimer then 37 | cmdQTimer:stop() 38 | cmdQCleanup() 39 | hs.alert("quit canceled",0.5) 40 | end 41 | end 42 | 43 | function startCmdQ() 44 | local app = hs.application.frontmostApplication() 45 | cmdQTimer = hs.timer.doAfter(cmdQDelay, function() app:kill(); cmdQCleanup() end) 46 | cmdQAlert = hs.alert("hold to quit " .. app:name(), true) 47 | end 48 | 49 | cmdQ = hs.hotkey.bind({"cmd"},"q",startCmdQ,stopCmdQ) 50 | 51 | -- Stackline 52 | stackline = require "stackline.stackline.stackline" 53 | 54 | local myStackline = { 55 | appearance = { 56 | showIcons = false, -- default is true 57 | shouldFade = false, 58 | }, 59 | } 60 | 61 | stackline:init(myStackline) 62 | 63 | -- MenuHammer 64 | 65 | menuHammer = hs.loadSpoon("MenuHammer") 66 | menuHammer:enter() 67 | -------------------------------------------------------------------------------- /.hammerspoon/slowq.lua: -------------------------------------------------------------------------------- 1 | 2 | -- http://github.com/dbmrq/dotfiles/ 3 | 4 | -- Requires you to keep holding Command + Q for a while before closing an app, 5 | -- so you won't do it accidentally. 6 | 7 | -- Replaces apps like CommandQ and SlowQuitApps. 8 | 9 | 10 | ----------------------------- 11 | -- Customization Options -- 12 | ----------------------------- 13 | 14 | local delay = 2.5 -- In seconds 15 | 16 | 17 | ------------------------------------------------------------------- 18 | -- Don't mess with this part unless you know what you're doing -- 19 | ------------------------------------------------------------------- 20 | 21 | local killedIt = false 22 | 23 | function pressedQ() 24 | killedIt = false 25 | hs.alert.show("⌘Q") 26 | hs.timer.usleep(1000000 * delay) 27 | end 28 | 29 | function repeatQ() 30 | if killedIt then return end 31 | hs.application.frontmostApplication():kll() 32 | killedIt = true 33 | hs.alert.closeAll() 34 | end 35 | 36 | hs.hotkey.bind('cmd', 'Q', pressedQ, nil, repeatQ) 37 | 38 | i 39 | -------------------------------------------------------------------------------- /.hammerspoon/stackline/bin/yabai-get-stack-idx: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | "$1" -m query --windows \ 4 | | "$2" --raw-output --compact-output --monochrome-output 'map({"\(.id)": .["stack-index"]}) | reduce .[] as $item ({}; . + $item)' 5 | 6 | -------------------------------------------------------------------------------- /.hammerspoon/stackline/stackline/stack.lua: -------------------------------------------------------------------------------- 1 | local u = require 'stackline.lib.utils' 2 | 3 | local Stack = {} 4 | 5 | function Stack:new(stackedWindows) -- {{{ 6 | local stack = { 7 | windows = stackedWindows 8 | } 9 | setmetatable(stack, self) 10 | self.__index = self 11 | return stack 12 | end -- }}} 13 | 14 | function Stack:get() -- {{{ 15 | return self.windows 16 | end -- }}} 17 | 18 | function Stack:getHs() -- {{{ 19 | return u.map(self.windows, function(w) 20 | return w._win 21 | end) 22 | end -- }}} 23 | 24 | function Stack:frame() -- {{{ 25 | -- All stacked windows have the same dimensions, 26 | -- so the 1st Hs window's frame is ~= to the stack's frame 27 | -- TODO: Incorrect when the 1st window has min-size < stack width. See ./query.lua:104 28 | return self.windows[1]._win:frame() 29 | end -- }}} 30 | 31 | function Stack:eachWin(fn) -- {{{ 32 | for _idx, win in pairs(self.windows) do 33 | fn(win) 34 | end 35 | end -- }}} 36 | 37 | function Stack:getOtherAppWindows(win) -- {{{ 38 | -- NOTE: may not need when HS issue #2400 is closed 39 | return u.filter(self:get(), function(w) 40 | return w.app == win.app 41 | end) 42 | end -- }}} 43 | 44 | function Stack:anyFocused() -- {{{ 45 | return u.any(self.windows, function(w) 46 | return w:isFocused() 47 | end) 48 | end -- }}} 49 | 50 | function Stack:resetAllIndicators() -- {{{ 51 | self:eachWin(function(win) 52 | win:setupIndicator() 53 | win:drawIndicator() 54 | end) 55 | end -- }}} 56 | 57 | function Stack:redrawAllIndicators(opts) -- {{{ 58 | self:eachWin(function(win) 59 | if win.id ~= opts.except then 60 | win:redrawIndicator() 61 | end 62 | end) 63 | end -- }}} 64 | 65 | function Stack:deleteAllIndicators() -- {{{ 66 | self:eachWin(function(win) 67 | win:deleteIndicator() 68 | end) 69 | end -- }}} 70 | 71 | function Stack:getWindowByPoint(point) -- {{{ 72 | local foundWin = u.filter(self.windows, function(w) 73 | if not w.indicator then return false end 74 | local indicatorEls = w.indicator:canvasElements() 75 | local wFrame = hs.geometry.rect(indicatorEls[1].frame) 76 | return point:inside(wFrame) 77 | end) 78 | 79 | if #foundWin > 0 then 80 | return foundWin[1] 81 | end 82 | end 83 | 84 | return Stack 85 | -------------------------------------------------------------------------------- /.limelightrc: -------------------------------------------------------------------------------- 1 | # pywal scheme - update if needed 2 | # source ~/.cache/wal/colors.sh 3 | 4 | limelight -m config debug_output on 5 | limelight -m config placement interior 6 | limelight -m config width 2 7 | limelight -m config radius 0.0 8 | limelight -m config active_color 0xFFBF616A 9 | limelight -m config normal_color 0xFF81A1C1 10 | -------------------------------------------------------------------------------- /.scripts/.border: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SPACETYPE="$(yabai -m query --spaces --space | jq '.type')" 4 | echo $SPACETYPE 5 | 6 | # If the spacetype is bsp then toggle window border, otherwise turn it off 7 | if [[ $SPACETYPE = '"bsp"' ]]; then 8 | # find total number of windows on current space that are not floating, not sticky, not minimized, but are visible. 9 | TOTAL="$(yabai -m query --windows --space | jq '.[] | select(.floating==0) | select(.sticky==0) | select(.visible==1) | select(.minimized==0) | length % 23 + 1' | wc -l)" 10 | 11 | if pgrep -x "limelight" >/dev/null 12 | then 13 | RUNNING='1' 14 | else 15 | RUNNING='0' 16 | fi 17 | 18 | # if more than 1 window is open on the current space 19 | if [[ $TOTAL -gt 1 ]]; then 20 | # if limelight is not running 21 | if [[ $RUNNING -eq '0' ]]; then 22 | # start limelight 23 | limelight -c ~/.limelightrc 24 | fi 25 | # else if there is only 1 window on the current space 26 | else 27 | # if limelight is running 28 | if [[ $RUNNING -eq '1' ]]; then 29 | # kill limelight 30 | killall limelight &> /dev/null 31 | fi 32 | fi 33 | 34 | # if the spacetype is not bsp, kill limelight 35 | else 36 | killall limelight &> /dev/null 37 | fi 38 | -------------------------------------------------------------------------------- /.scripts/.gaps: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # find total number of windows on current space that are not floating, not sticky, not minimized, but are visible. 4 | TOTAL="$(yabai -m query --windows --space | jq '.[] | select(.floating==0) | select(.sticky==0) | select(.visible==1) | select(.minimized==0) | length % 23 + 1' | wc -l)" 5 | 6 | # find the padding ammount on the current space 7 | CURRENT=$(yabai -m config --space $(yabai -m query --spaces --space | jq '(."index")') window_gap) 8 | 9 | # if the total is greater than 1, set padding, else disable padding. 10 | if [[ $TOTAL -gt 1 ]]; then 11 | if [[ $CURRENT -eq 0 ]]; then 12 | yabai -m space --gap abs:10; yabai -m space --padding abs:10:10:10:10 13 | fi 14 | else 15 | if [[ $CURRENT -ne 0 ]]; then 16 | yabai -m space --gap abs:0; yabai -m space --padding abs:0:0:0:0 17 | fi 18 | fi 19 | -------------------------------------------------------------------------------- /.scripts/.hide_bar: -------------------------------------------------------------------------------- 1 | if [[ $(yabai -m query --spaces --space | grep "native-fullscreen") == *"0"* ]]; then 2 | sketchybar -m --bar hidden=off 3 | else 4 | sketchybar -m --bar hidden=on 5 | fi -------------------------------------------------------------------------------- /.scripts/.space_change: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TYPE=$(yabai -m query --spaces --space | jq .type) 4 | 5 | if [[ $TYPE = *"bsp"* ]]; then 6 | yabai -m space --layout stack && open -gj 'swiftbar://refreshPlugin?name=yabai' 7 | elif [[ $TYPE = *"stack"* ]]; then 8 | yabai -m space --layout float && open -gj 'swiftbar://refreshPlugin?name=yabai' 9 | else 10 | yabai -m space --layout bsp && open -gj 'swiftbar://refreshPlugin?name=yabai' 11 | fi 12 | -------------------------------------------------------------------------------- /.scripts/.terminal: -------------------------------------------------------------------------------- 1 | osascript -e " 2 | tell application \"iTerm2\" 3 | activate 4 | set new_term to (create window with default profile) 5 | end tell" 6 | -------------------------------------------------------------------------------- /.scripts/.uber: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TOTAL="$(yabai -m query --windows --space | jq '.[] | select(.minimized==0) | .minimized' | wc -l)" 4 | 5 | if [[ $TOTAL -gt 1 ]]; then 6 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "clock-coffee" to true' 7 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "date-coffee" to true' 8 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "time-coffee" to true' 9 | echo $TOTAL 10 | else 11 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "clock-coffee" to false' 12 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "date-coffee" to false' 13 | osascript -e 'tell application id "tracesOf.Uebersicht" to set hidden of widget id "time-coffee" to false' 14 | echo $TOTAL 15 | fi 16 | -------------------------------------------------------------------------------- /.scripts/Unused/undock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true and local volume is true and free space is not equal to 0)' && SafeEjectGPU Eject 0xad06 4 | -------------------------------------------------------------------------------- /.scripts/color-scripts/.random-color: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | source "$(ls ~/color-scripts/color-scripts | shuf -n1)" 4 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/alpha: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: Ivo 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=134749#p134749 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${boldon}${redf} ██████ ${reset} ${boldon}${greenf}██████ ${reset}${boldon}${yellowf} ██████${reset} ${boldon}${bluef}██████ ${reset} ${boldon}${purplef} ██████${reset} ${boldon}${cyanf} ███████${reset} 38 | ${boldon}${redf} ████████${reset} ${boldon}${greenf}██ ██ ${reset}${boldon}${yellowf}██ ${reset} ${boldon}${bluef}██ ██${reset} ${boldon}${purplef}██████ ${reset} ${boldon}${cyanf}█████████${reset} 39 | ${redf} ██ ████${reset} ${greenf}██ ████ ${reset}${yellowf}████ ${reset} ${bluef}████ ██${reset} ${purplef}████ ${reset} ${cyanf}█████ ${reset} 40 | ${redf} ██ ██${reset} ${greenf}██████ ${reset}${yellowf}████████${reset} ${bluef}██████ ${reset} ${purplef}████████${reset} ${cyanf}██ ${reset} 41 | 42 | EOF 43 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/arch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Ivo 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=237794#p237794 5 | # ANSI Color -- use these variables to easily have different color 6 | # and format output. Make sure to output the reset sequence after 7 | # colors (f = foreground, b = background), and use the 'off' 8 | # feature for anything you turn on. 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; 16 | cyanf="${esc}[36m"; purplef="${esc}[35m" 17 | 18 | boldon="${esc}[1m"; 19 | reset="${esc}[0m" 20 | } 21 | 22 | # note in this first use that switching colors doesn't require a reset 23 | # first - the new color overrides the old one. 24 | 25 | initializeANSI 26 | 27 | cat << EOF 28 | 29 | ${boldon}${redf} ■ ${boldon}${greenf} ■ ${boldon}${yellowf} ■ ${boldon}${bluef} ■ ${boldon}${purplef} ■ ${boldon}${cyanf} ■ ${reset} 30 | ${boldon}${redf} ■■■ ${boldon}${greenf} ■■■ ${boldon}${yellowf} ■■■ ${boldon}${bluef} ■■■ ${boldon}${purplef} ■■■ ${boldon}${cyanf} ■■■ ${reset} 31 | ${boldon}${redf} ■■■■■ ${boldon}${greenf} ■■■■■ ${boldon}${yellowf} ■■■■■ ${boldon}${bluef} ■■■■■ ${boldon}${purplef} ■■■■■ ${boldon}${cyanf} ■■■■■ ${reset} 32 | ${redf} ■( )■ ${greenf} ■( )■ ${yellowf} ■( )■ ${bluef} ■( )■ ${purplef} ■( )■ ${cyanf} ■( )■ ${reset} 33 | ${redf} ■■■■ ■■■■ ${greenf} ■■■■ ■■■■ ${yellowf} ■■■■ ■■■■ ${bluef} ■■■■ ■■■■ ${purplef} ■■■■ ■■■■ ${cyanf} ■■■■ ■■■■ ${reset} 34 | ${redf} ■■ ■■ ${greenf} ■■ ■■ ${yellowf} ■■ ■■ ${bluef} ■■ ■■ ${purplef} ■■ ■■ ${cyanf} ■■ ■■ ${reset} 35 | 36 | EOF 37 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/blocks1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; } 3 | printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')" 4 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/colorbars: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # colorbars - smpte color bars in sh 4 | # http://git.io/colorbars 5 | 6 | echo 7 | 8 | for y in $(seq 0 13); do 9 | printf %s ' ' 10 | for color in 7 3 6 2 5 1 4; do 11 | tput setab ${color} 12 | printf %s ' ' 13 | done 14 | tput sgr0 15 | echo 16 | done 17 | 18 | for y in 0 1; do 19 | printf %s ' ' 20 | for color in 4 0 5 0 6 0 7; do 21 | tput setab ${color} 22 | printf %s ' ' 23 | done 24 | tput sgr0 25 | echo 26 | done 27 | 28 | for y in $(seq 0 4); do 29 | printf %s ' ' 30 | for color in 4 4 4 4 4 7 7 7 7 7 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0; do 31 | tput setab ${color} 32 | printf %s ' ' 33 | done 34 | tput sgr0 35 | echo 36 | done 37 | 38 | echo 39 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/colortest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Daniel Crisman's ANSI color chart script from 4 | # The Bash Prompt HOWTO: 6.1. Colours 5 | # http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html 6 | # 7 | # This function echoes a bunch of color codes to the 8 | # terminal to demonstrate what's available. Each 9 | # line is the color code of one forground color, 10 | # out of 17 (default + 16 escapes), followed by a 11 | # test use of that color on all nine background 12 | # colors (default + 8 escapes). 13 | 14 | T='•••' # The text for the color test 15 | 16 | echo -e "\n def 40m 41m 42m 43m 44m 45m 46m 47m"; 17 | 18 | for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ 19 | '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ 20 | ' 36m' '1;36m' ' 37m' '1;37m'; 21 | 22 | do FG=${FGs// /} 23 | echo -en " $FGs \033[$FG $T " 24 | 25 | for BG in 40m 41m 42m 43m 44m 45m 46m 47m; 26 | do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; 27 | done 28 | echo; 29 | done 30 | echo 31 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/colortest-slim: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Author: machinebacon 4 | # Source: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=1656#p33237 5 | 6 | T='*' # The test text 7 | 8 | echo -e "\n 40m 41m 42m 43m\ 9 | 44m 45m 46m 47m"; 10 | 11 | for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ 12 | '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ 13 | ' 36m' '1;36m' ' 37m' '1;37m'; 14 | do FG=${FGs// /} 15 | echo -en " $FGs \033[$FG $T " 16 | for BG in 40m 41m 42m 43m 44m 45m 46m 47m; 17 | do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; 18 | done 19 | echo; 20 | done 21 | echo 22 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/colorview: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Original: http://frexx.de/xterm-256-notes/ 4 | # http://frexx.de/xterm-256-notes/data/colortable16.sh 5 | # Modified by Aaron Griffin 6 | # and further by Kazuo Teramoto 7 | 8 | FGNAMES=(' black ' ' red ' ' green ' ' yellow' ' blue ' 'magenta' ' cyan ' ' white ') 9 | BGNAMES=('DFT' 'BLK' 'RED' 'GRN' 'YEL' 'BLU' 'MAG' 'CYN' 'WHT') 10 | 11 | echo " ┌──────────────────────────────────────────────────────────────────────────┐" 12 | for b in {0..8}; do 13 | ((b>0)) && bg=$((b+39)) 14 | 15 | echo -en "\033[0m ${BGNAMES[b]} │ " 16 | 17 | for f in {0..7}; do 18 | echo -en "\033[${bg}m\033[$((f+30))m ${FGNAMES[f]} " 19 | done 20 | 21 | echo -en "\033[0m │" 22 | echo -en "\033[0m\n\033[0m │ " 23 | 24 | for f in {0..7}; do 25 | echo -en "\033[${bg}m\033[1;$((f+30))m ${FGNAMES[f]} " 26 | done 27 | 28 | echo -en "\033[0m │" 29 | echo -e "\033[0m" 30 | 31 | ((b<8)) && 32 | echo " ├──────────────────────────────────────────────────────────────────────────┤" 33 | done 34 | echo " └──────────────────────────────────────────────────────────────────────────┘" 35 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/colorwheel: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: baskerville 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=288344#p288344 5 | 6 | printf "\033[0m 7 | \033[49;35m|\033[49;31m|\033[101;31m|\033[41;97m|\033[49;91m|\033[49;93m|\033[0m 8 | \033[105;35m|\033[45;97m|\033[49;97m||\033[100;97m||\033[49;37m||\033[103;33m|\033[43;97m|\033[0m 9 | \033[49;95m|\033[49;94m|\033[100;37m||\033[40;97m||\033[40;37m||\033[49;33m|\033[49;32m|\033[0m 10 | \033[104;34m|\033[44;97m|\033[49;90m||\033[40;39m||\033[49;39m||\033[102;32m|\033[42;97m|\033[0m 11 | \033[49;34m|\033[49;36m|\033[106;36m|\033[46;97m|\033[49;96m|\033[49;92m|\033[0m 12 | 13 | " 14 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/crunch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: gutterslob 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=148022#p148022 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${reset}${redf} ██ ██ ${reset}${greenf} ██ ██ ${reset}${yellowf} ██ ██ ${reset}${bluef} ██ ██ ${reset}${purplef} ██ ██ ${reset}${cyanf} ██ ██ ${reset} 38 | ${reset}${redf}██████████ ${reset}${greenf} ██████████ ${reset}${yellowf} ██████████ ${reset}${bluef} ██████████ ${reset}${purplef} ██████████ ${reset} ${cyanf}██████████ ${reset} 39 | ${reset}${redf} ██${boldon}██${boldoff}██ ${reset}${greenf} ██${boldon}██${boldoff}██ ${reset}${yellowf} ██${boldon}██${boldoff}██ ${reset}${bluef} ██${boldon}██${boldoff}██ ${reset}${purplef} ██${boldon}██${boldoff}██ ${reset}${cyanf} ██${boldon}██${boldoff}██ ${reset} 40 | ${reset}${redf}██████████ ${reset}${greenf} ██████████ ${reset}${yellowf} ██████████ ${bluef} ██████████ ${purplef} ██████████ ${reset}${cyanf} ██████████${reset} 41 | ${reset}${redf} ██ ██ ${reset}${greenf} ██ ██ ${reset}${yellowf} ██ ██ ${reset}${bluef} ██ ██ ${reset}${purplef} ██ ██ ${reset}${cyanf} ██ ██ ${reset} 42 | ${reset} 43 | EOF 44 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/crunchbang-mini: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: thevdude 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=147530#p147530 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${reset}${redf}▄█▄█▄ ${reset}${boldon}${redf}█ ${reset}${greenf}▄█▄█▄ ${reset}${boldon}${greenf}█ ${reset}${yellowf}▄█▄█▄ ${reset}${boldon}${yellowf}█ ${reset}${bluef}▄█▄█▄ ${reset}${boldon}${bluef}█ ${reset}${purplef}▄█▄█▄ ${reset}${boldon}${purplef}█ ${reset}${cyanf}▄█▄█▄ ${reset}${boldon}${cyanf}█${reset} 38 | ${reset}${redf}▄█▄█▄ ${reset}${boldon}${redf}▀ ${reset}${greenf}▄█▄█▄ ${reset}${boldon}${greenf}▀ ${reset}${yellowf}▄█▄█▄ ${reset}${boldon}${yellowf}▀ ${reset}${bluef}▄█▄█▄ ${reset}${boldon}${bluef}▀ ${reset}${purplef}▄█▄█▄ ${reset}${boldon}${purplef}▀ ${reset}${cyanf}▄█▄█▄ ${reset}${boldon}${cyanf}▀${reset} 39 | ${reset}${redf} ▀ ▀ ${reset}${boldon}${redf}▀ ${reset}${greenf} ▀ ▀ ${reset}${boldon}${greenf}▀ ${reset}${yellowf} ▀ ▀ ${reset}${boldon}${yellowf}▀ ${reset}${bluef} ▀ ▀ ${reset}${boldon}${bluef}▀ ${reset}${purplef} ▀ ▀ ${reset}${boldon}${purplef}▀ ${reset}${cyanf} ▀ ▀ ${reset}${boldon}${cyanf}▀${reset} 40 | EOF 41 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/dotx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo -e '\n\e[01;30m ▚ \e[0;30m ▞ \e[01;31m ▚ \e[0;31m ▞ \e[01;32m ▚ \e[0;32m ▞ \e[01;33m ▚ \e[0;33m ▞ \e[01;34m ▚ \e[0;34m ▞ \e[01;35m ▚ \e[0;35m ▞ \e[01;36m ▚ \e[0;36m ▞ \e[01;37m ▚ \e[0;37m ▞ ' 3 | echo -e '\n\e[01;30m ▞ \e[0;30m ▚ \e[01;31m ▞\e[0;31m ▚ \e[01;32m ▞ \e[0;32m ▚ \e[01;33m ▞ \e[0;33m ▚ \e[01;34m ▞ \e[0;34m ▚ \e[01;35m ▞ \e[0;35m ▚ \e[01;36m ▞ \e[0;36m ▚ \e[01;37m ▞ \e[0;37m ▚ \n' 4 | exit 5 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/elfman: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: thevdude 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=144700#p144700 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${boldon}${whitef} ▄▄▄${reset} 38 | ${boldon}${whitef} ▄█████▄▄ ${reset} 39 | ${boldon}${whitef}███${cyanb}▀▀▀▀${blackb}▀${cyanb}▀${blackb}▀${cyanb}▀${reset} 40 | ${boldon}${whitef}███${cyanb}▄ ${boldoff}${blackf}▀ ▀${reset}${cyanf}▀${reset} 41 | ${boldon}${whitef} ▄${cyanb} ${reset}${boldon}${whitef}█████▄ ${boldoff}${redf}█▄${reset} 42 | ${boldoff}${redf}▀▀${reset}${boldon}${redb}${whitef}▄${cyanb}▄ ${redb}▄▄▄${reset}${boldoff}${redf}▀██▀${reset} 43 | ${boldon}${whitef} ██▀▀▀██▀ ${boldoff}${redf}▀${reset} 44 | ${boldon}${whitef} ▀▀▀▀ ▀▀▀▀${reset} 45 | 46 | EOF 47 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/faces: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: pfh 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=127737#p127737 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${white}╔══════════════════════════════════════════════════════════════════╗ 38 | ${white}║ ${redf} ▄█ █▄${reset} ${greenf} ▄█ █▄${reset} ${yellowf} ▄█ █▄${reset} ${bluef} ▄█ █▄${reset} ${purplef} ▄█ █▄${reset} ${cyanf} ▄█ █▄${reset} ${white}║ 39 | ${white}║ ${boldon}${redf}▄█◄► ◄►█▄${reset} ${boldon}${greenf}▄█◄► ◄►█▄${reset} ${boldon}${yellowf}▄█◄► ◄►█▄${reset} ${boldon}${bluef}▄█◄► ◄►█▄${reset} ${boldon}${purplef}▄█◄► ◄►█▄${reset} ${boldon}${cyanf}▄█◄► ◄►█▄${reset} ${white}║ 40 | ${white}║ ${boldon}${redf}▀█  █▀${reset} ${boldon}${greenf}▀█  █▀${reset} ${boldon}${yellowf}▀█  █▀${reset} ${boldon}${bluef}▀█  █▀${reset} ${boldon}${purplef}▀█  █▀${reset} ${boldon}${cyanf}▀█  █▀${reset} ${white}║ 41 | ${white}║ ${redf} ▀█ █▀${reset} ${greenf} ▀█ █▀${reset} ${yellowf} ▀█ █▀${reset} ${bluef} ▀█ █▀${reset} ${purplef} ▀█ █▀${reset} ${cyanf} ▀█ █▀${reset} ${white}║ 42 | ${white}╚══════════════════════════════════════════════════════════════════╝ 43 | 44 | EOF 45 | 46 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/fade: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: pfh 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=127737#p127737 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${redf}▒▒▒▒${reset} ${boldon}${redf}▒▒${reset} ${greenf}▒▒▒▒${reset} ${boldon}${greenf}▒▒${reset} ${yellowf}▒▒▒▒${reset} ${boldon}${yellowf}▒▒${reset} ${bluef}▒▒▒▒${reset} ${boldon}${bluef}▒▒${reset} ${purplef}▒▒▒▒${reset} ${boldon}${purplef}▒▒${reset} ${cyanf}▒▒▒▒${reset} ${boldon}${cyanf}▒▒${reset} 38 | ${redf}▒▒ ■${reset} ${boldon}${redf}▒▒${reset} ${greenf}▒▒ ■${reset} ${boldon}${greenf}▒▒${reset} ${yellowf}▒▒ ■${reset} ${boldon}${yellowf}▒▒${reset} ${bluef}▒▒ ■${reset} ${boldon}${bluef}▒▒${reset} ${purplef}▒▒ ■${reset} ${boldon}${purplef}▒▒${reset} ${cyanf}▒▒ ■${reset} ${boldon}${cyanf}▒▒${reset} 39 | ${redf}▒▒ ${reset}${boldon}${redf}▒▒▒▒${reset} ${greenf}▒▒ ${reset}${boldon}${greenf}▒▒▒▒${reset} ${yellowf}▒▒ ${reset}${boldon}${yellowf}▒▒▒▒${reset} ${bluef}▒▒ ${reset}${boldon}${bluef}▒▒▒▒${reset} ${purplef}▒▒ ${reset}${boldon}${purplef}▒▒▒▒${reset} ${cyanf}▒▒ ${reset}${boldon}${cyanf}▒▒▒▒${reset} 40 | 41 | EOF 42 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/ghosts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=157979#p157979 5 | # Initializing mod by lolilolicon from Archlinux 6 | 7 | f=3 b=4 8 | for j in f b; do 9 | for i in {0..7}; do 10 | printf -v $j$i %b "\e[${!j}${i}m" 11 | done 12 | done 13 | bld=$'\e[1m' 14 | rst=$'\e[0m' 15 | inv=$'\e[7m' 16 | cat << EOF 17 | 18 | $f1 ▄▄▄ $f2 ▄▄▄ $f3 ▄▄▄ $f4 ▄▄▄ $f5 ▄▄▄ $f6 ▄▄▄ 19 | $f1 ▀█▀██ ▄ $f2 ▀█▀██ ▄ $f3 ▀█▀██ ▄ $f4 ▀█▀██ ▄ $f5 ▀█▀██ ▄ $f6 ▀█▀██ ▄ 20 | $f1 ▀▄██████▀ $f2 ▀▄██████▀ $f3 ▀▄██████▀ $f4 ▀▄██████▀ $f5 ▀▄██████▀ $f6 ▀▄██████▀ 21 | $f1 ▀█████ $f2 ▀█████ $f3 ▀█████ $f4 ▀█████ $f5 ▀█████ $f6 ▀█████ 22 | $f1 ▀▀▀▀▄ $f2 ▀▀▀▀▄ $f3 ▀▀▀▀▄ $f4 ▀▀▀▀▄ $f5 ▀▀▀▀▄ $f6 ▀▀▀▀▄ 23 | $bld 24 | $f1 ▄▄▄ $f2 ▄▄▄ $f3 ▄▄▄ $f4 ▄▄▄ $f5 ▄▄▄ $f6 ▄▄▄ 25 | $f1 ▀█▀██ ▄ $f2 ▀█▀██ ▄ $f3 ▀█▀██ ▄ $f4 ▀█▀██ ▄ $f5 ▀█▀██ ▄ $f6 ▀█▀██ ▄ 26 | $f1 ▀▄██████▀ $f2 ▀▄██████▀ $f3 ▀▄██████▀ $f4 ▀▄██████▀ $f5 ▀▄██████▀ $f6 ▀▄██████▀ 27 | $f1 ▀█████ $f2 ▀█████ $f3 ▀█████ $f4 ▀█████ $f5 ▀█████ $f6 ▀█████ 28 | $f1 ▀▀▀▀▄ $f2 ▀▀▀▀▄ $f3 ▀▀▀▀▄ $f4 ▀▀▀▀▄ $f5 ▀▀▀▀▄ $f6 ▀▀▀▀▄ 29 | $rst 30 | EOF 31 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/illumina: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: venam 4 | # Source: https://nixers.net/showthread.php?tid=1921 5 | 6 | cat << EOF 7 | ._________________________________.  8 | |       |  9 | |   _   |  10 | |  //\  |  11 | |  //-- // \ ========,  |  12 | |  // // \ /  |  13 | |  // // \ /  |  14 | |  __________ ___  __ _________ |  15 | |  / \    // //  |  16 | |  / \ // //  |  17 | |  /__________________//  |  18 | |  \ //  |  19 | |  \//  |  20 | |   "   |  21 | |        |  22 | '---------------------------------'  23 | EOF 24 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/mouseface: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | 8 | # Author: ivo 9 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=130522#p130522 10 | 11 | initializeANSI() 12 | { 13 | esc="" 14 | 15 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 16 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 17 | cyanf="${esc}[36m"; whitef="${esc}[37m" 18 | 19 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 20 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 21 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 22 | 23 | boldon="${esc}[1m"; boldoff="${esc}[22m" 24 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 25 | ulon="${esc}[4m"; uloff="${esc}[24m" 26 | invon="${esc}[7m"; invoff="${esc}[27m" 27 | 28 | reset="${esc}[0m" 29 | } 30 | 31 | # note in this first use that switching colors doesn't require a reset 32 | # first - the new color overrides the old one. 33 | 34 | initializeANSI 35 | 36 | cat << EOF 37 | 38 | ${boldon}${redf} █ █ ${reset} ${boldon}${greenf}█ █ ${reset} ${boldon}${yellowf}█ █ ${reset} ${boldon}${bluef}█ █ ${reset} ${boldon}${purplef}█ █ ${reset} ${boldon}${cyanf}█ █ ${reset} 39 | ${boldon}${redf} ■ ■ ${reset} ${boldon}${greenf} ■ ■ ${reset} ${boldon}${yellowf} ■ ■ ${reset} ${boldon}${bluef} ■ ■ ${reset} ${boldon}${purplef} ■ ■ ${reset} ${boldon}${cyanf} ■ ■ ${reset} 40 | ${boldon}${redf} =■= ${reset} ${boldon}${greenf} =■= ${reset} ${boldon}${yellowf} =■= ${reset} ${boldon}${bluef} =■= ${reset} ${boldon}${purplef} =■= ${reset} ${boldon}${cyanf} =■= ${reset} 41 | 42 | ${redf} █=@=█ ${reset} ${greenf}█=@=█ ${reset} ${yellowf}█=@=█ ${reset} ${bluef}█=@=█ ${reset} ${purplef}█=@=█ ${reset} ${cyanf}█=@=█ ${reset} 43 | ${redf} ■ ■ ${reset} ${greenf} ■ ■ ${reset} ${yellowf} ■ ■ ${reset} ${bluef} ■ ■ ${reset} ${purplef} ■ ■ ${reset} ${cyanf} ■ ■ ${reset} 44 | ${redf} =■= ${reset} ${greenf} =■= ${reset} ${yellowf} =■= ${reset} ${bluef} =■= ${reset} ${purplef} =■= ${reset} ${cyanf} =■= ${reset} 45 | 46 | EOF 47 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/bars: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=139126#p139126 5 | # Initializing mod by lolilolicon from Archlinux 6 | # 7 | 8 | f=3 b=4 9 | for j in f b; do 10 | for i in {0..7}; do 11 | printf -v $j$i %b "\e[${!j}${i}m" 12 | done 13 | done 14 | bld=$'\e[1m' 15 | rst=$'\e[0m' 16 | inv=$'\e[7m' 17 | 18 | cat << EOF 19 | 20 | $f1▬▬▬▬▬ $f2▬▬▬▬▬ $f3▬▬▬▬▬ $f4▬▬▬▬▬ $f5▬▬▬▬▬ $f6▬▬▬▬▬ 21 | $bld$f1▬▬▬▬▬ $f2▬▬▬▬▬ $f3▬▬▬▬▬ $f4▬▬▬▬▬ $f5▬▬▬▬▬ $f6▬▬▬▬▬ 22 | $rst 23 | EOF 24 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/guns: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=151602#p151602 5 | # Initializing mod by lolilolicon from Archlinux 6 | 7 | 8 | f=3 b=4 9 | for j in f b; do 10 | for i in {0..7}; do 11 | printf -v $j$i %b "\e[${!j}${i}m" 12 | done 13 | done 14 | bld=$'\e[1m' 15 | rst=$'\e[0m' 16 | inv=$'\e[7m' 17 | cat << EOF 18 | 19 | $f1 ▀▄▄███████████ $f2 ▀▄▄███████████ $f3 ▀▄▄███████████ $f4 ▀▄▄███████████ $f5 ▀▄▄███████████ $f6 ▀▄▄███████████ 20 | $f1 ▄███▀█▀▀▀ $f2 ▄███▀█▀▀▀ $f3 ▄███▀█▀▀▀ $f4 ▄███▀█▀▀▀ $f5 ▄███▀█▀▀▀ $f6 ▄███▀█▀▀▀ 21 | $f1 ▐███▄▀ $f2▐███▄▀ $f3▐███▄▀ $f4▐███▄▀ $f5▐███▄▀ $f6▐███▄▀ 22 | $f1 ▐███ $f2▐███ $f3▐███ $f4▐███ $f5▐███ $f6▐███ 23 | $f1 ▀▀▀ $f2 ▀▀▀ $f3 ▀▀▀ $f4 ▀▀▀ $f5 ▀▀▀ $f6 ▀▀▀ 24 | $bld 25 | $f1 ▀▄▄███████████ $f2 ▀▄▄███████████ $f3 ▀▄▄███████████ $f4 ▀▄▄███████████ $f5 ▀▄▄███████████ $f6 ▀▄▄███████████ 26 | $f1 ▄███▀█▀▀▀ $f2 ▄███▀█▀▀▀ $f3 ▄███▀█▀▀▀ $f4 ▄███▀█▀▀▀ $f5 ▄███▀█▀▀▀ $f6 ▄███▀█▀▀▀ 27 | $f1 ▐███▄▀ $f2▐███▄▀ $f3▐███▄▀ $f4▐███▄▀ $f5▐███▄▀ $f6▐███▄▀ 28 | $f1 ▐███ $f2▐███ $f3▐███ $f4▐███ $f5▐███ $f6▐███ 29 | $f1 ▀▀▀ $f2 ▀▀▀ $f3 ▀▀▀ $f4 ▀▀▀ $f5 ▀▀▀ $f6 ▀▀▀ 30 | $rst 31 | EOF 32 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/hex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Author: SuNjACk 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=135226#p135226 5 | 6 | xdef="$HOME/.Xresources" 7 | colors=( $( sed -re '/^!/d; /^$/d; /^#/d; s/(\*color)([0-9]):/\10\2:/g;' $xdef | grep 'color[01][0-9]:' | sort | sed 's/^.*: *//g' ) ) 8 | 9 | echo -e "\e[1;37m 10 | Black Red Green Yellow Blue Magenta Cyan White 11 | ──────────────────────────────────────────────────────────────────────\e[0m" 12 | for i in {0..7}; do echo -en "\e[$((30+$i))m ${colors[i]} \e[0m"; done 13 | echo 14 | for i in {8..15}; do echo -en "\e[1;$((22+$i))m ${colors[i]} \e[0m"; done 15 | echo -e "\n" 16 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/hex-block: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # source: Meyithi, https://bbs.archlinux.org/viewtopic.php?pid=1010829#p1010829 3 | 4 | xdef="$HOME/.Xresources" 5 | 6 | colors=( $( sed -re '/^!/d; /^$/d; /^#/d; s/(\*color)([0-9]):/\10\2:/g;' $xdef | grep 'color[01][0-9]:' | sort | sed 's/^.*: *//g' ) 7 | ) 8 | 9 | echo 10 | for i in {0..7}; do echo -en "\e[$((30+$i))m ${colors[i]} \u2588\u2588 \e[0m"; done 11 | echo 12 | for i in {8..15}; do echo -en "\e[1;$((22+$i))m ${colors[i]} \u2588\u2588 \e[0m"; done 13 | echo -e "\n" 14 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/pacman: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script featuring PACMAN 4 | # Author: pfh 5 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=144481#p144481 6 | # Initializing procedure by lolilolicon 7 | 8 | f=3 b=4 9 | for j in f b; do 10 | for i in {0..7}; do 11 | printf -v $j$i %b "\e[${!j}${i}m" 12 | done 13 | done 14 | bld=$'\e[1m' 15 | rst=$'\e[0m' 16 | inv=$'\e[7m' 17 | 18 | cat << EOF 19 | 20 | $rst 21 | $f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄ 22 | $f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7███$f2██$f7███$f2█▄ $f4▄█$f7███$f4██$f7███$f4█▄ $f5▄█$f7███$f5██$f7███$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄ 23 | $f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7█ █$f2██$f7█ █$f2██ $f4██$f7█ █$f4██$f7█ █$f4██ $f5██$f7█ █$f5██$f7█ █$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█ 24 | $f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████ 25 | $f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██ 26 | $f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀ 27 | $bld 28 | $f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄ 29 | $f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7█ █$f2██$f7█ █$f2█▄ $f4▄█$f7█ █$f4██$f7█ █$f4█▄ $f5▄█$f7█ █$f5██$f7█ █$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄ 30 | $f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7███$f2██$f7███$f2██ $f4██$f7███$f4██$f7███$f4██ $f5██$f7███$f5██$f7███$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█ 31 | $f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████ 32 | $f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██ 33 | $f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀ 34 | $rst 35 | 36 | EOF 37 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/panes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Author: GekkoP 4 | # Source: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=1656#p33189 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 | 17 | cat << EOF 18 | 19 | $f1███$d▄$t $f2███$d▄$t $f3███$d▄$t $f4███$d▄$t $f5███$d▄$t $f6███$d▄$t $f7███$d▄$t 20 | $f1███$d█$t $f2███$d█$t $f3███$d█$t $f4███$d█$t $f5███$d█$t $f6███$d█$t $f7███$d█$t 21 | $f1███$d█$t $f2███$d█$t $f3███$d█$t $f4███$d█$t $f5███$d█$t $f6███$d█$t $f7███$d█$t 22 | $d$f1 ▀▀▀ $f2▀▀▀ $f3▀▀▀ $f4▀▀▀ $f5▀▀▀ $f6▀▀▀ $f7▀▀▀ 23 | EOF 24 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/pipes2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | declare -i f=75 s=13 r=2000 t=0 c=1 n=0 l=0 4 | declare -ir w=$(tput cols) h=$(tput lines) 5 | declare -i x=$((w/2)) y=$((h/2)) 6 | declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93" 7 | [10]="\x9b" [11]="\x81" [12]="\x93" 8 | [21]="\x97" [22]="\x83" [23]="\x9b" 9 | [30]="\x97" [32]="\x8f" [33]="\x81" ) 10 | 11 | OPTIND=1 12 | while getopts "f:s:r:h" arg; do 13 | case $arg in 14 | f) ((f=($OPTARG>19 && $OPTARG<101)?$OPTARG:$f));; 15 | s) ((s=($OPTARG>4 && $OPTARG<16 )?$OPTARG:$s));; 16 | r) ((r=($OPTARG>0)?$OPTARG:$r));; 17 | h) echo -e "Usage: pipes [OPTION]..." 18 | echo -e "Animated pipes terminal screensaver.\n" 19 | echo -e " -f [20-100]\tframerate (D=75)." 20 | echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." 21 | echo -e " -r LIMIT\treset after x characters (D=2000)." 22 | echo -e " -h\t\thelp (this screen).\n" 23 | exit 0;; 24 | esac 25 | done 26 | 27 | tput smcup 28 | tput reset 29 | tput civis 30 | while ! read -t0.0$((1000/$f)) -n1; do 31 | # New position: 32 | (($l%2)) && ((x+=($l==1)?1:-1)) 33 | ((!($l%2))) && ((y+=($l==2)?1:-1)) 34 | 35 | # Loop on edges (change color on loop): 36 | ((c=($x>$w || $x<0 || $y>$h || $y<0)?($RANDOM%7-1):$c)) 37 | ((x=($x>$w)?0:(($x<0)?$w:$x))) 38 | ((y=($y>$h)?0:(($y<0)?$h:$y))) 39 | 40 | # New random direction: 41 | ((n=$RANDOM%$s-1)) 42 | ((n=($n>1||$n==0)?$l:$l+$n)) 43 | ((n=($n<0)?3:$n%4)) 44 | 45 | # Print: 46 | tput cup $y $x 47 | echo -ne "\033[1;3${c}m\xe2\x94${v[$l$n]}" 48 | (($t>$r)) && tput reset && tput civis && t=0 || ((t++)) 49 | l=$n 50 | done 51 | tput rmcup 52 | 53 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/pipes2-slim: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | declare -i f=75 s=13 r=2000 t=0 c=1 n=0 l=0 4 | declare -ir w=$(tput cols) h=$(tput lines) 5 | declare -i x=$((w/2)) y=$((h/2)) 6 | 7 | declare -ar v=( [00]="\x82" [01]="\x8c" [03]="\x90" #### 8 | [10]="\x98" [11]="\x80" [12]="\x90" # Normal UTF-8 box characters. 9 | [21]="\x94" [22]="\x82" [23]="\x98" # (These are the default for they are supported almost everywhere.) 10 | [30]="\x94" [32]="\x8c" [33]="\x80" ) #### 11 | 12 | # declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93" #### 13 | # [10]="\x9b" [11]="\x81" [12]="\x93" # Heavy UTF-8 box characters. 14 | # [21]="\x97" [22]="\x83" [23]="\x9b" # (Uncomment only if your terminal supports it) 15 | # [30]="\x97" [32]="\x8f" [33]="\x81" ) #### 16 | 17 | OPTIND=1 18 | while getopts "f:s:r:h" arg; do 19 | case $arg in 20 | f) ((f=($OPTARG>19 && $OPTARG<101)?$OPTARG:$f));; 21 | s) ((s=($OPTARG>4 && $OPTARG<16 )?$OPTARG:$s));; 22 | r) ((r=($OPTARG>0)?$OPTARG:$r));; 23 | h) echo -e "Usage: pipes [OPTION]..." 24 | echo -e "Animated pipes terminal screensaver.\n" 25 | echo -e " -f [20-100]\tframerate (D=75)." 26 | echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." 27 | echo -e " -r LIMIT\treset after x characters (D=2000)." 28 | echo -e " -h\t\thelp (this screen).\n" 29 | exit 0;; 30 | esac 31 | done 32 | 33 | tput smcup 34 | tput reset 35 | tput civis 36 | 37 | trap "tput rmcup; tput reset; exit" SIGINT 38 | 39 | while true; do 40 | # New position: 41 | (($l%2)) && ((x+=($l==1)?1:-1)) 42 | ((!($l%2))) && ((y+=($l==2)?1:-1)) 43 | 44 | # Loop on edges (change color on loop): 45 | ((c=($x>$w || $x<0 || $y>$h || $y<0)?($RANDOM%7):$c)) 46 | ((x=($x>$w)?0:(($x<0)?$w:$x))) 47 | ((y=($y>$h)?0:(($y<0)?$h:$y))) 48 | 49 | # New random direction: 50 | ((n=$RANDOM%$s-1)) 51 | ((n=($n>1||$n==0)?$l:$l+$n)) 52 | ((n=($n<0)?3:$n%4)) 53 | 54 | # Print: 55 | tput cup $y $x 56 | printf "\033[1;3${c}m\xe2\x94${v[$l$n]}" 57 | (($t>$r)) && tput reset && tput civis && t=0 || ((t++)) 58 | l=$n 59 | sleep $(echo "scale=5;1/$f"|bc) 60 | done 61 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/space-invaders: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script featuring Space Invaders 4 | 5 | # Original: http://crunchbanglinux.org/forums/post/126921/#p126921 6 | # Modified by lolilolicon 7 | 8 | f=3 b=4 9 | for j in f b; do 10 | for i in {0..7}; do 11 | printf -v $j$i %b "\e[${!j}${i}m" 12 | done 13 | done 14 | bld=$'\e[1m' 15 | rst=$'\e[0m' 16 | 17 | cat << EOF 18 | 19 | $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst 20 | $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst 21 | $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst 22 | $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst 23 | 24 | $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst 25 | $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst 26 | $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst 27 | $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst 28 | 29 | 30 | $f7▌$rst 31 | 32 | $f7▌$rst 33 | 34 | $f7 ▄█▄ $rst 35 | $f7▄█████████▄$rst 36 | $f7▀▀▀▀▀▀▀▀▀▀▀$rst 37 | 38 | EOF 39 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/spectrum: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Author: crshd 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=128584#p128584 5 | 6 | echo 7 | 8 | for f in {0..6}; do 9 | echo -en "\033[$((f+41))m\033[$((f+30))m██▓▒░" 10 | done 11 | echo -en "\033[37m██\n" 12 | 13 | echo 14 | 15 | for f in {0..6}; do 16 | echo -en "\033[$((f+41))m\033[1;$((f+30))m██▓▒░" 17 | done 18 | echo -en "\033[1;37m██" 19 | 20 | echo -e "\033[0m" 21 | echo 22 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/not-working/zwaves: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=141044#p141044 5 | # Initializing mod by lolilolicon from Archlinux 6 | 7 | 8 | f=3 b=4 9 | for j in f b; do 10 | for i in {0..7}; do 11 | printf -v $j$i %b "\e[${!j}${i}m" 12 | done 13 | done 14 | bld=$'\e[1m' 15 | rst=$'\e[0m' 16 | inv=$'\e[7m' 17 | 18 | cat << EOF 19 | 20 | $f1▀■▄ $f2▀■▄ $f3▀■▄ $f4▀■▄ $f5▀■▄ $f6▀■▄ 21 | $bld$f1▀■▄ $f2▀■▄ $f3▀■▄ $f4▀■▄ $f5▀■▄ $f6▀■▄$rst 22 | 23 | EOF 24 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/pinguco: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Author: lantlos 3 | 4 | initializeANSI() 5 | { 6 | esc="" 7 | 8 | blackf="${esc}[31m"; redf="${esc}[31m"; greenf="${esc}[32m" 9 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 10 | cyanf="${esc}[36m"; whitef="${esc}[37m" 11 | 12 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 13 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 14 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 15 | 16 | boldon="${esc}[1m"; boldoff="${esc}[22m" 17 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 18 | ulon="${esc}[4m"; uloff="${esc}[24m" 19 | invon="${esc}[7m"; invoff="${esc}[27m" 20 | 21 | reset="${esc}[0m" 22 | } 23 | 24 | initializeANSI 25 | 26 | cat << EOF 27 | 28 | ${boldon}${blackf} ██████${reset} 29 | ${boldon}${blackf}██${reset}██${reset}${bluef}██${reset}${boldon}${blackf}██${reset}${bluef}██${reset} 30 | ${boldon}${blackf}██${reset}██${bluef}██${reset}${boldon}${blackf}██${reset}${bluef}██${reset} 31 | ${boldon}${blackf}██████${reset}${purplef}██████${reset} 32 | ${boldon}${blackf}████${reset}████${boldon}${blackf}██${reset} 33 | ${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset} 34 | ${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset} 35 | ${boldon}${blackf}████${reset}████████${boldon}${blackf}██${reset} 36 | ${boldon}${blackf}████${reset}████${boldon}${blackf}██${reset} 37 | ${boldon}${blackf}███${reset}${purplef}███ ████${reset} 38 | 39 | EOF 40 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/rails: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: pfh 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=127064#p127064 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | 33 | initializeANSI 34 | 35 | cat << EOF 36 | 37 | ${redf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ ${greenf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ ${yellowf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ 38 | ${boldon}${redf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ ${greenf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ ${yellowf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝${reset} 39 | ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 40 | ${bluef}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ ${purplef}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ ${cyanf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ 41 | ${boldon}${bluef}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ ${purplef}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ ${cyanf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝${reset} 42 | 43 | 44 | EOF 45 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/rally-x: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=143700#p143700 5 | # Initializing mod by lolilolicon from Archlinux 6 | 7 | f=3 b=4 8 | for j in f b; do 9 | for i in {0..7}; do 10 | printf -v $j$i %b "\e[${!j}${i}m" 11 | done 12 | done 13 | bld=$'\e[1m' 14 | rst=$'\e[0m' 15 | inv=$'\e[7m' 16 | 17 | cat << EOF 18 | 19 | $f3 ▄ $f1 ▄▄ $f2 ▄▄ $f4 ▄▄ $f5 ▄▄ $f6 ▄▄ 20 | $f3 ███▄▄ $f1 ██▬██▬██ $f2 ██▬██▬██ $f4 ██▬██▬██ $f5 ██▬██▬██ $f6 ██▬██▬██ 21 | $f3 █████▀▀$f1 ████ $f2 ████ $f4 ████ $f5 ████ $f6 ████ 22 | $f3 █▀▀ $f1 ▄██ ██▄ $f2 ▄██ ██▄ $f4 ▄██ ██▄ $f5 ▄██ ██▄ $f6 ▄██ ██▄ 23 | $f3 █ $f1 ▄▄▄▀█ █▀▄▄▄ $f2 ▄▄▄▀█ █▀▄▄▄ $f4 ▄▄▄▀█ █▀▄▄▄ $f5 ▄▄▄▀█ █▀▄▄▄ $f6 ▄▄▄▀█ █▀▄▄▄ 24 | $f3▄█▄ $f1 ███▀████▀███ $f2 ███▀████▀███ $f4 ███▀████▀███ $f5 ███▀████▀███ $f6 ███▀████▀███ 25 | $f1 ▀ ▀ $f2 ▀ ▀ $f4 ▀ ▀ $f5 ▀ ▀ $f6 ▀ ▀ 26 | $bld 27 | $f3 ▄ $f1 ▄▄ $f2 ▄▄ $f4 ▄▄ $f5 ▄▄ $f6 ▄▄ 28 | $f3 ███▄▄ $f1 ██▬██▬██ $f2 ██▬██▬██ $f4 ██▬██▬██ $f5 ██▬██▬██ $f6 ██▬██▬██ 29 | $f3 █████▀▀$f1 ████ $f2 ████ $f4 ████ $f5 ████ $f6 ████ 30 | $f3 █▀▀ $f1 ▄██ ██▄ $f2 ▄██ ██▄ $f4 ▄██ ██▄ $f5 ▄██ ██▄ $f6 ▄██ ██▄ 31 | $f3 █ $f1 ▄▄▄▀█ █▀▄▄▄ $f2 ▄▄▄▀█ █▀▄▄▄ $f4 ▄▄▄▀█ █▀▄▄▄ $f5 ▄▄▄▀█ █▀▄▄▄ $f6 ▄▄▄▀█ █▀▄▄▄ 32 | $f3▄█▄ $f1 ███▀████▀███ $f2 ███▀████▀███ $f4 ███▀████▀███ $f5 ███▀████▀███ $f6 ███▀████▀███ 33 | $f1 ▀ ▀ $f2 ▀ ▀ $f4 ▀ ▀ $f5 ▀ ▀ $f6 ▀ ▀ 34 | $rst 35 | EOF 36 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/spectrum: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Author: crshd 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=128584#p128584 5 | 6 | echo 7 | 8 | for f in {0..6}; do 9 | echo -en "\033[$((f+41))m\033[$((f+30))m██▓▒░" 10 | done 11 | echo -en "\033[37m██\n" 12 | 13 | echo 14 | 15 | for f in {0..6}; do 16 | echo -en "\033[$((f+41))m\033[1;$((f+30))m██▓▒░" 17 | done 18 | echo -en "\033[1;37m██" 19 | 20 | echo -e "\033[0m" 21 | echo 22 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/square: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: muzieca 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=127509#p127509 9 | initializeANSI() 10 | { 11 | esc="" 12 | 13 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 14 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 15 | cyanf="${esc}[36m"; whitef="${esc}[37m" 16 | 17 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 18 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 19 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 20 | 21 | boldon="${esc}[1m"; boldoff="${esc}[22m" 22 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 23 | ulon="${esc}[4m"; uloff="${esc}[24m" 24 | invon="${esc}[7m"; invoff="${esc}[27m" 25 | 26 | reset="${esc}[0m" 27 | } 28 | 29 | # note in this first use that switching colors doesn't require a reset 30 | # first - the new color overrides the old one. 31 | 32 | initializeANSI 33 | 34 | cat << EOF 35 | 36 | ${redf}▀ █${reset} ${boldon}${redf}█ ▀${reset} ${greenf}▀ █${reset} ${boldon}${greenf}█ ▀${reset} ${yellowf}▀ █${reset} ${boldon}${yellowf}█ ▀${reset} ${bluef}▀ █${reset} ${boldon}${bluef}█ ▀${reset} ${purplef}▀ █${reset} ${boldon}${purplef}█ ▀${reset} ${cyanf}▀ █${reset} ${boldon}${cyanf}█ ▀${reset} 37 | ${redf}██${reset} ${boldon}${redf} ██${reset} ${greenf}██${reset} ${boldon}${greenf}██${reset} ${yellowf}██${reset} ${boldon}${yellowf}██${reset} ${bluef}██${reset} ${boldon}${bluef}██${reset} ${purplef}██${reset} ${boldon}${purplef}██${reset} ${cyanf}██${reset} ${boldon}${cyanf}██${reset} 38 | ${redf}▄ █${reset}${boldon}${redf} █ ▄ ${reset} ${greenf}▄ █ ${reset}${boldon}${greenf}█ ▄${reset} ${yellowf}▄ █ ${reset}${boldon}${yellowf}█ ▄${reset} ${bluef}▄ █ ${reset}${boldon}${bluef}█ ▄${reset} ${purplef}▄ █ ${reset}${boldon}${purplef}█ ▄${reset} ${cyanf}▄ █ ${reset}${boldon}${cyanf}█ ▄${reset} 39 | 40 | EOF 41 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/thebat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ANSI color scheme script by pfh 4 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=151601#p151601 5 | # Initializing mod by lolilolicon from Archlinux 6 | 7 | f=3 b=4 8 | for j in f b; do 9 | for i in {0..7}; do 10 | printf -v $j$i %b "\e[${!j}${i}m" 11 | done 12 | done 13 | bld=$'\e[1m' 14 | rst=$'\e[0m' 15 | inv=$'\e[7m' 16 | 17 | cat << EOF 18 | 19 | $f3 ██████████████████████████████████████ 20 | $f3 ██████████████████████████████████████████ 21 | $f3 ██████ ████████████████████████████ ██████ 22 | $f3 █████ ████████████ ████ ████████████ █████ 23 | $f3 ███ ████████████ ████████████ ███ 24 | $f3 ███ ███ 25 | $f3 ███ ███ 26 | $f3 ███ █████████ ████ ████ █████████ ███ 27 | $f3 █████ ███████████████ ███████████████ █████ 28 | $f3 ██████ ████████████████████████████ ██████ 29 | $f3 ██████████████████████████████████████████ 30 | $f3 ██████████████████████████████████████ 31 | $rst 32 | EOF 33 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/tiefighter1row: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ANSI Color -- use these variables to easily have different color 4 | # and format output. Make sure to output the reset sequence after 5 | # colors (f = foreground, b = background), and use the 'off' 6 | # feature for anything you turn on. 7 | # Author: pfh 8 | # Source: http://crunchbang.org/forums/viewtopic.php?pid=129265#p129265 9 | 10 | initializeANSI() 11 | { 12 | esc="" 13 | 14 | blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" 15 | yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" 16 | cyanf="${esc}[36m"; whitef="${esc}[37m" 17 | 18 | blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" 19 | yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" 20 | cyanb="${esc}[46m"; whiteb="${esc}[47m" 21 | 22 | boldon="${esc}[1m"; boldoff="${esc}[22m" 23 | italicson="${esc}[3m"; italicsoff="${esc}[23m" 24 | ulon="${esc}[4m"; uloff="${esc}[24m" 25 | invon="${esc}[7m"; invoff="${esc}[27m" 26 | 27 | reset="${esc}[0m" 28 | } 29 | 30 | # note in this first use that switching colors doesn't require a reset 31 | # first - the new color overrides the old one. 32 | # ****************************** Building blocks: █ ▓ ▒ ░ ▄ ▀ ▐ ▌ ● ═ ║ ╔ ╦ ╗ ╚ ╩ ╝ ■ ▬ ▲ ▼ ◄ ► 33 | 34 | initializeANSI 35 | 36 | cat << EOF 37 | 38 | ${greenf}█ █ ${blackf}█ █ ${bluef}█ █ ${purplef}█ █ ${cyanf}█ █ 39 | ${greenf}█ ▄▄▄ █ ${blackf}█ ▄▄▄ █ ${bluef}█ ▄▄▄ █ ${purplef}█ ▄▄▄ █ ${cyanf}█ ▄▄▄ █ 40 | ${greenf}█▄▄██▀██▄▄█ ${blackf}█▄▄██▀██▄▄█ ${bluef}█▄▄██▀██▄▄█ ${purplef}█▄▄██▀██▄▄█ ${cyanf}█▄▄██▀██▄▄█ 41 | ${greenf}█▀▀█████▀▀█ ${blackf}█▀▀█████▀▀█ ${bluef}█▀▀█████▀▀█ ${purplef}█▀▀█████▀▀█ ${cyanf}█▀▀█████▀▀█ 42 | ${greenf}█ ▀▀▀ █ ${blackf}█ ▀▀▀ █ ${bluef}█ ▀▀▀ █ ${purplef}█ ▀▀▀ █ ${cyanf}█ ▀▀▀ █ 43 | ${greenf}█ █ ${blackf}█ █ ${bluef}█ █ ${purplef}█ █ ${cyanf}█ █ 44 | ${reset} 45 | 46 | EOF 47 | -------------------------------------------------------------------------------- /.scripts/color-scripts/color-scripts/unowns.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | __author__ = 'actionless' 4 | 5 | import random 6 | 7 | unowns = [[ 8 | ' ▀█▀▀▀█▀ ', 9 | ' ▄▀▀▀▄ ', 10 | ' ▀▄ ▀ ▄▀ ', 11 | ' ▀█▀ ', 12 | ' ▄█▄▄▄▄ ', 13 | ], [ 14 | ' █▄ █ ', 15 | ' █ ▀▄▀▀▀▄ █ ', 16 | ' █ ▀▄ ▀ ▄▀ █ ', 17 | ' █ ▀▀▀ ▀▄█ ', 18 | ' ▀ ▀ ', 19 | ], [ 20 | ' ▀▀▀█▀▀▀ ', 21 | ' ▄▀▀▀▄ ', 22 | ' ▀▄ ▀ ▄▀ ', 23 | ' ▀▀▀ ', 24 | ' ', 25 | ], [ 26 | ' ▀▄ ▄▀ ', 27 | ' ▀▄▀▀▀▄▀ ', 28 | ' ▀▄ ▀ ▄▀ ', 29 | ' ▄▀ ▀▀▀ ▀▄ ', 30 | ' ▀ ▀ ', 31 | ], [ 32 | ' █▀▀▄ ', 33 | ' ▄▀▀▀▄ ▀▄ ', 34 | ' ▀▄ ▀ ▄▀ █ ', 35 | ' ▀▀▀ ▄▀ ', 36 | ' ▀▀▀ ', 37 | ], [ 38 | ' ▀▄ ▄▀ ', 39 | ' ▄▀▀▀▄ ', 40 | ' ▀▄ ▀ ▄▀ ', 41 | ' ▀█▀ ', 42 | ' ▄▀▄ ', 43 | ]] 44 | 45 | for mode in ['normal', 'bold']: 46 | random.shuffle(unowns) 47 | if mode == 'bold': 48 | print("\033[1m") 49 | 50 | print( 51 | '\n'.join([ 52 | ''.join([ 53 | "\033[03{n}m{string}".format( 54 | n=color_number + 1, 55 | string=unowns[color_number][line_number] 56 | ) 57 | for color_number in range(6)]) 58 | for line_number in range(5)]) 59 | ) 60 | 61 | # reset font: 62 | print("\033[0m") 63 | -------------------------------------------------------------------------------- /.scripts/color-scripts/test-color-support/README.md: -------------------------------------------------------------------------------- 1 | # Color Support 2 | 3 | These are some scripts to display the current number of colors supported by your Term. 4 | -------------------------------------------------------------------------------- /.scripts/color-scripts/test-color-support/color-support1.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Author: Todd Larason 3 | # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ 4 | 5 | # use the resources for colors 0-15 - usually more-or-less a 6 | # reproduction of the standard ANSI colors, but possibly more 7 | # pleasing shades 8 | 9 | # colors 16-231 are a 6x6x6 color cube 10 | for ($red = 0; $red < 6; $red++) { 11 | for ($green = 0; $green < 6; $green++) { 12 | for ($blue = 0; $blue < 6; $blue++) { 13 | printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 14 | 16 + ($red * 36) + ($green * 6) + $blue, 15 | ($red ? ($red * 40 + 55) : 0), 16 | ($green ? ($green * 40 + 55) : 0), 17 | ($blue ? ($blue * 40 + 55) : 0)); 18 | } 19 | } 20 | } 21 | 22 | # colors 232-255 are a grayscale ramp, intentionally leaving out 23 | # black and white 24 | for ($gray = 0; $gray < 24; $gray++) { 25 | $level = ($gray * 10) + 8; 26 | printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 27 | 232 + $gray, $level, $level, $level); 28 | } 29 | 30 | 31 | # display the colors 32 | 33 | # first the system ones: 34 | print "System colors:\n"; 35 | for ($color = 0; $color < 8; $color++) { 36 | print "\x1b[48;5;${color}m "; 37 | } 38 | print "\x1b[0m\n"; 39 | for ($color = 8; $color < 16; $color++) { 40 | print "\x1b[48;5;${color}m "; 41 | } 42 | print "\x1b[0m\n\n"; 43 | 44 | # now the color cube 45 | print "Color cube, 6x6x6:\n"; 46 | for ($green = 0; $green < 6; $green++) { 47 | for ($red = 0; $red < 6; $red++) { 48 | for ($blue = 0; $blue < 6; $blue++) { 49 | $color = 16 + ($red * 36) + ($green * 6) + $blue; 50 | print "\x1b[48;5;${color}m "; 51 | } 52 | print "\x1b[0m "; 53 | } 54 | print "\n"; 55 | } 56 | 57 | 58 | # now the grayscale ramp 59 | print "Grayscale ramp:\n"; 60 | for ($color = 232; $color < 256; $color++) { 61 | print "\x1b[48;5;${color}m "; 62 | } 63 | print "\x1b[0m\n"; 64 | -------------------------------------------------------------------------------- /.scripts/color-scripts/test-color-support/print-colors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | You can use this tool to display all supported colors and their color number. 4 | It will exit after a keypress. 5 | Compatible with both Python 2 and 3 6 | """ 7 | 8 | import curses 9 | from curses import * 10 | 11 | @wrapper 12 | def main(win): 13 | def print_all_colors(attr): 14 | for c in range(0, curses.COLORS): 15 | init_pair(c, c, -1) 16 | win.addstr(str(c) + ' ', color_pair(c) | attr) 17 | use_default_colors() 18 | win.addstr("available colors: %d\n\n" % curses.COLORS) 19 | print_all_colors(0) 20 | win.addstr("\n\n") 21 | print_all_colors(A_BOLD) 22 | win.refresh() 23 | win.getch() 24 | 25 | -------------------------------------------------------------------------------- /.tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | # remap prefix from 'C-b' to 'C-a' 2 | unbind C-b 3 | set-option -g prefix C-a 4 | bind-key C-a send-prefix 5 | 6 | # reload config file 7 | bind C-r source-file ~/.tmux.conf \; display ".tmux.conf reloaded!" 8 | 9 | # split panes using | and - 10 | unbind - 11 | unbind | 12 | bind | split-window -h 13 | bind - split-window -v 14 | unbind '"' 15 | unbind % 16 | 17 | # reload config file (change file location to your the tmux.conf you want to use) 18 | bind r source-file ~/.tmux.conf 19 | 20 | # switch panes using Alt-arrow without prefix 21 | bind -n C-h select-pane -L 22 | bind -n C-j select-pane -D 23 | bind -n C-k select-pane -U 24 | bind -n C-l select-pane -R 25 | 26 | # pane resizing 27 | bind -r C-H resize-pane -L 2 28 | bind -r C-J resize-pane -D 2 29 | bind -r C-K resize-pane -U 2 30 | bind -r C-L resize-pane -R 2 31 | 32 | # Enable mouse mode (tmux 2.1 and above) 33 | set -g mouse on 34 | 35 | # loud or quiet? 36 | set -g visual-activity off 37 | set -g visual-bell off 38 | set -g visual-silence off 39 | setw -g monitor-activity off 40 | set -g bell-action none 41 | 42 | # modes 43 | setw -g clock-mode-colour colour5 44 | setw -g mode-style 'fg=colour1 bg=colour18 bold' 45 | 46 | # panes 47 | set -g pane-border-style 'fg=colour19 bg=colour0' 48 | set -g pane-active-border-style 'bg=colour0 fg=colour9' 49 | 50 | # statusbar 51 | set -g status-position bottom 52 | set -g status-justify left 53 | set -g status-style 'bg=colour18 fg=colour137 dim' 54 | set -g status-left '' 55 | set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S ' 56 | set -g status-right-length 50 57 | set -g status-left-length 20 58 | 59 | setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' 60 | setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' 61 | 62 | setw -g window-status-style 'fg=colour9 bg=colour18' 63 | setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' 64 | 65 | setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' 66 | 67 | # messages 68 | set -g message-style 'fg=colour232 bg=colour16 bold' 69 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ### master 4 | - Fixed `#{battery_graph}` to actually display graph (@rux616) 5 | - High-granularity icons and colors added. (@rux616) 6 | - Changed preferred order of utility applications to be `pmset` -> `acpi` -> `upower` -> `termux-battery-status` due to CPU usage issues with `upower` (2019-03-05) (@rux616) 7 | - Added `#{battery_status_bg}` feature (@RyanFrantz) 8 | - Added multibattery output support for `upower` (@futuro) 9 | - Added Chromebook support (@forkjoseph) 10 | - Added battery graph, simplify interpolation (@levens) 11 | 12 | ### v1.2.0, 2016-09-24 13 | - show output for `#{battery_remain}` interpolation only if the battery is 14 | discharging 15 | - prevent displaying "(No" for `#{battery_remain}` interpolation (when battery 16 | status is "No estimate" 17 | - display all batteries that upower knows about (@JanAhrens) 18 | - acpi battery status (@cpb) 19 | - fix issue with status-right and status-left whitespace being cut out 20 | - fix issue with the `pmset -g batt` command output for macOS Sierra and further 21 | 22 | ### v1.1.0, 2015-03-14 23 | - change the default icon for "attached" battery state from :snail: to :warning: 24 | - add support for OS X "attached" battery state (@m1foley) 25 | - add `#{battery_remain}` feature (@asethwright) 26 | 27 | ### v1.0.0, 2014-08-31 28 | - update readme to reflect github organization change 29 | - bring in linux support 30 | - small refactoring 31 | - rename plugin to tmux-battery 32 | - add contributors to the readme 33 | 34 | ### v0.0.2, 2014-06-03 35 | - switch to tab indentation 36 | - do not automatically prepend battery status 37 | - change format interpolation strings to more Tmux-idiomatic 38 | `#{battery_percentage}` and `#{battery_icon}` 39 | - refactoring for simplicity 40 | - support interpolation in `status-left` option too 41 | - README update 42 | 43 | ### v0.0.1, 2014-06-03 44 | - tag version 0.0.1 45 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Bruno Sutic 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/battery.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/scripts/helpers.sh" 6 | 7 | battery_interpolation=( 8 | "\#{battery_color_bg}" 9 | "\#{battery_color_fg}" 10 | "\#{battery_color_charge_bg}" 11 | "\#{battery_color_charge_fg}" 12 | "\#{battery_color_status_bg}" 13 | "\#{battery_color_status_fg}" 14 | "\#{battery_graph}" 15 | "\#{battery_icon}" 16 | "\#{battery_icon_charge}" 17 | "\#{battery_icon_status}" 18 | "\#{battery_percentage}" 19 | "\#{battery_remain}" 20 | ) 21 | 22 | battery_commands=( 23 | "#($CURRENT_DIR/scripts/battery_color.sh bg)" 24 | "#($CURRENT_DIR/scripts/battery_color.sh fg)" 25 | "#($CURRENT_DIR/scripts/battery_color_charge.sh bg)" 26 | "#($CURRENT_DIR/scripts/battery_color_charge.sh fg)" 27 | "#($CURRENT_DIR/scripts/battery_color_status.sh bg)" 28 | "#($CURRENT_DIR/scripts/battery_color_status.sh fg)" 29 | "#($CURRENT_DIR/scripts/battery_graph.sh)" 30 | "#($CURRENT_DIR/scripts/battery_icon.sh)" 31 | "#($CURRENT_DIR/scripts/battery_icon_charge.sh)" 32 | "#($CURRENT_DIR/scripts/battery_icon_status.sh)" 33 | "#($CURRENT_DIR/scripts/battery_percentage.sh)" 34 | "#($CURRENT_DIR/scripts/battery_remain.sh)" 35 | ) 36 | 37 | set_tmux_option() { 38 | local option="$1" 39 | local value="$2" 40 | tmux set-option -gq "$option" "$value" 41 | } 42 | 43 | do_interpolation() { 44 | local all_interpolated="$1" 45 | for ((i=0; i<${#battery_commands[@]}; i++)); do 46 | all_interpolated=${all_interpolated//${battery_interpolation[$i]}/${battery_commands[$i]}} 47 | done 48 | echo "$all_interpolated" 49 | } 50 | 51 | update_tmux_option() { 52 | local option="$1" 53 | local option_value="$(get_tmux_option "$option")" 54 | local new_option_value="$(do_interpolation "$option_value")" 55 | set_tmux_option "$option" "$new_option_value" 56 | } 57 | 58 | main() { 59 | update_tmux_option "status-right" 60 | update_tmux_option "status-left" 61 | } 62 | main 63 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier1.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier2.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier3.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier4.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier5.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier6.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier7.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_charging_tier8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_charging_tier8.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier1.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier2.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier3.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier4.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier5.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier6.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier7.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_discharging_tier8.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_status_attached.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_status_attached.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/screenshots/battery_status_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-battery/screenshots/battery_status_unknown.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_color.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | print_color() { 8 | local plane="$1" 9 | local status="$2" 10 | if [ "$status" == "discharging" ]; then 11 | $CURRENT_DIR/battery_color_charge.sh "$plane" 12 | else 13 | $CURRENT_DIR/battery_color_status.sh "$plane" "$status" 14 | fi 15 | } 16 | 17 | main() { 18 | local status="$(battery_status)" 19 | local plane="$1" 20 | print_color "$plane" "$status" 21 | } 22 | 23 | main $@ 24 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_graph.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | print_graph() { 8 | local percentage=$1 9 | if [ $percentage -gt 5 ]; then 10 | printf "▁" 11 | else 12 | printf " " 13 | fi 14 | if [ $percentage -ge 25 ]; then 15 | printf "▂" 16 | else 17 | printf " " 18 | fi 19 | if [ $percentage -ge 50 ]; then 20 | printf "▄" 21 | else 22 | printf " " 23 | fi 24 | if [ $percentage -ge 75 ]; then 25 | printf "▆" 26 | else 27 | printf " " 28 | fi 29 | if [ $percentage -ge 95 ]; then 30 | printf "█" 31 | else 32 | printf " " 33 | echo "▇" 34 | fi 35 | } 36 | 37 | main() { 38 | local percentage=$($CURRENT_DIR/battery_percentage.sh) 39 | if [ "$(uname)" == "OpenBSD" ]; then 40 | print_graph ${percentage} 41 | else 42 | print_graph ${percentage%?} 43 | fi 44 | } 45 | main 46 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_icon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | print_icon() { 8 | local status=$1 9 | if [ "$status" == "discharging" ]; then 10 | $CURRENT_DIR/battery_icon_charge.sh 11 | else 12 | $CURRENT_DIR/battery_icon_status.sh "$status" 13 | fi 14 | } 15 | 16 | main() { 17 | local status=$(battery_status) 18 | print_icon "$status" 19 | } 20 | 21 | main 22 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_icon_charge.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | # script global variables 8 | icon_charge_tier8='' 9 | icon_charge_tier7='' 10 | icon_charge_tier6='' 11 | icon_charge_tier5='' 12 | icon_charge_tier4='' 13 | icon_charge_tier3='' 14 | icon_charge_tier2='' 15 | icon_charge_tier1='' 16 | 17 | # script default variables 18 | icon_charge_tier8_default='█' 19 | icon_charge_tier7_default='▇' 20 | icon_charge_tier6_default='▆' 21 | icon_charge_tier5_default='▅' 22 | icon_charge_tier4_default='▄' 23 | icon_charge_tier3_default='▃' 24 | icon_charge_tier2_default='▂' 25 | icon_charge_tier1_default='▁' 26 | 27 | # icons are set as script global variables 28 | get_icon_charge_settings() { 29 | icon_charge_tier8=$(get_tmux_option "@batt_icon_charge_tier8" "$icon_charge_tier8_default") 30 | icon_charge_tier7=$(get_tmux_option "@batt_icon_charge_tier7" "$icon_charge_tier7_default") 31 | icon_charge_tier6=$(get_tmux_option "@batt_icon_charge_tier6" "$icon_charge_tier6_default") 32 | icon_charge_tier5=$(get_tmux_option "@batt_icon_charge_tier5" "$icon_charge_tier5_default") 33 | icon_charge_tier4=$(get_tmux_option "@batt_icon_charge_tier4" "$icon_charge_tier4_default") 34 | icon_charge_tier3=$(get_tmux_option "@batt_icon_charge_tier3" "$icon_charge_tier3_default") 35 | icon_charge_tier2=$(get_tmux_option "@batt_icon_charge_tier2" "$icon_charge_tier2_default") 36 | icon_charge_tier1=$(get_tmux_option "@batt_icon_charge_tier1" "$icon_charge_tier1_default") 37 | } 38 | 39 | print_icon_charge() { 40 | percentage=$($CURRENT_DIR/battery_percentage.sh | sed -e 's/%//') 41 | if [ $percentage -ge 95 -o "$percentage" == "" ]; then 42 | # if percentage is empty, assume it's a desktop 43 | printf "$icon_charge_tier8" 44 | elif [ $percentage -ge 80 ]; then 45 | printf "$icon_charge_tier7" 46 | elif [ $percentage -ge 65 ]; then 47 | printf "$icon_charge_tier6" 48 | elif [ $percentage -ge 50 ]; then 49 | printf "$icon_charge_tier5" 50 | elif [ $percentage -ge 35 ]; then 51 | printf "$icon_charge_tier4" 52 | elif [ $percentage -ge 20 ]; then 53 | printf "$icon_charge_tier3" 54 | elif [ $percentage -gt 5 ]; then 55 | printf "$icon_charge_tier2" 56 | else 57 | printf "$icon_charge_tier1" 58 | fi 59 | } 60 | 61 | main() { 62 | get_icon_charge_settings 63 | print_icon_charge 64 | } 65 | 66 | main 67 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_icon_status.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | # script global variables 8 | icon_status_charged='' 9 | icon_status_charging='' 10 | icon_status_discharging='' 11 | icon_status_attached='' 12 | icon_status_unknown='' 13 | 14 | # script default variables 15 | icon_status_charged_default='🔌' 16 | icon_status_charged_default_osx='🔌' 17 | icon_status_charging_default='🔌' 18 | icon_status_discharging_default='🔋' 19 | icon_status_attached_default='⚠️' 20 | icon_status_unknown_default='?' 21 | 22 | # determine which charged_default variable to use 23 | get_icon_status_charged_default() { 24 | if is_osx; then 25 | printf "$icon_status_charged_default_osx" 26 | else 27 | printf "$icon_status_charged_default" 28 | fi 29 | } 30 | 31 | # icons are set as script global variables 32 | get_icon_status_settings() { 33 | icon_status_charged=$(get_tmux_option "@batt_icon_status_charged" "$(get_icon_status_charged_default)") 34 | icon_status_charging=$(get_tmux_option "@batt_icon_status_charging" "$icon_status_charging_default") 35 | icon_status_discharging=$(get_tmux_option "@batt_icon_status_discharging" "$icon_status_discharging_default") 36 | icon_status_attached=$(get_tmux_option "@batt_icon_status_attached" "$icon_status_attached_default") 37 | icon_status_unknown=$(get_tmux_option "@batt_icon_status_unknown" "$icon_status_unknown_default") 38 | } 39 | 40 | print_icon_status() { 41 | local status=$1 42 | if [[ $status =~ (charged) || $status =~ (full) ]]; then 43 | printf "$icon_status_charged" 44 | elif [[ $status =~ (^charging) ]]; then 45 | printf "$icon_status_charging" 46 | elif [[ $status =~ (^discharging) ]]; then 47 | printf "$icon_status_discharging" 48 | elif [[ $status =~ (attached) ]]; then 49 | printf "$icon_status_attached" 50 | else 51 | printf "$icon_status_unknown" 52 | fi 53 | } 54 | 55 | main() { 56 | get_icon_status_settings 57 | local status=${1:-$(battery_status)} 58 | print_icon_status "$status" 59 | } 60 | 61 | main 62 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_percentage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | print_battery_percentage() { 8 | # percentage displayed in the 2nd field of the 2nd row 9 | if command_exists "pmset"; then 10 | pmset -g batt | grep -o "[0-9]\{1,3\}%" 11 | elif command_exists "acpi"; then 12 | acpi -b | grep -m 1 -Eo "[0-9]+%" 13 | elif command_exists "upower"; then 14 | # use DisplayDevice if available otherwise battery 15 | local battery=$(upower -e | grep -E 'battery|DisplayDevice'| tail -n1) 16 | if [ -z "$battery" ]; then 17 | return 18 | fi 19 | local percentage=$(upower -i $battery | awk '/percentage:/ {print $2}') 20 | if [ "$percentage" ]; then 21 | echo ${percentage%.*%} 22 | return 23 | fi 24 | local energy 25 | local energy_full 26 | energy=$(upower -i $battery | awk -v nrg="$energy" '/energy:/ {print nrg+$2}') 27 | energy_full=$(upower -i $battery | awk -v nrgfull="$energy_full" '/energy-full:/ {print nrgfull+$2}') 28 | if [ -n "$energy" ] && [ -n "$energy_full" ]; then 29 | echo $energy $energy_full | awk '{printf("%d%%", ($1/$2)*100)}' 30 | fi 31 | elif command_exists "termux-battery-status"; then 32 | termux-battery-status | jq -r '.percentage' | awk '{printf("%d%%", $1)}' 33 | elif command_exists "apm"; then 34 | apm -l 35 | fi 36 | } 37 | 38 | main() { 39 | print_battery_percentage 40 | } 41 | main 42 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_status_bg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | color_full_charge_default="#[bg=green]" 8 | color_high_charge_default="#[bg=yellow]" 9 | color_medium_charge_default="#[bg=colour208]" # orange 10 | color_low_charge_default="#[bg=red]" 11 | color_charging_default="#[bg=green]" 12 | 13 | color_full_charge="" 14 | color_high_charge="" 15 | color_medium_charge="" 16 | color_low_charge="" 17 | color_charging="" 18 | 19 | get_charge_color_settings() { 20 | color_full_charge=$(get_tmux_option "@batt_color_full_charge" "$color_full_charge_default") 21 | color_high_charge=$(get_tmux_option "@batt_color_high_charge" "$color_high_charge_default") 22 | color_medium_charge=$(get_tmux_option "@batt_color_medium_charge" "$color_medium_charge_default") 23 | color_low_charge=$(get_tmux_option "@batt_color_low_charge" "$color_low_charge_default") 24 | color_charging=$(get_tmux_option "@batt_color_charging" "$color_charging_default") 25 | } 26 | 27 | print_battery_status_bg() { 28 | # Call `battery_percentage.sh`. 29 | percentage=$($CURRENT_DIR/battery_percentage.sh | sed -e 's/%//') 30 | status=$(battery_status | awk '{print $1;}') 31 | if [ $status == 'charging' ]; then 32 | printf $color_charging 33 | elif [ $percentage -eq 100 ]; then 34 | printf $color_full_charge 35 | elif [ $percentage -le 99 -a $percentage -ge 51 ];then 36 | printf $color_high_charge 37 | elif [ $percentage -le 50 -a $percentage -ge 16 ];then 38 | printf $color_medium_charge 39 | elif [ "$percentage" == "" ];then 40 | printf $color_full_charge_default # assume it's a desktop 41 | else 42 | printf $color_low_charge 43 | fi 44 | } 45 | 46 | main() { 47 | get_charge_color_settings 48 | print_battery_status_bg 49 | } 50 | main 51 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/battery_status_fg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | color_full_charge_default="#[fg=green]" 8 | color_high_charge_default="#[fg=yellow]" 9 | color_medium_charge_default="#[fg=colour208]" # orange 10 | color_low_charge_default="#[fg=red]" 11 | color_charging_default="#[fg=green]" 12 | 13 | color_full_charge="" 14 | color_high_charge="" 15 | color_medium_charge="" 16 | color_low_charge="" 17 | color_charging="" 18 | 19 | get_charge_color_settings() { 20 | color_full_charge=$(get_tmux_option "@batt_color_full_charge" "$color_full_charge_default") 21 | color_high_charge=$(get_tmux_option "@batt_color_high_charge" "$color_high_charge_default") 22 | color_medium_charge=$(get_tmux_option "@batt_color_medium_charge" "$color_medium_charge_default") 23 | color_low_charge=$(get_tmux_option "@batt_color_low_charge" "$color_low_charge_default") 24 | color_charging=$(get_tmux_option "@batt_color_charging" "$color_charging_default") 25 | } 26 | 27 | print_battery_status_fg() { 28 | # Call `battery_percentage.sh`. 29 | percentage=$($CURRENT_DIR/battery_percentage.sh | sed -e 's/%//') 30 | status=$(battery_status | awk '{print $1;}') 31 | if [ $status == 'charging' ]; then 32 | printf $color_charging 33 | elif [ $percentage -eq 100 ]; then 34 | printf $color_full_charge 35 | elif [ $percentage -le 99 -a $percentage -ge 51 ];then 36 | printf $color_high_charge 37 | elif [ $percentage -le 50 -a $percentage -ge 16 ];then 38 | printf $color_medium_charge 39 | elif [ "$percentage" == "" ];then 40 | printf $color_full_charge_default # assume it's a desktop 41 | else 42 | printf $color_low_charge 43 | fi 44 | } 45 | 46 | main() { 47 | get_charge_color_settings 48 | print_battery_status_fg 49 | } 50 | main 51 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-battery/scripts/helpers.sh: -------------------------------------------------------------------------------- 1 | get_tmux_option() { 2 | local option="$1" 3 | local default_value="$2" 4 | local option_value="$(tmux show-option -gqv "$option")" 5 | if [ -z "$option_value" ]; then 6 | echo "$default_value" 7 | else 8 | echo "$option_value" 9 | fi 10 | } 11 | 12 | is_osx() { 13 | [ $(uname) == "Darwin" ] 14 | } 15 | 16 | is_chrome() { 17 | chrome="/sys/class/chromeos/cros_ec" 18 | if [ -d "$chrome" ]; then 19 | return 0 20 | else 21 | return 1 22 | fi 23 | } 24 | 25 | command_exists() { 26 | local command="$1" 27 | type "$command" >/dev/null 2>&1 28 | } 29 | 30 | battery_status() { 31 | if command_exists "pmset"; then 32 | pmset -g batt | awk -F '; *' 'NR==2 { print $2 }' 33 | elif command_exists "acpi"; then 34 | acpi -b | awk '{gsub(/,/, ""); print tolower($3); exit}' 35 | elif command_exists "upower"; then 36 | local battery 37 | battery=$(upower -e | grep -E 'battery|DisplayDevice'| tail -n1) 38 | upower -i $battery | awk '/state/ {print $2}' 39 | elif command_exists "termux-battery-status"; then 40 | termux-battery-status | jq -r '.status' | awk '{printf("%s%", tolower($1))}' 41 | elif command_exists "apm"; then 42 | local battery 43 | battery=$(apm -a) 44 | if [ $battery -eq 0 ]; then 45 | echo "discharging" 46 | elif [ $battery -eq 1 ]; then 47 | echo "charging" 48 | fi 49 | fi 50 | } 51 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Bruno Sutic 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/Vagrantfile: -------------------------------------------------------------------------------- 1 | VAGRANTFILE_API_VERSION = '2' 2 | 3 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 4 | config.vm.define :ubuntu_two_five do |ubuntu| 5 | ubuntu.vm.box = 'hashicorp/precise32' 6 | ubuntu.vm.provision 'shell', path: 'vagrant_ubuntu_provisioning_two_five.sh' 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/docs/customizations.md: -------------------------------------------------------------------------------- 1 | # Customizations 2 | 3 | Most of the behavior of tmux-copycat can be customized via tmux options.
4 | To set a value, just put `set -g @option 'value'` in your `.tmux.conf` before 5 | loading the tmux-copycat plugin. 6 | 7 | Other options: 8 | 9 | - `@copycat_search` (default `/`) defines the key-binding used (after prefix) to 10 | start an interactive search. 11 | - `@copycat_next` (default `n`) defines the key (without prefix) used to jump to 12 | next search result. 13 | - `@copycat_prev` (default `N`) defines the key (without prefix) used to jump to 14 | previous search result. 15 | 16 | Options for predefined searches: 17 | 18 | - `@copycat_git_special` (default `C-g`) git status search 19 | - `@copycat_file_search` (default `C-f`) file search 20 | - `@copycat_url_search` (default `C-u`) url search 21 | - `@copycat_digit_search` (default `C-d`) digit search 22 | - `@copycat_hash_search` (default `M-h`) SHA-1 hash search 23 | - `@copycat_ip_search` (default `M-i`) IP address search 24 | 25 | Example: to remap default file search to use `C-t` put 26 | `set -g @copycat_file_search 'C-t'` in `.tmux.conf`. 27 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/docs/defining_new_stored_searches.md: -------------------------------------------------------------------------------- 1 | # Defining new stored searches 2 | 3 | To speed up the workflow you can define new bindings in `.tmux.conf` for 4 | searches you use often. 5 | 6 | After adding any of the below snippets, make sure to reload your tmux 7 | configuration: 8 | 9 | # type this in the terminal 10 | $ tmux source-file ~/.tmux.conf 11 | 12 | Dummy examples (just for testing): 13 | 14 | * `prefix + ctrl-t` example string search 15 | 16 | set -g @copycat_search_C-t 'search me' 17 | 18 | * `prefix + alt-t` example regex search 19 | 20 | set -g @copycat_search_M-t 'regex search[[:alnum:]]\*' 21 | 22 | ### Useful searches 23 | 24 | * `prefix + ctrl-e` in the Rails log output searches for previous request start 25 | 26 | set -g @copycat_search_C-e '^Processing[[:space:]]by[[:space:]][^[:space:]]*' 27 | 28 | * `prefix + D` searches for numbers at the *beginning* of line.
29 | Useful with `$ pgrep -lf process` command to quickly select process PID. 30 | 31 | set -g @copycat_search_D '^[[:digit:]]+' 32 | 33 | * `prefix + G` searches for git commit SHA1.
34 | Works for both the short (5 chars) and full (40 chars) versions. 35 | 36 | set -g @copycat_search_G '\b[0-9a-f]{5,40}\b' 37 | 38 | 39 | Have your own custom search? Please share it in 40 | [the discussion](https://github.com/tmux-plugins/tmux-copycat/issues/57). 41 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/docs/installation_for_tmux_2.3.md: -------------------------------------------------------------------------------- 1 | # Installation for Tmux 2.3 and earlier 2 | 3 | The installation steps for Tmux 2.3 are based on 4 | [manual installation](https://github.com/tmux-plugins/tmux-copycat#manual-installation) 5 | steps, with the addition of using `tmux-23` branch. 6 | 7 | Create tmux plugins dir: 8 | 9 | $ mkdir -p ~/.tmux/plugins 10 | 11 | Clone the repo: 12 | 13 | $ git clone -b tmux-23 https://github.com/tmux-plugins/tmux-copycat ~/.tmux/plugins/tmux-copycat 14 | 15 | Add this line to the bottom of `.tmux.conf`: 16 | 17 | run-shell ~/clone/path/copycat.tmux 18 | 19 | Reload TMUX environment with: `$ tmux source-file ~/.tmux.conf`. You should now 20 | be able to use the plugin. 21 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/docs/limitations.md: -------------------------------------------------------------------------------- 1 | # Limitations 2 | 3 | - This plugin tries hard to consistently enable "marketed" features. It uses some 4 | hacks to go beyond the APIs Tmux provides. Because of this, it might have some 5 | "rough edges" and there's nothing that can be done. 6 | 7 | Examples: non-perfect file and url matching and selection. That said, usage 8 | should be fine in +90% cases. 9 | 10 | - feel free to report search cases you think should work, but are not 11 | (provide examples pls!). I'm open to the idea of adding more saved searches. 12 | 13 | - Tmux `vi` copy mode works faster than `emacs`. If you don't have a preference 14 | yet and to speed up `tmux_copycat`, I recommend putting this in `.tmux.conf` 15 | to set Tmux copy mode to `vi`: 16 | 17 | set -g mode-keys vi 18 | 19 | - remapping `Escape` key in copy mode will break the plugin. If you have this 20 | in your `.tmux.conf`, please consider removing it: 21 | 22 | bind -t vi-copy Escape cancel 23 | 24 | After removing this key binding, don't forget to restart tmux server! 25 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/run-tests: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # For each virtual machine where tests run, this script performs the following: 4 | # - starts VM 5 | # - starts the test suite witin a VM 6 | # - stops the VM after the test suite is done 7 | 8 | # global variable for script exit value 9 | export EXIT_VALUE=0 10 | 11 | register_failing_specs() { 12 | EXIT_VALUE=1 13 | } 14 | 15 | run_vagrant() { 16 | local box="$1" 17 | vagrant up "$box" 18 | } 19 | 20 | # Halt vagrant after tests are done running, unless KEEP_RUNNING environment 21 | # variable is set to 'true'. 22 | stop_vagrant() { 23 | local box="$1" 24 | if [ -z "$KEEP_RUNNING" ]; then 25 | vagrant halt "$box" 26 | else 27 | echo 28 | echo "KEEP_RUNNING is set. Vagrant not halted." 29 | fi 30 | } 31 | 32 | run_tests() { 33 | local box="$1" 34 | local test_file="/vagrant/test/run-tests-within-vm" 35 | echo "Running test suite on $box from: $test_file" 36 | echo 37 | vagrant ssh "$box" -c "cd /vagrant; $test_file" 38 | } 39 | 40 | exit_message() { 41 | local exit_val="$1" 42 | echo 43 | if [ $exit_val == 0 ]; then 44 | echo "Success, tests pass!" 45 | else 46 | echo "Tests failed!" 1>&2 47 | fi 48 | } 49 | 50 | run_tests_on_vm() { 51 | local vm="$1" 52 | run_vagrant "$vm" 53 | run_tests "$vm" 54 | local tests_exit_value="$?" 55 | stop_vagrant "$vm" 56 | if [ $tests_exit_value -gt 0 ]; then 57 | register_failing_specs 58 | fi 59 | } 60 | 61 | main() { 62 | run_tests_on_vm "ubuntu_two_five" 63 | 64 | exit_message "$EXIT_VALUE" 65 | exit "$EXIT_VALUE" 66 | } 67 | main 68 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/check_tmux_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | VERSION="$1" 4 | UNSUPPORTED_MSG="$2" 5 | 6 | get_tmux_option() { 7 | local option=$1 8 | local default_value=$2 9 | local option_value=$(tmux show-option -gqv "$option") 10 | if [ -z "$option_value" ]; then 11 | echo "$default_value" 12 | else 13 | echo "$option_value" 14 | fi 15 | } 16 | 17 | # Ensures a message is displayed for 5 seconds in tmux prompt. 18 | # Does not override the 'display-time' tmux option. 19 | display_message() { 20 | local message="$1" 21 | 22 | # display_duration defaults to 5 seconds, if not passed as an argument 23 | if [ "$#" -eq 2 ]; then 24 | local display_duration="$2" 25 | else 26 | local display_duration="5000" 27 | fi 28 | 29 | # saves user-set 'display-time' option 30 | local saved_display_time=$(get_tmux_option "display-time" "750") 31 | 32 | # sets message display time to 5 seconds 33 | tmux set-option -gq display-time "$display_duration" 34 | 35 | # displays message 36 | tmux display-message "$message" 37 | 38 | # restores original 'display-time' value 39 | tmux set-option -gq display-time "$saved_display_time" 40 | } 41 | 42 | # this is used to get "clean" integer version number. Examples: 43 | # `tmux 1.9` => `19` 44 | # `1.9a` => `19` 45 | get_digits_from_string() { 46 | local string="$1" 47 | local only_digits="$(echo "$string" | tr -dC '[:digit:]')" 48 | echo "$only_digits" 49 | } 50 | 51 | tmux_version_int() { 52 | local tmux_version_string=$(tmux -V) 53 | echo "$(get_digits_from_string "$tmux_version_string")" 54 | } 55 | 56 | unsupported_version_message() { 57 | if [ -n "$UNSUPPORTED_MSG" ]; then 58 | echo "$UNSUPPORTED_MSG" 59 | else 60 | echo "Error, Tmux version unsupported! Please install Tmux version $VERSION or greater!" 61 | fi 62 | } 63 | 64 | exit_if_unsupported_version() { 65 | local current_version="$1" 66 | local supported_version="$2" 67 | if [ "$current_version" -lt "$supported_version" ]; then 68 | display_message "$(unsupported_version_message)" 69 | exit 1 70 | fi 71 | } 72 | 73 | main() { 74 | local supported_version_int="$(get_digits_from_string "$VERSION")" 75 | local current_version_int="$(tmux_version_int)" 76 | exit_if_unsupported_version "$current_version_int" "$supported_version_int" 77 | } 78 | main 79 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_generate_results.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | search_pattern="$1" 8 | 9 | capture_pane() { 10 | local file=$1 11 | # copying 9M lines back will hopefully fetch the whole scrollback 12 | tmux capture-pane -S -9000000 -p > "$file" 13 | } 14 | 15 | # doing 2 things in 1 step so that we don't write to disk too much 16 | reverse_and_create_copycat_file() { 17 | local file=$1 18 | local copycat_file=$2 19 | local grep_pattern=$3 20 | (tac 2>/dev/null || tail -r) < "$file" | grep -oniE "$grep_pattern" > "$copycat_file" 21 | } 22 | 23 | delete_old_files() { 24 | local scrollback_filename="$(get_scrollback_filename)" 25 | local copycat_filename="$(get_copycat_filename)" 26 | rm -f "$scrollback_filename" "$copycat_filename" 27 | } 28 | 29 | generate_copycat_file() { 30 | local grep_pattern="$1" 31 | local scrollback_filename="$(get_scrollback_filename)" 32 | local copycat_filename="$(get_copycat_filename)" 33 | mkdir -p "$(_get_tmp_dir)" 34 | chmod 0700 "$(_get_tmp_dir)" 35 | capture_pane "$scrollback_filename" 36 | reverse_and_create_copycat_file "$scrollback_filename" "$copycat_filename" "$grep_pattern" 37 | } 38 | 39 | if_no_results_exit_with_message() { 40 | local copycat_filename="$(get_copycat_filename)" 41 | # check for empty filename 42 | if ! [ -s "$copycat_filename" ]; then 43 | display_message "No results!" 44 | exit 0 45 | fi 46 | } 47 | 48 | main() { 49 | local grep_pattern="$1" 50 | if not_in_copycat_mode; then 51 | delete_old_files 52 | generate_copycat_file "$grep_pattern" 53 | if_no_results_exit_with_message 54 | set_copycat_mode 55 | copycat_increase_counter 56 | fi 57 | } 58 | main "$search_pattern" 59 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_git_special.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | PANE_CURRENT_PATH="$1" 6 | 7 | source "$CURRENT_DIR/helpers.sh" 8 | 9 | git_status_files() { 10 | local git_working_dir="$PANE_CURRENT_PATH" 11 | local git_dir="$PANE_CURRENT_PATH/.git" 12 | echo "$(git --git-dir="$git_dir" --work-tree="$git_working_dir" status --porcelain)" 13 | } 14 | 15 | formatted_git_status() { 16 | local raw_gist_status="$(git_status_files)" 17 | echo "$(echo "$raw_gist_status" | cut -c 4-)" 18 | } 19 | 20 | exit_if_no_results() { 21 | local results="$1" 22 | if [ -z "$results" ]; then 23 | display_message "No results!" 24 | exit 0 25 | fi 26 | } 27 | 28 | concatenate_files() { 29 | local git_status_files="$(formatted_git_status)" 30 | exit_if_no_results "$git_status_files" 31 | 32 | local result="" 33 | # Undefined until later within a while loop. 34 | local file_separator 35 | while read -r line; do 36 | result="${result}${file_separator}${line}" 37 | file_separator="|" 38 | done <<< "$git_status_files" 39 | echo "$result" 40 | } 41 | 42 | # Creates one, big regex out of git status files. 43 | # Example: 44 | # `git status` shows files `foo.txt` and `bar.txt` 45 | # output regex will be: 46 | # `(foo.txt|bar.txt) 47 | git_status_files_regex() { 48 | local concatenated_files="$(concatenate_files)" 49 | local regex_result="(${concatenated_files})" 50 | echo "$regex_result" 51 | } 52 | 53 | main() { 54 | local search_regex="$(git_status_files_regex)" 55 | # starts copycat mode 56 | $CURRENT_DIR/copycat_mode_start.sh "$search_regex" 57 | } 58 | main 59 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_mode_bindings.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | AWK_CMD='awk' 7 | if command_exists gawk; then 8 | AWK_CMD='gawk' 9 | fi 10 | 11 | # Extends a keyboard key. 12 | # Benefits: tmux won't report errors and everything will work fine even if the 13 | # script is deleted. 14 | extend_key() { 15 | local key="$1" 16 | local script="$2" 17 | local cmd 18 | 19 | # 1. 'cmd' or 'key' is sent to tmux. This ensures the default key action is done. 20 | # 2. Script is executed. 21 | # 3. `true` command ensures an exit status 0 is returned. This ensures a 22 | # user never gets an error msg - even if the script file from step 2 is 23 | # deleted. 24 | # We fetch the current behavior of the 'key' mapping in 25 | # variable 'cmd' 26 | cmd=$(tmux list-keys -T $(tmux_copy_mode_string) | $AWK_CMD '$4 == "'$key'"' | $AWK_CMD '{ $1=""; $2=""; $3=""; $4=""; sub(" ", " "); print }') 27 | # If 'cmd' is already a copycat command, we do nothing 28 | if echo "$cmd" | grep -q copycat; then 29 | return 30 | fi 31 | # We save the previous mapping to a file in order to be able to recover 32 | # the previous mapping when we unbind 33 | tmux list-keys -T $(tmux_copy_mode_string) | $AWK_CMD '$4 == "'$key'"' >> "${TMPDIR:-/tmp}/copycat_$(whoami)_recover_keys" 34 | tmux bind-key -T $(tmux_copy_mode_string) "$key" run-shell "tmux $cmd; $script; true" 35 | } 36 | 37 | copycat_cancel_bindings() { 38 | # keys that quit copy mode are enhanced to quit copycat mode as well. 39 | local cancel_mode_bindings=$(copycat_quit_copy_mode_keys) 40 | local key 41 | for key in $cancel_mode_bindings; do 42 | extend_key "$key" "$CURRENT_DIR/copycat_mode_quit.sh" 43 | done 44 | } 45 | 46 | copycat_mode_bindings() { 47 | extend_key "$(copycat_next_key)" "$CURRENT_DIR/copycat_jump.sh 'next'" 48 | extend_key "$(copycat_prev_key)" "$CURRENT_DIR/copycat_jump.sh 'prev'" 49 | } 50 | 51 | main() { 52 | copycat_mode_bindings 53 | copycat_cancel_bindings 54 | } 55 | main 56 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_mode_quit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | unbind_cancel_bindings() { 8 | local cancel_mode_bindings=$(copycat_quit_copy_mode_keys) 9 | local key 10 | for key in $cancel_mode_bindings; do 11 | tmux unbind-key -n "$key" 12 | done 13 | } 14 | 15 | unbind_prev_next_bindings() { 16 | tmux unbind-key -n "$(copycat_next_key)" 17 | tmux unbind-key -n "$(copycat_prev_key)" 18 | } 19 | 20 | unbind_all_bindings() { 21 | grep -v copycat <"${TMPDIR:-/tmp}/copycat_$(whoami)_recover_keys" | while read -r key_cmd; do 22 | sh -c "tmux $key_cmd" 23 | done < /dev/stdin 24 | rm "${TMPDIR:-/tmp}/copycat_$(whoami)_recover_keys" 25 | } 26 | 27 | main() { 28 | if in_copycat_mode; then 29 | reset_copycat_position 30 | unset_copycat_mode 31 | copycat_decrease_counter 32 | # removing all bindings only if no panes are in copycat mode 33 | if copycat_counter_zero; then 34 | unbind_all_bindings 35 | fi 36 | fi 37 | } 38 | main 39 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_mode_start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | SUPPORTED_VERSION="1.9" 6 | 7 | PATTERN="$1" 8 | 9 | supported_tmux_version_ok() { 10 | $CURRENT_DIR/check_tmux_version.sh "$SUPPORTED_VERSION" 11 | } 12 | 13 | main() { 14 | local pattern="$1" 15 | if supported_tmux_version_ok; then 16 | $CURRENT_DIR/copycat_generate_results.sh "$pattern" # will `exit 0` if no results 17 | $CURRENT_DIR/copycat_mode_bindings.sh 18 | $CURRENT_DIR/copycat_jump.sh 'next' 19 | fi 20 | } 21 | main "$PATTERN" 22 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/copycat_search.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | main() { 6 | tmux command-prompt -p "copycat search:" "run-shell \"$CURRENT_DIR/copycat_mode_start.sh '%1'\"" 7 | } 8 | main 9 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/stored_search_helpers.sh: -------------------------------------------------------------------------------- 1 | stored_search_not_defined() { 2 | local key="$1" 3 | local search_value="$(tmux show-option -gqv "${COPYCAT_VAR_PREFIX}_${key}")" 4 | [ -z $search_value ] 5 | } 6 | 7 | stored_search_vars() { 8 | tmux show-options -g | 9 | \grep -i "^${COPYCAT_VAR_PREFIX}_" | 10 | cut -d ' ' -f1 | # cut just variable names 11 | xargs # splat var names in one line 12 | } 13 | 14 | # get the search key from the variable name 15 | get_stored_search_key() { 16 | local search_var="$1" 17 | echo "$(echo "$search_var" | sed "s/^${COPYCAT_VAR_PREFIX}_//")" 18 | } 19 | 20 | get_stored_search_pattern() { 21 | local search_var="$1" 22 | echo "$(get_tmux_option "$search_var" "")" 23 | } 24 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/scripts/variables.sh: -------------------------------------------------------------------------------- 1 | # stored search variable prefix 2 | COPYCAT_VAR_PREFIX="@copycat_search" 3 | 4 | # basic search 5 | default_copycat_search_key="/" 6 | copycat_search_option="@copycat_search" 7 | 8 | # git special search 9 | default_git_search_key="C-g" 10 | copycat_git_search_option="@copycat_git_special" 11 | 12 | # regular searches 13 | default_file_search_key="C-f" 14 | copycat_file_search_option="@copycat_file_search" 15 | 16 | default_url_search_key="C-u" 17 | copycat_url_search_option="@copycat_url_search" 18 | 19 | default_digit_search_key="C-d" 20 | copycat_digit_search_option="@copycat_digit_search" 21 | 22 | default_hash_search_key="M-h" 23 | copycat_hash_search_option="@copycat_hash_search" 24 | 25 | default_ip_search_key="M-i" 26 | copycat_ip_search_option="@copycat_ip_search" 27 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/README.md: -------------------------------------------------------------------------------- 1 | ## Tmux copycat test suite 2 | 3 | This directory contains test files for tmux copycat. 4 | 5 | Tests are written with the [expect tool](http://expect.sourceforge.net/). 6 | 7 | ### Dependencies 8 | 9 | - [Vagrant](https://www.vagrantup.com/) 10 | 11 | ### Running the test suite 12 | 13 | From the `tmux copycat` project top directory run: 14 | 15 | $ ./run-tests 16 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/expect_copycat_assertions.exp: -------------------------------------------------------------------------------- 1 | # tmux copycat assertion helpers 2 | 3 | # Asserts text that is crrently highlighted (in copy mode). 4 | proc assert_highlighted {text message} { 5 | set checker [ _generate_checker ] 6 | # Asserted text first has to be 'yanked' and displayed before `expect`. 7 | _display_highlighted_with_checker_text "$checker" 8 | expect { 9 | "$checker$text" { puts " Success: $message" } 10 | timeout { puts " Fail: $message"; exit_status_false } 11 | } 12 | } 13 | 14 | proc irb_assert_highlighted {text message} { 15 | set checker [ _generate_checker ] 16 | _irb_display_highlighted_with_checker_text "$checker" 17 | expect { 18 | "$checker$text" { puts " Success: $message" } 19 | timeout { puts " Fail: $message"; exit_status_false } 20 | } 21 | } 22 | 23 | proc assert_on_screen {text message} { 24 | expect { 25 | "$text" { puts " Success: $message" } 26 | timeout { puts " Fail: $message"; exit_status_false } 27 | } 28 | } 29 | 30 | # private functions 31 | 32 | proc _generate_checker {} { 33 | set random [ expr { rand()*10000 } ] 34 | set checker "Checker $random:" 35 | return $checker 36 | } 37 | 38 | proc _display_highlighted_with_checker_text {checker} { 39 | _copy_mode_copy 40 | send "" 41 | sleep 0.1 42 | send "echo $checker" 43 | sleep 0.1 44 | _tmux_paste 45 | send "\r" 46 | } 47 | 48 | proc _irb_display_highlighted_with_checker_text {checker} { 49 | _copy_mode_copy 50 | send "\r" 51 | sleep 0.1 52 | send "puts '$checker" 53 | sleep 0.1 54 | _tmux_paste 55 | send "'" 56 | send "\r" 57 | } 58 | 59 | proc _copy_mode_copy {} { 60 | send "y" 61 | sleep 0.2 62 | } 63 | 64 | proc _tmux_paste {} { 65 | send "]" 66 | sleep 0.1 67 | } 68 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/expect_copycat_helpers.exp: -------------------------------------------------------------------------------- 1 | # a set of tmux specific helpers 2 | 3 | proc tmux_ctrl_f {} { 4 | send "" 5 | sleep 0.7 6 | } 7 | 8 | proc tmux_ctrl_d {} { 9 | send "" 10 | sleep 0.7 11 | } 12 | 13 | proc tmux_ctrl_u {} { 14 | send "" 15 | sleep 0.7 16 | } 17 | 18 | proc tmux_ctrl_r {} { 19 | send "" 20 | sleep 0.7 21 | } 22 | 23 | proc tmux_ctrl_g {} { 24 | send "" 25 | sleep 0.7 26 | } 27 | 28 | proc tmux_alt_h {} { 29 | send "h" 30 | sleep 0.7 31 | } 32 | 33 | proc tmux_ctrl_t {} { 34 | send "" 35 | sleep 0.7 36 | } 37 | 38 | proc search {text} { 39 | send "/" 40 | sleep 0.5 41 | send "$text\r" 42 | sleep 0.7 43 | } 44 | 45 | proc next_match {} { 46 | send "n" 47 | sleep 0.7 48 | } 49 | 50 | proc previous_match {} { 51 | send "N" 52 | sleep 0.7 53 | } 54 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/run_tmux.exp: -------------------------------------------------------------------------------- 1 | # steps for starting tmux within an expect script 2 | 3 | spawn tmux 4 | # delay with sleep to compensate for tmux starting time 5 | sleep 1 6 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/setup.exp: -------------------------------------------------------------------------------- 1 | # sourcing helper functions 2 | source "./test/helpers/expect_helpers.exp" 3 | source "./test/helpers/expect_copycat_helpers.exp" 4 | source "./test/helpers/expect_copycat_assertions.exp" 5 | 6 | # .tmux.conf 7 | exec "./test/helpers/setup_tmux_conf.sh" 8 | expect_setup 9 | 10 | # exit status global var is successful by default 11 | set exit_status 0 12 | 13 | # run tmux (doesn't work when within a proc) 14 | source "./test/helpers/run_tmux.exp" 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/setup_tmux_conf.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tests helper script for setting up `.tmux.conf` within the VM. 4 | # To be used by sourcing from within individual test scripts. 5 | BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" 6 | 7 | setup_tmux_conf() { 8 | # Copy mode (vi or emacs) is automatically determined from EDITOR 9 | # environment variable set in test runner file `test/run-tests-within-vm`. 10 | echo "bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel" > ~/.tmux.conf 11 | echo "bind-key -T copy-mode y send-keys -X copy-selection-and-cancel" >> ~/.tmux.conf 12 | echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf 13 | } 14 | setup_tmux_conf 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/setup_tmux_conf_with_custom_searches.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tests helper script for setting up `.tmux.conf` within the VM. 4 | # To be used by sourcing from within individual test scripts. 5 | 6 | BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" 7 | 8 | setup_tmux_conf() { 9 | # Copy mode (vi or emacs) is automatically determined from EDITOR 10 | # environment variable set in test runner file `test/run-tests-within-vm`. 11 | echo "bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel" > ~/.tmux.conf 12 | echo "bind-key -T copy-mode y send-keys -X copy-selection-and-cancel" >> ~/.tmux.conf 13 | echo "set -g @copycat_search_C-t 'random string[[:digit:]]+'" >> ~/.tmux.conf 14 | echo "run-shell '$BASE_DIR/copycat.tmux'" >> ~/.tmux.conf 15 | } 16 | setup_tmux_conf 17 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/setup_with_custom_searches.exp: -------------------------------------------------------------------------------- 1 | # sourcing helper functions 2 | source "./test/helpers/expect_helpers.exp" 3 | source "./test/helpers/expect_copycat_helpers.exp" 4 | source "./test/helpers/expect_copycat_assertions.exp" 5 | 6 | # .tmux.conf 7 | exec "./test/helpers/setup_tmux_conf_with_custom_searches.sh" 8 | expect_setup 9 | 10 | # exit status global var is successful by default 11 | set exit_status 0 12 | 13 | # run tmux (doesn't work when within a proc) 14 | source "./test/helpers/run_tmux.exp" 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/helpers/test.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | spawn bash 4 | send "./test/helpers/setup_tmux_conf.sh\r" 5 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/run-tests-within-vm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | # running test suite is successful by default 6 | tests_exit_value=0 7 | 8 | test_files() { 9 | ls -1 $CURRENT_DIR | # test files are in current dir 10 | \grep -i '^test' | # test file names start with 'test' 11 | xargs # file names in one line 12 | } 13 | 14 | set_global_exit_val_to_false() { 15 | tests_exit_value=1 16 | } 17 | 18 | run_test() { 19 | local test_file="$1" 20 | local tmux_copy_mode="$2" 21 | 22 | # running test 23 | echo "Test: $test_file (copy-mode $tmux_copy_mode)" 24 | 25 | # by setting the EDITOR var tmux chooses vi or emacs copy mode 26 | EDITOR="$tmux_copy_mode" $CURRENT_DIR/$test_file 27 | 28 | # handling exit value 29 | local exit_value="$?" 30 | if [ "$exit_value" == 0 ]; then 31 | echo "Success" 32 | else 33 | echo "Test failed!" 34 | set_global_exit_val_to_false 35 | fi 36 | echo 37 | } 38 | 39 | main() { 40 | local test_file 41 | local test_dir_path="./" 42 | for test_file in $(test_files); do 43 | run_test "$test_file" "vi" 44 | run_test "$test_file" "emacs" 45 | done 46 | exit "$tests_exit_value" 47 | } 48 | main 49 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/test/test_git_hash_search.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | source "./test/helpers/setup.exp" 4 | 5 | enter_test_git_repo 6 | 7 | # Match regular SHA-1 hashes 8 | #--------------------------- 9 | git_log_reverse 10 | tmux_alt_h 11 | assert_highlighted "935929c4c7265666e41e727f97a87d1af00a8b40" "match regular SHA-1 hashes" 12 | 13 | #Match shortened SHA-1 hashes 14 | #---------------------------- 15 | git_log_reverse_short 16 | tmux_alt_h 17 | assert_highlighted "935929c" "match shortened SHA-1 hashes" 18 | 19 | # quit 20 | #----- 21 | remove_test_git_repo 22 | teardown_and_exit 23 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/vagrant_ubuntu_provisioning_two_five.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # override PS1 prompt 4 | echo 'export PS1="\$ "' >> /home/vagrant/.bashrc 5 | # simplify irb prompt 6 | echo 'IRB.conf[:PROMPT_MODE] = :SIMPLE' >> /home/vagrant/.irbrc 7 | chown -R vagrant:vagrant /home/vagrant/.irbrc 8 | 9 | sudo apt-get update 10 | sudo apt-get install -y make 11 | sudo apt-get install -y git-core expect vim gawk 12 | sudo apt-get install -y python-software-properties software-properties-common 13 | 14 | # install Tmux 2.5 15 | VERSION=2.5 16 | sudo apt-get -y remove tmux 17 | sudo apt-get -y install wget tar libevent-dev libncurses-dev 18 | wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz 19 | tar xf tmux-${VERSION}.tar.gz 20 | rm -f tmux-${VERSION}.tar.gz 21 | cd tmux-${VERSION} 22 | ./configure 23 | make 24 | sudo make install 25 | cd - 26 | sudo rm -rf /usr/local/src/tmux-* 27 | sudo mv tmux-${VERSION} /usr/local/src 28 | 29 | # clone a repo used later for tests 30 | git clone https://github.com/tmux-plugins/tmux-example-plugin /home/vagrant/tmux-example-plugin 31 | chown -R vagrant:vagrant /home/vagrant/tmux-example-plugin 32 | 33 | sudo locale-gen "en_US.UTF-8" 34 | sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 35 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/video/README.md: -------------------------------------------------------------------------------- 1 | ## Tmux copycat screencast 2 | 3 | This directory contains docs used for creating 4 | [tmux copycat screencast](https://vimeo.com/101867689). 5 | 6 | - `script.md` - this file contains a script and a voiceover used to produce the 7 | screencast 8 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-copycat/video/screencast_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-copycat/video/screencast_img.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ### master 4 | - to speed up the "online test" ping uses only 1 packet 5 | - fix issue with status-right and status-left whitespace being cut out 6 | - add ping default timeout (@mjwhitta) 7 | 8 | ### v1.0.0, 2014-10-26 9 | - README updates 10 | - update readme to reflect github organization changes 11 | - linux can't display default offline icon - update it 12 | - add "@route_to_ping" option 13 | 14 | ### v0.0.2, 2014-06-02 15 | - bugfix: offline status icon wasn't displaying properly 16 | 17 | ### v0.0.1, 2014-06-02 18 | - first working version 19 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Bruno Sutic 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/online_status.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | online_status_icon="#($CURRENT_DIR/scripts/online_status_icon.sh)" 6 | online_status_interpolation_string="\#{online_status}" 7 | 8 | source $CURRENT_DIR/scripts/shared.sh 9 | 10 | do_interpolation() { 11 | local string="$1" 12 | local interpolated="${string/$online_status_interpolation_string/$online_status_icon}" 13 | echo "$interpolated" 14 | } 15 | 16 | update_tmux_option() { 17 | local option="$1" 18 | local option_value="$(get_tmux_option "$option")" 19 | local new_option_value="$(do_interpolation "$option_value")" 20 | set_tmux_option "$option" "$new_option_value" 21 | } 22 | 23 | main() { 24 | update_tmux_option "status-right" 25 | update_tmux_option "status-left" 26 | } 27 | main 28 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/screenshots/offline_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-online-status/screenshots/offline_indicator.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/screenshots/offline_indicator_linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-online-status/screenshots/offline_indicator_linux.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/screenshots/online_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-online-status/screenshots/online_indicator.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/screenshots/online_indicator_linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-online-status/screenshots/online_indicator_linux.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/scripts/online_status_icon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | online_option_string="@online_icon" 6 | offline_option_string="@offline_icon" 7 | ping_timeout_string="@ping_timeout" 8 | route_to_ping_string="@route_to_ping" 9 | 10 | online_icon_osx="✅ " 11 | online_icon="✔" 12 | offline_icon_osx="⛔️ " 13 | offline_icon_cygwin="X" 14 | offline_icon="❌ " 15 | ping_timeout_default="3" 16 | route_to_ping_default="www.google.com" 17 | 18 | source $CURRENT_DIR/shared.sh 19 | 20 | is_osx() { 21 | [ $(uname) == "Darwin" ] 22 | } 23 | 24 | is_cygwin() { 25 | [[ $(uname) =~ CYGWIN ]] 26 | } 27 | 28 | is_freebsd() { 29 | [ $(uname) == FreeBSD ] 30 | } 31 | 32 | online_icon_default() { 33 | if is_osx; then 34 | echo "$online_icon_osx" 35 | else 36 | echo "$online_icon" 37 | fi 38 | } 39 | 40 | offline_icon_default() { 41 | if is_osx; then 42 | echo "$offline_icon_osx" 43 | elif is_cygwin; then 44 | echo "$offline_icon_cygwin" 45 | else 46 | echo "$offline_icon" 47 | fi 48 | } 49 | 50 | online_status() { 51 | if is_osx || is_freebsd; then 52 | local timeout_flag="-t" 53 | else 54 | local timeout_flag="-w" 55 | fi 56 | if is_cygwin; then 57 | local number_pings_flag="-n" 58 | else 59 | local number_pings_flag="-c" 60 | fi 61 | local ping_timeout="$(get_tmux_option "$ping_timeout_string" "$ping_timeout_default")" 62 | local ping_route="$(get_tmux_option "$route_to_ping_string" "$route_to_ping_default")" 63 | ping "$number_pings_flag" 1 "$timeout_flag" "$ping_timeout" "$ping_route" >/dev/null 2>&1 64 | } 65 | 66 | print_icon() { 67 | if $(online_status); then 68 | printf "$(get_tmux_option "$online_option_string" "$(online_icon_default)")" 69 | else 70 | printf "$(get_tmux_option "$offline_option_string" "$(offline_icon_default)")" 71 | fi 72 | } 73 | 74 | main() { 75 | print_icon 76 | } 77 | main 78 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-online-status/scripts/shared.sh: -------------------------------------------------------------------------------- 1 | get_tmux_option() { 2 | local option=$1 3 | local default_value=$2 4 | local option_value=$(tmux show-option -gqv "$option") 5 | if [ -z "$option_value" ]; then 6 | echo "$default_value" 7 | else 8 | echo "$option_value" 9 | fi 10 | } 11 | 12 | set_tmux_option() { 13 | local option="$1" 14 | local value="$2" 15 | tmux set-option -gq "$option" "$value" 16 | } 17 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ### master 4 | 5 | ### v3.0.0, Nov 01, 2017 6 | - enable extensibility via search engines (@vasconcelloslf) 7 | - cygwin support 8 | - add support for tmux 2.4 and above (@docwhat) 9 | 10 | ### v2.0.0, Nov 01, 2014 11 | - 'open editor' command can now open files that have spaces 12 | - system open command can now open files that have spaces 13 | - change "@open-editor" options to use hyphens (bc tmux core uses those too) 14 | 15 | ### v1.0.0, Aug 03, 2014 16 | - if $EDITOR env var is not set, provide fallback 17 | - increase `open` command reliability by first `cd`-ing to the current PWD 18 | - add links to related plugins to the readme 19 | - add screencast script to the repo 20 | - add screencast video link to the README 21 | - add installation instructions 22 | 23 | ### v0.0.2, Aug 02, 2014 24 | - add readme 25 | - refactor `command_generator` 26 | - improve open (`o`) command 27 | 28 | ### v0.0.1, Aug 01, 2014 29 | - started the project 30 | - first working version 31 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Bruno Sutic 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 18 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 19 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/scripts/helpers.sh: -------------------------------------------------------------------------------- 1 | get_tmux_option() { 2 | local option="$1" 3 | local default_value="$2" 4 | local option_value=$(tmux show-option -gqv "$option") 5 | if [ -z "$option_value" ]; then 6 | echo "$default_value" 7 | else 8 | echo "$option_value" 9 | fi 10 | } 11 | 12 | # Ensures a message is displayed for 5 seconds in tmux prompt. 13 | # Does not override the 'display-time' tmux option. 14 | display_message() { 15 | local message="$1" 16 | 17 | # display_duration defaults to 5 seconds, if not passed as an argument 18 | if [ "$#" -eq 2 ]; then 19 | local display_duration="$2" 20 | else 21 | local display_duration="5000" 22 | fi 23 | 24 | # saves user-set 'display-time' option 25 | local saved_display_time=$(get_tmux_option "display-time" "750") 26 | 27 | # sets message display time to 5 seconds 28 | tmux set-option -gq display-time "$display_duration" 29 | 30 | # displays message 31 | tmux display-message "$message" 32 | 33 | # restores original 'display-time' value 34 | tmux set-option -gq display-time "$saved_display_time" 35 | } 36 | 37 | stored_engine_vars() { 38 | tmux show-options -g | grep -i "^@open" | cut -d '-' -f2 | cut -d ' ' -f1 | xargs 39 | } 40 | 41 | get_engine() { 42 | local engine_var="$1" 43 | tmux show-options -g | grep -i "^@open-$engine_var" | cut -d ' ' -f2 | xargs 44 | } 45 | 46 | tmux_version="$(tmux -V | cut -d ' ' -f 2)" 47 | tmux-is-at-least() { 48 | if [[ $tmux_version == $1 ]] 49 | then 50 | return 0 51 | fi 52 | 53 | local IFS=. 54 | local i tver=($tmux_version) wver=($1) 55 | 56 | # fill empty fields in tver with zeros 57 | for ((i=${#tver[@]}; i<${#wver[@]}; i++)); do 58 | tver[i]=0 59 | done 60 | 61 | # fill empty fields in wver with zeros 62 | for ((i=${#wver[@]}; i<${#tver[@]}; i++)); do 63 | wver[i]=0 64 | done 65 | 66 | for ((i=0; i<${#tver[@]}; i++)); do 67 | if ((10#${tver[i]} < 10#${wver[i]})); then 68 | return 1 69 | elif ((10#${tver[i]} > 10#${wver[i]})); then 70 | return 0 71 | fi 72 | done 73 | return 0 74 | } 75 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/scripts/tmux_open_error_message.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | 7 | MISSING_PROGRAM="$1" 8 | 9 | main() { 10 | display_message "tmux-open error! Please make sure '$MISSING_PROGRAM' is installed." 11 | } 12 | main 13 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/video/screencast_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-open/video/screencast_img.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-open/video/script.md: -------------------------------------------------------------------------------- 1 | # Screencast script 2 | 3 | 1. Intro 4 | ======== 5 | Let's demo tmux-open plugin. 6 | 7 | Tmux open defines 2 copy mode key bindings: o and control-o. 8 | - o is a mnemonic for 'open' and it can open various files, directories and 9 | urls. 10 | - control-o opens files with the default text editor. 11 | 12 | 2. o - features 13 | =============== 14 | Let's first show the 'o' key functionality. 15 | 16 | I'm in a git project so I can invoke 'git status'. 17 | 18 | I want to open that example directory. I'll quickly highlight it using 19 | tmux copycat. 20 | Now I can press 'o' for opening. 21 | 22 | You can see the directory is opened in the OS X Finder app - the default file 23 | manager. 24 | 25 | 26 | I'm also curious about that 'tmux.pdf' file too. 27 | Again, I'll highlight it. 28 | And then press 'o'. 29 | 30 | Oh cool, it's a book about tmux. 31 | 32 | 33 | Nice thing with 'o' key binding is that it works for url's too. 34 | I'll start a local web-server that serves current project README file. 35 | I'll highlight the url, 36 | - press 'o' 37 | - and the url is opened in the default web browser. 38 | 39 | 3. ctrl-o - features 40 | ==================== 41 | Control-o has a more narrow scope: it can open any file in the default text 42 | editor. 43 | 44 | I'll invoke git status again. 45 | There I have a text file I want to open. I'll highlight it, 46 | and press ctrl-o. 47 | 48 | As you can see, the file is opened in vim, which is my default text editor. 49 | 50 | 4. Outro 51 | ======== 52 | That's it for this screencast. I hope you'll find tmux-open plugin useful. 53 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-plugin-sysstat/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Alexey Samoshkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /.tmux/plugins/tmux-plugin-sysstat/screenshots/cpu_thresholds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-plugin-sysstat/screenshots/cpu_thresholds.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-plugin-sysstat/screenshots/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-plugin-sysstat/screenshots/intro.png -------------------------------------------------------------------------------- /.tmux/plugins/tmux-plugin-sysstat/scripts/cpu_collect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | LC_NUMERIC=C 4 | 5 | set -u 6 | set -e 7 | 8 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | source "$CURRENT_DIR/helpers.sh" 10 | 11 | refresh_interval=$(get_tmux_option "status-interval" "5") 12 | samples_count="60" 13 | cpu_metric_file="$(get_tmux_option "@sysstat_cpu_tmp_dir" "/dev/null")/cpu_collect.metric" 14 | 15 | get_cpu_usage() { 16 | if is_osx; then 17 | if command_exists "iostat"; then 18 | iostat -w "$refresh_interval" -c "$samples_count" \ 19 | | stdbuf -o0 awk 'NR > 2 { print 100-$(NF-3); }' 20 | else 21 | top -l "$samples_count" -s "$refresh_interval" -n 0 \ 22 | | sed -u -nr '/CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p' \ 23 | | stdbuf -o0 awk '{ print 100-$0 }' 24 | fi 25 | elif ! command_exists "vmstat"; then 26 | if is_freebsd; then 27 | vmstat -n "$refresh_interval" -c "$samples_count" \ 28 | | stdbuf -o0 awk 'NR>2 {print 100-$(NF-0)}' 29 | else 30 | vmstat -n "$refresh_interval" "$samples_count" \ 31 | | stdbuf -o0 awk 'NR>2 {print 100-$(NF-2)}' 32 | fi 33 | else 34 | if is_freebsd; then 35 | top -d"$samples_count" \ 36 | | sed -u -nr '/CPU:/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*id.*/\1/p' \ 37 | | stdbuf -o0 awk '{ print 100-$0 }' 38 | else 39 | top -b -n "$samples_count" -d "$refresh_interval" \ 40 | | sed -u -nr '/%Cpu/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)[[:space:]]*id.*/\1/p' \ 41 | | stdbuf -o0 awk '{ print 100-$0 }' 42 | fi 43 | fi 44 | } 45 | 46 | main() { 47 | get_cpu_usage | while read -r value; do 48 | echo "$value" | tee "$cpu_metric_file" 49 | done 50 | } 51 | 52 | main 53 | 54 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-plugin-sysstat/scripts/helpers.sh: -------------------------------------------------------------------------------- 1 | 2 | get_tmux_option() { 3 | local option="$1" 4 | local default_value="$2" 5 | local option_value="$(tmux show-option -gqv "$option")" 6 | if [ -z "$option_value" ]; then 7 | echo "$default_value" 8 | else 9 | echo "$option_value" 10 | fi 11 | } 12 | 13 | set_tmux_option() { 14 | local option="$1" 15 | local value="$2" 16 | tmux set-option -gq "$option" "$value" 17 | } 18 | 19 | is_osx() { 20 | [ $(uname) == "Darwin" ] 21 | } 22 | 23 | is_linux(){ 24 | [ $(uname -s) == "Linux" ] 25 | } 26 | 27 | is_freebsd() { 28 | [ $(uname) == FreeBSD ] 29 | } 30 | 31 | command_exists() { 32 | local command="$1" 33 | type "$command" >/dev/null 2>&1 34 | } 35 | 36 | # because bash does not support floating-point math 37 | # but awk does 38 | calc() { 39 | local stdin; 40 | read -d '' -u 0 stdin; 41 | awk "BEGIN { print $stdin }"; 42 | } 43 | 44 | # "<" math operator which works with floats, once again based on awk 45 | fcomp() { 46 | awk -v n1="$1" -v n2="$2" 'BEGIN {if (n1 How can I run some other command in the sidebar? 7 | 8 | set -g @sidebar-tree-command 'ls -1' 9 | 10 | > Can I have the sidebar on the right? 11 | 12 | set -g @sidebar-tree-position 'right' 13 | 14 | > I don't like the default 'prefix + Tab' key binding. Can I change it to be 15 | 'prefix + e'? 16 | 17 | set -g @sidebar-tree 'e' 18 | 19 | > How can I change the default 'prefix + Backspace' to be 'prefix + w'? 20 | 21 | set -g @sidebar-tree-focus 'w' 22 | 23 | > I see the tree sidebar uses 'less' as a pager. I would like to use 'view'. 24 | 25 | set -g @sidebar-tree-pager 'view -' 26 | 27 | > The default sidebar width is 40 columns. I want the sidebar to be wider by 28 | default! 29 | 30 | set -g @sidebar-tree-width '60' 31 | 32 | > Can I colorize the ``tree`` directory listing in the sidebar? 33 | 34 | set -g @sidebar-tree-command 'tree -C' 35 | 36 | ### Notes 37 | 38 | The command used to display the directory listing 39 | (`@sidebar-tree-pager`, if set) must support color codes. If it does not, 40 | unusual characters - the color control codes - will be visible in the sidebar. 41 | 42 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/.tmux/plugins/tmux-sidebar/screenshot.gif -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/scripts/check_tmux_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | VERSION="$1" 4 | UNSUPPORTED_MSG="$2" 5 | 6 | get_tmux_option() { 7 | local option=$1 8 | local default_value=$2 9 | local option_value=$(tmux show-option -gqv "$option") 10 | if [ -z "$option_value" ]; then 11 | echo "$default_value" 12 | else 13 | echo "$option_value" 14 | fi 15 | } 16 | 17 | # Ensures a message is displayed for 5 seconds in tmux prompt. 18 | # Does not override the 'display-time' tmux option. 19 | display_message() { 20 | local message="$1" 21 | 22 | # display_duration defaults to 5 seconds, if not passed as an argument 23 | if [ "$#" -eq 2 ]; then 24 | local display_duration="$2" 25 | else 26 | local display_duration="5000" 27 | fi 28 | 29 | # saves user-set 'display-time' option 30 | local saved_display_time=$(get_tmux_option "display-time" "750") 31 | 32 | # sets message display time to 5 seconds 33 | tmux set-option -gq display-time "$display_duration" 34 | 35 | # displays message 36 | tmux display-message "$message" 37 | 38 | # restores original 'display-time' value 39 | tmux set-option -gq display-time "$saved_display_time" 40 | } 41 | 42 | # this is used to get "clean" integer version number. Examples: 43 | # `tmux 1.9` => `19` 44 | # `1.9a` => `19` 45 | get_digits_from_string() { 46 | local string="$1" 47 | local only_digits="$(echo "$string" | tr -dC '[:digit:]')" 48 | echo "$only_digits" 49 | } 50 | 51 | tmux_version_int() { 52 | local tmux_version_string=$(tmux -V) 53 | echo "$(get_digits_from_string "$tmux_version_string")" 54 | } 55 | 56 | unsupported_version_message() { 57 | if [ -n "$UNSUPPORTED_MSG" ]; then 58 | echo "$UNSUPPORTED_MSG" 59 | else 60 | echo "Error, Tmux version unsupported! Please install Tmux version $VERSION or greater!" 61 | fi 62 | } 63 | 64 | exit_if_unsupported_version() { 65 | local current_version="$1" 66 | local supported_version="$2" 67 | if [ "$current_version" -lt "$supported_version" ]; then 68 | display_message "$(unsupported_version_message)" 69 | exit 1 70 | fi 71 | } 72 | 73 | main() { 74 | local supported_version_int="$(get_digits_from_string "$VERSION")" 75 | local current_version_int="$(tmux_version_int)" 76 | exit_if_unsupported_version "$current_version_int" "$supported_version_int" 77 | } 78 | main 79 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/scripts/custom_tree.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | find . -path '*/.git*' -prune -o -print | 4 | sed -e 's;[^/]*/;|___;g;s;___|; |;g' 5 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/scripts/save_sidebar_width.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | source "$CURRENT_DIR/helpers.sh" 6 | source "$CURRENT_DIR/variables.sh" 7 | 8 | DIR_PATH="$(echo "$1" | tail -1)" # fixes a bug with invalid param 9 | WIDTH="$2" 10 | delimiter=$'\t' 11 | 12 | replace_directory_width() { 13 | sed "s|^${DIR_PATH}${delimiter}.*|${DIR_PATH}${delimiter}${WIDTH}|g" $(sidebar_file) > $(sidebar_file).bak 14 | mv $(sidebar_file).bak $(sidebar_file) 15 | } 16 | 17 | add_directory_width() { 18 | mkdir -p "$(sidebar_dir)" 19 | echo "${DIR_PATH}${delimiter}${WIDTH}" >> $(sidebar_file) 20 | } 21 | 22 | save_sidebar_width() { 23 | if directory_in_sidebar_file "$DIR_PATH"; then 24 | replace_directory_width 25 | else 26 | add_directory_width 27 | fi 28 | } 29 | 30 | main() { 31 | save_sidebar_width 32 | } 33 | main 34 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/scripts/tree_helpers.sh: -------------------------------------------------------------------------------- 1 | # file sourced from ./sidebar.tmux 2 | custom_tree_command="$CURRENT_DIR/scripts/custom_tree.sh" 3 | 4 | command_exists() { 5 | local command="$1" 6 | type "$command" >/dev/null 2>&1 7 | } 8 | 9 | tree_command() { 10 | local user_command="$(tree_user_command)" 11 | if [ -n "$user_command" ]; then 12 | echo "$user_command" 13 | elif command_exists "tree"; then 14 | echo "$TREE_COMMAND" 15 | else 16 | echo "$custom_tree_command" 17 | fi 18 | } 19 | 20 | tree_user_command() { 21 | get_tmux_option "$TREE_COMMAND_OPTION" "" 22 | } 23 | 24 | tree_key() { 25 | get_tmux_option "$TREE_OPTION" "$TREE_KEY" 26 | } 27 | 28 | tree_focus_key() { 29 | get_tmux_option "$TREE_FOCUS_OPTION" "$TREE_FOCUS_KEY" 30 | } 31 | 32 | tree_pager() { 33 | get_tmux_option "$TREE_PAGER_OPTION" "$TREE_PAGER" 34 | } 35 | 36 | tree_position() { 37 | get_tmux_option "$TREE_POSITION_OPTION" "$TREE_POSITION" 38 | } 39 | 40 | tree_width() { 41 | get_tmux_option "$TREE_WIDTH_OPTION" "$TREE_WIDTH" 42 | } 43 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/scripts/variables.sh: -------------------------------------------------------------------------------- 1 | VAR_KEY_PREFIX="@sidebar-key" 2 | REGISTERED_PANE_PREFIX="@-sidebar-registered-pane" 3 | REGISTERED_SIDEBAR_PREFIX="@-sidebar-is-sidebar" 4 | MINIMUM_WIDTH_FOR_SIDEBAR="71" 5 | 6 | TREE_KEY="Tab" 7 | TREE_OPTION="@sidebar-tree" 8 | 9 | TREE_FOCUS_KEY="Bspace" 10 | TREE_FOCUS_OPTION="@sidebar-tree-focus" 11 | 12 | TREE_COMMAND="tree" 13 | TREE_COMMAND_OPTION="@sidebar-tree-command" 14 | 15 | TREE_PAGER='sh -c "LESS= less --dumb --chop-long-lines --tilde --IGNORE-CASE --RAW-CONTROL-CHARS"' 16 | TREE_PAGER_OPTION="@sidebar-tree-pager" 17 | 18 | TREE_POSITION="left" 19 | TREE_POSITION_OPTION="@sidebar-tree-position" 20 | 21 | TREE_WIDTH="40" 22 | TREE_WIDTH_OPTION="@sidebar-tree-width" 23 | 24 | SUPPORTED_TMUX_VERSION="1.9" 25 | 26 | SIDEBAR_DIR="$HOME/.tmux/sidebar" 27 | -------------------------------------------------------------------------------- /.tmux/plugins/tmux-sidebar/sidebar.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | SCRIPTS_DIR="$CURRENT_DIR/scripts" 5 | 6 | source "$SCRIPTS_DIR/helpers.sh" 7 | source "$SCRIPTS_DIR/variables.sh" 8 | source "$SCRIPTS_DIR/tree_helpers.sh" 9 | 10 | set_default_key_binding_options() { 11 | local tree_command="$(tree_command)" 12 | local tree_key="$(tree_key)" 13 | local tree_focus_key="$(tree_focus_key)" 14 | local tree_pager="$(tree_pager)" 15 | local tree_position="$(tree_position)" 16 | local tree_width="$(tree_width)" 17 | 18 | set_tmux_option "${VAR_KEY_PREFIX}-${tree_key}" "$tree_command | ${tree_pager},${tree_position},${tree_width}" 19 | set_tmux_option "${VAR_KEY_PREFIX}-${tree_focus_key}" "$tree_command | ${tree_pager},${tree_position},${tree_width},focus" 20 | } 21 | 22 | set_key_bindings() { 23 | local stored_key_vars="$(stored_key_vars)" 24 | local search_var 25 | local key 26 | local pattern 27 | for option in $stored_key_vars; do 28 | key="$(get_key_from_option_name "$option")" 29 | value="$(get_value_from_option_name "$option")" 30 | tmux bind-key "$key" run-shell "$SCRIPTS_DIR/toggle.sh '$value' '#{pane_id}'" 31 | done 32 | } 33 | 34 | main() { 35 | set_default_key_binding_options 36 | set_key_bindings 37 | } 38 | main 39 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/HOW_TO_PLUGIN.md: -------------------------------------------------------------------------------- 1 | Instructions moved to 2 | [docs/how_to_create_plugin.md](docs/how_to_create_plugin.md). 3 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT license 2 | Copyright (C) 2014 Bruno Sutic 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bin/clean_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script intended for use via the command line. 4 | # 5 | # `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system, 6 | # but does not need to be started in order to run this script. 7 | 8 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 10 | 11 | main() { 12 | "$SCRIPTS_DIR/clean_plugins.sh" # has correct exit code 13 | } 14 | main 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bin/install_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script intended for use via the command line. 4 | # 5 | # `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system, 6 | # but does not need to be started in order to run this script. 7 | 8 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 10 | 11 | main() { 12 | "$SCRIPTS_DIR/install_plugins.sh" # has correct exit code 13 | } 14 | main 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bin/update_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script intended for use via the command line. 4 | # 5 | # `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system, 6 | # but does not need to be started in order to run this script. 7 | 8 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 10 | PROGRAM_NAME="$0" 11 | 12 | if [ $# -eq 0 ]; then 13 | echo "usage:" 14 | echo " $PROGRAM_NAME all update all plugins" 15 | echo " $PROGRAM_NAME tmux-foo update plugin 'tmux-foo'" 16 | echo " $PROGRAM_NAME tmux-bar tmux-baz update multiple plugins" 17 | exit 1 18 | fi 19 | 20 | main() { 21 | "$SCRIPTS_DIR/update_plugin.sh" --shell-echo "$*" # has correct exit code 22 | } 23 | main "$*" 24 | 25 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bindings/clean_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tmux key-binding script. 4 | # Scripts intended to be used via the command line are in `bin/` directory. 5 | 6 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 8 | HELPERS_DIR="$SCRIPTS_DIR/helpers" 9 | 10 | source "$HELPERS_DIR/tmux_echo_functions.sh" 11 | source "$HELPERS_DIR/tmux_utils.sh" 12 | 13 | main() { 14 | reload_tmux_environment 15 | "$SCRIPTS_DIR/clean_plugins.sh" --tmux-echo >/dev/null 2>&1 16 | reload_tmux_environment 17 | end_message 18 | } 19 | main 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bindings/install_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tmux key-binding script. 4 | # Scripts intended to be used via the command line are in `bin/` directory. 5 | 6 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 8 | HELPERS_DIR="$SCRIPTS_DIR/helpers" 9 | 10 | source "$HELPERS_DIR/tmux_echo_functions.sh" 11 | source "$HELPERS_DIR/tmux_utils.sh" 12 | 13 | main() { 14 | reload_tmux_environment 15 | "$SCRIPTS_DIR/install_plugins.sh" --tmux-echo >/dev/null 2>&1 16 | reload_tmux_environment 17 | end_message 18 | } 19 | main 20 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/bindings/update_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tmux key-binding script. 4 | # Scripts intended to be used via the command line are in `bin/` directory. 5 | 6 | # This script: 7 | # - shows a list of installed plugins 8 | # - starts a prompt to enter the name of the plugin that will be updated 9 | 10 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 11 | SCRIPTS_DIR="$CURRENT_DIR/../scripts" 12 | HELPERS_DIR="$SCRIPTS_DIR/helpers" 13 | 14 | source "$HELPERS_DIR/plugin_functions.sh" 15 | source "$HELPERS_DIR/tmux_echo_functions.sh" 16 | source "$HELPERS_DIR/tmux_utils.sh" 17 | 18 | display_plugin_update_list() { 19 | local plugins="$(tpm_plugins_list_helper)" 20 | tmux_echo "Installed plugins:" 21 | tmux_echo "" 22 | 23 | for plugin in $plugins; do 24 | # displaying only installed plugins 25 | if plugin_already_installed "$plugin"; then 26 | local plugin_name="$(plugin_name_helper "$plugin")" 27 | tmux_echo " $plugin_name" 28 | fi 29 | done 30 | 31 | tmux_echo "" 32 | tmux_echo "Type plugin name to update it." 33 | tmux_echo "" 34 | tmux_echo "- \"all\" - updates all plugins" 35 | tmux_echo "- ENTER - cancels" 36 | } 37 | 38 | update_plugin_prompt() { 39 | tmux command-prompt -p 'plugin update:' " \ 40 | send-keys C-c; \ 41 | run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'" 42 | } 43 | 44 | main() { 45 | reload_tmux_environment 46 | display_plugin_update_list 47 | update_plugin_prompt 48 | } 49 | main 50 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/docs/automatic_tpm_installation.md: -------------------------------------------------------------------------------- 1 | # Automatic tpm installation 2 | 3 | One of the first things we do on a new machine is cloning our dotfiles. Not everything comes with them though, so for example `tpm` most likely won't be installed. 4 | 5 | If you want to install `tpm` and plugins automatically when tmux is started, put the following snippet in `.tmux.conf` before the final `run '~/.tmux/plugins/tpm/tpm'`: 6 | 7 | ``` 8 | if "test ! -d ~/.tmux/plugins/tpm" \ 9 | "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" 10 | ``` 11 | 12 | This useful tip was submitted by @acr4 and narfman0. 13 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/docs/changing_plugins_install_dir.md: -------------------------------------------------------------------------------- 1 | # Changing plugins install dir 2 | 3 | By default, TPM installs plugins to `~/.tmux/plugins/`. 4 | 5 | You can change the install path by putting this in `.tmux.conf`: 6 | 7 | set-environment -g TMUX_PLUGIN_MANAGER_PATH '/some/other/path/' 8 | 9 | Tmux plugin manager initialization in `.tmux.conf` should also be updated: 10 | 11 | # initializes TMUX plugin manager in a new path 12 | run /some/other/path/tpm/tpm 13 | 14 | Please make sure that the `run` line is at the very bottom of `.tmux.conf`. 15 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/docs/managing_plugins_via_cmd_line.md: -------------------------------------------------------------------------------- 1 | # Managing plugins via the command line 2 | 3 | Aside from tmux key bindings, TPM provides shell interface for managing plugins 4 | via scripts located in [bin/](../bin/) directory. 5 | 6 | Tmux does not need to be started in order to run scripts (but it's okay if it 7 | is). If you [changed tpm install dir](../docs/changing_plugins_install_dir.md) 8 | in `.tmux.conf` that should work fine too. 9 | 10 | Prerequisites: 11 | 12 | - tmux installed on the system (doh) 13 | - `.tmux.conf` set up for TPM 14 | 15 | ### Installing plugins 16 | 17 | As usual, plugins need to be specified in `.tmux.conf`. Run the following 18 | command to install plugins: 19 | 20 | ~/.tmux/plugins/tpm/bin/install_plugins 21 | 22 | ### Updating plugins 23 | 24 | To update all installed plugins: 25 | 26 | ~/.tmux/plugins/tpm/bin/update_plugins all 27 | 28 | or update a single plugin: 29 | 30 | ~/.tmux/plugins/tpm/bin/update_plugins tmux-sensible 31 | 32 | ### Removing plugins 33 | 34 | To remove plugins not on the plugin list: 35 | 36 | ~/.tmux/plugins/tpm/bin/clean_plugins 37 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/check_tmux_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | VERSION="$1" 4 | UNSUPPORTED_MSG="$2" 5 | 6 | get_tmux_option() { 7 | local option=$1 8 | local default_value=$2 9 | local option_value=$(tmux show-option -gqv "$option") 10 | if [ -z "$option_value" ]; then 11 | echo "$default_value" 12 | else 13 | echo "$option_value" 14 | fi 15 | } 16 | 17 | # Ensures a message is displayed for 5 seconds in tmux prompt. 18 | # Does not override the 'display-time' tmux option. 19 | display_message() { 20 | local message="$1" 21 | 22 | # display_duration defaults to 5 seconds, if not passed as an argument 23 | if [ "$#" -eq 2 ]; then 24 | local display_duration="$2" 25 | else 26 | local display_duration="5000" 27 | fi 28 | 29 | # saves user-set 'display-time' option 30 | local saved_display_time=$(get_tmux_option "display-time" "750") 31 | 32 | # sets message display time to 5 seconds 33 | tmux set-option -gq display-time "$display_duration" 34 | 35 | # displays message 36 | tmux display-message "$message" 37 | 38 | # restores original 'display-time' value 39 | tmux set-option -gq display-time "$saved_display_time" 40 | } 41 | 42 | # this is used to get "clean" integer version number. Examples: 43 | # `tmux 1.9` => `19` 44 | # `1.9a` => `19` 45 | get_digits_from_string() { 46 | local string="$1" 47 | local only_digits="$(echo "$string" | tr -dC '[:digit:]')" 48 | echo "$only_digits" 49 | } 50 | 51 | tmux_version_int() { 52 | local tmux_version_string=$(tmux -V) 53 | echo "$(get_digits_from_string "$tmux_version_string")" 54 | } 55 | 56 | unsupported_version_message() { 57 | if [ -n "$UNSUPPORTED_MSG" ]; then 58 | echo "$UNSUPPORTED_MSG" 59 | else 60 | echo "Error, Tmux version unsupported! Please install Tmux version $VERSION or greater!" 61 | fi 62 | } 63 | 64 | exit_if_unsupported_version() { 65 | local current_version="$1" 66 | local supported_version="$2" 67 | if [ "$current_version" -lt "$supported_version" ]; then 68 | display_message "$(unsupported_version_message)" 69 | exit 1 70 | fi 71 | } 72 | 73 | main() { 74 | local supported_version_int="$(get_digits_from_string "$VERSION")" 75 | local current_version_int="$(tmux_version_int)" 76 | exit_if_unsupported_version "$current_version_int" "$supported_version_int" 77 | } 78 | main 79 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/clean_plugins.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | HELPERS_DIR="$CURRENT_DIR/helpers" 5 | 6 | source "$HELPERS_DIR/plugin_functions.sh" 7 | source "$HELPERS_DIR/utility.sh" 8 | 9 | if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions 10 | source "$HELPERS_DIR/tmux_echo_functions.sh" 11 | else # shell output functions 12 | source "$HELPERS_DIR/shell_echo_functions.sh" 13 | fi 14 | 15 | clean_plugins() { 16 | local plugins plugin plugin_directory 17 | plugins="$(tpm_plugins_list_helper)" 18 | 19 | for plugin_directory in "$(tpm_path)"/*; do 20 | [ -d "${plugin_directory}" ] || continue 21 | plugin="$(plugin_name_helper "${plugin_directory}")" 22 | case "${plugins}" in 23 | *"${plugin}"*) : ;; 24 | *) 25 | [ "${plugin}" = "tpm" ] && continue 26 | echo_ok "Removing \"$plugin\"" 27 | rm -rf "${plugin_directory}" >/dev/null 2>&1 28 | [ -d "${plugin_directory}" ] && 29 | echo_err " \"$plugin\" clean fail" || 30 | echo_ok " \"$plugin\" clean success" 31 | ;; 32 | esac 33 | done 34 | } 35 | 36 | main() { 37 | ensure_tpm_path_exists 38 | clean_plugins 39 | exit_value_helper 40 | } 41 | main 42 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/helpers/shell_echo_functions.sh: -------------------------------------------------------------------------------- 1 | echo_ok() { 2 | echo "$*" 3 | } 4 | 5 | echo_err() { 6 | fail_helper "$*" 7 | } 8 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/helpers/tmux_echo_functions.sh: -------------------------------------------------------------------------------- 1 | _has_emacs_mode_keys() { 2 | $(tmux show -gw mode-keys | grep -q emacs) 3 | } 4 | 5 | tmux_echo() { 6 | local message="$1" 7 | tmux run-shell "echo '$message'" 8 | } 9 | 10 | echo_ok() { 11 | tmux_echo "$*" 12 | } 13 | 14 | echo_err() { 15 | tmux_echo "$*" 16 | } 17 | 18 | end_message() { 19 | if _has_emacs_mode_keys; then 20 | local continue_key="ESCAPE" 21 | else 22 | local continue_key="ENTER" 23 | fi 24 | tmux_echo "" 25 | tmux_echo "TMUX environment reloaded." 26 | tmux_echo "" 27 | tmux_echo "Done, press $continue_key to continue." 28 | } 29 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/helpers/tmux_utils.sh: -------------------------------------------------------------------------------- 1 | reload_tmux_environment() { 2 | tmux source-file ~/.tmux.conf >/dev/null 2>&1 3 | } 4 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/helpers/utility.sh: -------------------------------------------------------------------------------- 1 | ensure_tpm_path_exists() { 2 | mkdir -p "$(tpm_path)" 3 | } 4 | 5 | fail_helper() { 6 | local message="$1" 7 | echo "$message" >&2 8 | FAIL="true" 9 | } 10 | 11 | exit_value_helper() { 12 | if [ "$FAIL" == "true" ]; then 13 | exit 1 14 | else 15 | exit 0 16 | fi 17 | } 18 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/install_plugins.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | HELPERS_DIR="$CURRENT_DIR/helpers" 5 | 6 | source "$HELPERS_DIR/plugin_functions.sh" 7 | source "$HELPERS_DIR/utility.sh" 8 | 9 | if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions 10 | source "$HELPERS_DIR/tmux_echo_functions.sh" 11 | else # shell output functions 12 | source "$HELPERS_DIR/shell_echo_functions.sh" 13 | fi 14 | 15 | clone() { 16 | local plugin="$1" 17 | cd "$(tpm_path)" && 18 | GIT_TERMINAL_PROMPT=0 git clone --recursive "$plugin" >/dev/null 2>&1 19 | } 20 | 21 | # tries cloning: 22 | # 1. plugin name directly - works if it's a valid git url 23 | # 2. expands the plugin name to point to a github repo and tries cloning again 24 | clone_plugin() { 25 | local plugin="$1" 26 | clone "$plugin" || 27 | clone "https://git::@github.com/$plugin" 28 | } 29 | 30 | # clone plugin and produce output 31 | install_plugin() { 32 | local plugin="$1" 33 | local plugin_name="$(plugin_name_helper "$plugin")" 34 | 35 | if plugin_already_installed "$plugin"; then 36 | echo_ok "Already installed \"$plugin_name\"" 37 | else 38 | echo_ok "Installing \"$plugin_name\"" 39 | clone_plugin "$plugin" && 40 | echo_ok " \"$plugin_name\" download success" || 41 | echo_err " \"$plugin_name\" download fail" 42 | fi 43 | } 44 | 45 | install_plugins() { 46 | local plugins="$(tpm_plugins_list_helper)" 47 | for plugin in $plugins; do 48 | install_plugin "$plugin" 49 | done 50 | } 51 | 52 | verify_tpm_path_permissions() { 53 | local path="$(tpm_path)" 54 | # check the write permission flag for all users to ensure 55 | # that we have proper access 56 | [ -w "$path" ] || 57 | echo_err "$path is not writable!" 58 | } 59 | 60 | main() { 61 | ensure_tpm_path_exists 62 | verify_tpm_path_permissions 63 | install_plugins 64 | exit_value_helper 65 | } 66 | main 67 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/source_plugins.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | HELPERS_DIR="$CURRENT_DIR/helpers" 5 | 6 | source "$HELPERS_DIR/plugin_functions.sh" 7 | 8 | plugin_dir_exists() { 9 | [ -d "$1" ] 10 | } 11 | 12 | # Runs all *.tmux files from the plugin directory. 13 | # Files are ran as executables. 14 | # No errors if the plugin dir does not exist. 15 | silently_source_all_tmux_files() { 16 | local plugin_path="$1" 17 | local plugin_tmux_files="$plugin_path*.tmux" 18 | if plugin_dir_exists "$plugin_path"; then 19 | for tmux_file in $plugin_tmux_files; do 20 | # if the glob didn't find any files this will be the 21 | # unexpanded glob which obviously doesn't exist 22 | [ -f "$tmux_file" ] || continue 23 | # runs *.tmux file as an executable 24 | $tmux_file >/dev/null 2>&1 25 | done 26 | fi 27 | } 28 | 29 | source_plugins() { 30 | local plugin plugin_path 31 | local plugins="$(tpm_plugins_list_helper)" 32 | for plugin in $plugins; do 33 | plugin_path="$(plugin_path_helper "$plugin")" 34 | silently_source_all_tmux_files "$plugin_path" 35 | done 36 | } 37 | 38 | main() { 39 | source_plugins 40 | } 41 | main 42 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/update_plugin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # this script handles core logic of updating plugins 4 | 5 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | HELPERS_DIR="$CURRENT_DIR/helpers" 7 | 8 | source "$HELPERS_DIR/plugin_functions.sh" 9 | source "$HELPERS_DIR/utility.sh" 10 | 11 | if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions 12 | source "$HELPERS_DIR/tmux_echo_functions.sh" 13 | else # shell output functions 14 | source "$HELPERS_DIR/shell_echo_functions.sh" 15 | fi 16 | 17 | # from now on ignore first script argument 18 | shift 19 | 20 | pull_changes() { 21 | local plugin="$1" 22 | local plugin_path="$(plugin_path_helper "$plugin")" 23 | cd "$plugin_path" && 24 | GIT_TERMINAL_PROMPT=0 git pull && 25 | GIT_TERMINAL_PROMPT=0 git submodule update --init --recursive 26 | } 27 | 28 | update() { 29 | local plugin="$1" 30 | $(pull_changes "$plugin" > /dev/null 2>&1) && 31 | echo_ok " \"$plugin\" update success" || 32 | echo_err " \"$plugin\" update fail" 33 | } 34 | 35 | update_all() { 36 | echo_ok "Updating all plugins!" 37 | echo_ok "" 38 | local plugins="$(tpm_plugins_list_helper)" 39 | for plugin in $plugins; do 40 | local plugin_name="$(plugin_name_helper "$plugin")" 41 | # updating only installed plugins 42 | if plugin_already_installed "$plugin_name"; then 43 | update "$plugin_name" & 44 | fi 45 | done 46 | wait 47 | } 48 | 49 | update_plugins() { 50 | local plugins="$*" 51 | for plugin in $plugins; do 52 | local plugin_name="$(plugin_name_helper "$plugin")" 53 | if plugin_already_installed "$plugin_name"; then 54 | update "$plugin_name" & 55 | else 56 | echo_err "$plugin_name not installed!" & 57 | fi 58 | done 59 | wait 60 | } 61 | 62 | main() { 63 | ensure_tpm_path_exists 64 | if [ "$1" == "all" ]; then 65 | update_all 66 | else 67 | update_plugins "$*" 68 | fi 69 | exit_value_helper 70 | } 71 | main "$*" 72 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/update_plugin_prompt_handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | HELPERS_DIR="$CURRENT_DIR/helpers" 5 | 6 | if [ $# -eq 0 ]; then 7 | exit 0 8 | fi 9 | 10 | source "$HELPERS_DIR/tmux_echo_functions.sh" 11 | source "$HELPERS_DIR/tmux_utils.sh" 12 | 13 | main() { 14 | "$CURRENT_DIR/update_plugin.sh" --tmux-echo "$*" 15 | reload_tmux_environment 16 | end_message 17 | } 18 | main "$*" 19 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/scripts/variables.sh: -------------------------------------------------------------------------------- 1 | install_key_option="@tpm-install" 2 | default_install_key="I" 3 | 4 | update_key_option="@tpm-update" 5 | default_update_key="U" 6 | 7 | clean_key_option="@tpm-clean" 8 | default_clean_key="M-u" 9 | 10 | SUPPORTED_TMUX_VERSION="1.9" 11 | 12 | DEFAULT_TPM_ENV_VAR_NAME="TMUX_PLUGIN_MANAGER_PATH" 13 | DEFAULT_TPM_PATH="$HOME/.tmux/plugins/" 14 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_failed_plugin_download: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + I 13 | send "I" 14 | 15 | # cloning might take a while 16 | set timeout 20 17 | 18 | expect_after { 19 | timeout { exit 1 } 20 | } 21 | 22 | expect { 23 | "Installing \"non-existing-plugin\"" 24 | } 25 | 26 | expect { 27 | "\"non-existing-plugin\" download fail" 28 | } 29 | 30 | expect { 31 | "Done, press ENTER to continue" { 32 | exit 0 33 | } 34 | } 35 | 36 | exit 1 37 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_successful_clean_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + alt + u 13 | send "u" 14 | 15 | set timeout 5 16 | 17 | expect_after { 18 | timeout { exit 1 } 19 | } 20 | 21 | expect { 22 | "Removing \"tmux-example-plugin\"" 23 | } 24 | 25 | expect { 26 | "\"tmux-example-plugin\" clean success" 27 | } 28 | 29 | expect { 30 | "Done, press ENTER to continue." { 31 | exit 0 32 | } 33 | } 34 | 35 | exit 1 36 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_successful_multiple_plugins_download: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + I 13 | send "I" 14 | 15 | # cloning might take a while 16 | set timeout 15 17 | 18 | expect_after { 19 | timeout { exit 1 } 20 | } 21 | 22 | expect { 23 | "Installing \"tmux-example-plugin\"" 24 | } 25 | 26 | expect { 27 | "\"tmux-example-plugin\" download success" 28 | } 29 | 30 | expect { 31 | "Installing \"tmux-copycat\"" 32 | } 33 | 34 | expect { 35 | "\"tmux-copycat\" download success" 36 | } 37 | 38 | expect { 39 | "Done, press ENTER to continue." { 40 | exit 0 41 | } 42 | } 43 | 44 | exit 1 45 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_successful_plugin_download: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + I 13 | send "I" 14 | 15 | # cloning might take a while 16 | set timeout 15 17 | 18 | expect_after { 19 | timeout { exit 1 } 20 | } 21 | 22 | expect { 23 | "Installing \"tmux-example-plugin\"" 24 | } 25 | 26 | expect { 27 | "\"tmux-example-plugin\" download success" 28 | } 29 | 30 | expect { 31 | "Done, press ENTER to continue" { 32 | send " " 33 | } 34 | } 35 | 36 | sleep 1 37 | # this is tmux prefix + I 38 | send "I" 39 | 40 | expect { 41 | "Already installed \"tmux-example-plugin\"" 42 | } 43 | 44 | expect { 45 | "Done, press ENTER to continue" { 46 | exit 0 47 | } 48 | } 49 | 50 | exit 1 51 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_successful_update_of_a_single_plugin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + U 13 | send "U" 14 | 15 | set timeout 15 16 | 17 | expect_after { 18 | timeout { exit 1 } 19 | } 20 | 21 | expect { 22 | "Installed plugins" 23 | } 24 | 25 | expect { 26 | "tmux-example-plugin" 27 | } 28 | 29 | expect { 30 | "\"all\" - updates all plugins" 31 | } 32 | 33 | expect { 34 | "ENTER - cancels" 35 | } 36 | 37 | # wait for tmux to display prompt before sending characters 38 | sleep 1 39 | send "tmux-example-plugin\r" 40 | 41 | expect { 42 | "Updating \"tmux-example-plugin\"" 43 | } 44 | 45 | expect { 46 | "\"tmux-example-plugin\" update success" 47 | } 48 | 49 | expect { 50 | "Done, press ENTER to continue." { 51 | exit 0 52 | } 53 | } 54 | 55 | exit 1 56 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/expect_successful_update_of_all_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect 2 | 3 | # disables script output 4 | log_user 0 5 | 6 | spawn tmux 7 | 8 | # Waiting for tmux to attach. If this is not done, next command, `send` will 9 | # not work properly. 10 | sleep 1 11 | 12 | # this is tmux prefix + U 13 | send "U" 14 | 15 | set timeout 5 16 | 17 | expect_after { 18 | timeout { exit 1 } 19 | } 20 | 21 | expect { 22 | "Installed plugins" 23 | } 24 | 25 | expect { 26 | "tmux-example-plugin" 27 | } 28 | 29 | expect { 30 | "\"all\" - updates all plugins" 31 | } 32 | 33 | expect { 34 | "ENTER - cancels" 35 | } 36 | 37 | # wait for tmux to display prompt before sending characters 38 | sleep 1 39 | send "all\r" 40 | 41 | expect { 42 | "Updating all plugins!" 43 | } 44 | 45 | expect { 46 | "Updating \"tmux-example-plugin\"" 47 | } 48 | 49 | expect { 50 | "\"tmux-example-plugin\" update success" 51 | } 52 | 53 | expect { 54 | "Done, press ENTER to continue." { 55 | exit 0 56 | } 57 | } 58 | 59 | exit 1 60 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/helpers/tpm.sh: -------------------------------------------------------------------------------- 1 | check_dir_exists_helper() { 2 | [ -d "$1" ] 3 | } 4 | 5 | # runs the scripts and asserts it has the correct output and exit code 6 | script_run_helper() { 7 | local script="$1" 8 | local expected_output="$2" 9 | local expected_exit_code="${3:-0}" 10 | $script 2>&1 | 11 | grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early 12 | [ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ] 13 | } 14 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/test_plugin_clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | TPM_DIR="$PWD" 5 | PLUGINS_DIR="$HOME/.tmux/plugins" 6 | 7 | source "$CURRENT_DIR/helpers/helpers.sh" 8 | source "$CURRENT_DIR/helpers/tpm.sh" 9 | 10 | manually_install_the_plugin() { 11 | rm -rf "$PLUGINS_DIR" 12 | mkdir -p "$PLUGINS_DIR" 13 | cd "$PLUGINS_DIR" 14 | git clone --quiet https://github.com/tmux-plugins/tmux-example-plugin 15 | } 16 | 17 | # TMUX KEY-BINDING TESTS 18 | 19 | test_plugin_uninstallation_via_tmux_key_binding() { 20 | set_tmux_conf_helper <<- HERE 21 | set -g mode-keys vi 22 | run-shell "$TPM_DIR/tpm" 23 | HERE 24 | 25 | manually_install_the_plugin 26 | 27 | "$CURRENT_DIR/expect_successful_clean_plugins" || 28 | fail_helper "[key-binding] clean fails" 29 | 30 | teardown_helper 31 | } 32 | 33 | # SCRIPT TESTS 34 | 35 | test_plugin_uninstallation_via_script() { 36 | set_tmux_conf_helper <<- HERE 37 | set -g mode-keys vi 38 | run-shell "$TPM_DIR/tpm" 39 | HERE 40 | 41 | manually_install_the_plugin 42 | 43 | script_run_helper "$TPM_DIR/bin/clean_plugins" '"tmux-example-plugin" clean success' || 44 | fail_helper "[script] plugin cleaning fails" 45 | 46 | teardown_helper 47 | } 48 | 49 | test_unsuccessful_plugin_uninstallation_via_script() { 50 | set_tmux_conf_helper <<- HERE 51 | set -g mode-keys vi 52 | run-shell "$TPM_DIR/tpm" 53 | HERE 54 | 55 | manually_install_the_plugin 56 | chmod 000 "$PLUGINS_DIR/tmux-example-plugin" # disable directory deletion 57 | 58 | local expected_exit_code=1 59 | script_run_helper "$TPM_DIR/bin/clean_plugins" '"tmux-example-plugin" clean fail' "$expected_exit_code" || 60 | fail_helper "[script] unsuccessful plugin cleaning doesn't fail" 61 | 62 | chmod 755 "$PLUGINS_DIR/tmux-example-plugin" # enable directory deletion 63 | 64 | teardown_helper 65 | } 66 | 67 | run_tests 68 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/test_plugin_sourcing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | TPM_DIR="$PWD" 5 | PLUGINS_DIR="$HOME/.tmux/plugins" 6 | 7 | CUSTOM_PLUGINS_DIR="$HOME/foo/plugins" 8 | 9 | source "$CURRENT_DIR/helpers/helpers.sh" 10 | source "$CURRENT_DIR/helpers/tpm.sh" 11 | 12 | check_binding_defined() { 13 | local binding="$1" 14 | tmux list-keys | grep -q "$binding" 15 | } 16 | 17 | create_test_plugin_helper() { 18 | local plugin_path="$PLUGINS_DIR/tmux_test_plugin/" 19 | rm -rf "$plugin_path" 20 | mkdir -p "$plugin_path" 21 | 22 | while read line; do 23 | echo "$line" >> "$plugin_path/test_plugin.tmux" 24 | done 25 | chmod +x "$plugin_path/test_plugin.tmux" 26 | } 27 | 28 | check_tpm_path() { 29 | local correct_tpm_path="$1" 30 | local tpm_path="$(tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)" 31 | [ "$correct_tpm_path" == "$tpm_path" ] 32 | } 33 | 34 | test_plugin_sourcing() { 35 | set_tmux_conf_helper <<- HERE 36 | set -g mode-keys vi 37 | set -g @plugin "doesnt_matter/tmux_test_plugin" 38 | run-shell "$TPM_DIR/tpm" 39 | HERE 40 | 41 | # manually creates a local tmux plugin 42 | create_test_plugin_helper <<- HERE 43 | tmux bind-key R run-shell foo_command 44 | HERE 45 | 46 | tmux new-session -d # tmux starts detached 47 | check_binding_defined "R run-shell foo_command" || 48 | fail_helper "Plugin sourcing fails" 49 | 50 | teardown_helper 51 | } 52 | 53 | test_default_tpm_path() { 54 | set_tmux_conf_helper <<- HERE 55 | set -g mode-keys vi 56 | run-shell "$TPM_DIR/tpm" 57 | HERE 58 | 59 | check_tpm_path "${PLUGINS_DIR}/" || 60 | fail_helper "Default TPM path not correct" 61 | 62 | teardown_helper 63 | } 64 | 65 | test_custom_tpm_path() { 66 | set_tmux_conf_helper <<- HERE 67 | set -g mode-keys vi 68 | set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR' 69 | run-shell "$TPM_DIR/tpm" 70 | HERE 71 | 72 | check_tpm_path "$CUSTOM_PLUGINS_DIR" || 73 | fail_helper "Custom TPM path not correct" 74 | 75 | teardown_helper 76 | } 77 | 78 | run_tests 79 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tests/test_plugin_update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | TPM_DIR="$PWD" 5 | PLUGINS_DIR="$HOME/.tmux/plugins" 6 | 7 | source "$CURRENT_DIR/helpers/helpers.sh" 8 | source "$CURRENT_DIR/helpers/tpm.sh" 9 | 10 | manually_install_the_plugin() { 11 | mkdir -p "$PLUGINS_DIR" 12 | cd "$PLUGINS_DIR" 13 | git clone --quiet https://github.com/tmux-plugins/tmux-example-plugin 14 | } 15 | 16 | # TMUX KEY-BINDING TESTS 17 | 18 | test_plugin_update_via_tmux_key_binding() { 19 | set_tmux_conf_helper <<- HERE 20 | set -g mode-keys vi 21 | set -g @plugin "tmux-plugins/tmux-example-plugin" 22 | run-shell "$TPM_DIR/tpm" 23 | HERE 24 | 25 | manually_install_the_plugin 26 | 27 | "$CURRENT_DIR/expect_successful_update_of_all_plugins" || 28 | fail_helper "[key-binding] 'update all plugins' fails" 29 | 30 | "$CURRENT_DIR/expect_successful_update_of_a_single_plugin" || 31 | fail_helper "[key-binding] 'update single plugin' fails" 32 | 33 | teardown_helper 34 | } 35 | 36 | # SCRIPT TESTS 37 | 38 | test_plugin_update_via_script() { 39 | set_tmux_conf_helper <<- HERE 40 | set -g mode-keys vi 41 | set -g @plugin "tmux-plugins/tmux-example-plugin" 42 | run-shell "$TPM_DIR/tpm" 43 | HERE 44 | 45 | manually_install_the_plugin 46 | 47 | local expected_exit_code=1 48 | script_run_helper "$TPM_DIR/bin/update_plugins" 'usage' "$expected_exit_code" || 49 | fail_helper "[script] running update plugins without args should fail" 50 | 51 | script_run_helper "$TPM_DIR/bin/update_plugins tmux-example-plugin" '"tmux-example-plugin" update success' || 52 | fail_helper "[script] plugin update fails" 53 | 54 | script_run_helper "$TPM_DIR/bin/update_plugins all" '"tmux-example-plugin" update success' || 55 | fail_helper "[script] update all plugins fails" 56 | 57 | teardown_helper 58 | } 59 | 60 | run_tests 61 | -------------------------------------------------------------------------------- /.tmux/plugins/tpm/tpm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | BINDINGS_DIR="$CURRENT_DIR/bindings" 5 | SCRIPTS_DIR="$CURRENT_DIR/scripts" 6 | 7 | source "$SCRIPTS_DIR/variables.sh" 8 | 9 | get_tmux_option() { 10 | local option="$1" 11 | local default_value="$2" 12 | local option_value="$(tmux show-option -gqv "$option")" 13 | if [ -z "$option_value" ]; then 14 | echo "$default_value" 15 | else 16 | echo "$option_value" 17 | fi 18 | } 19 | 20 | tpm_path_set() { 21 | tmux show-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" >/dev/null 2>&1 22 | } 23 | 24 | set_default_tpm_path() { 25 | tmux set-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" "$DEFAULT_TPM_PATH" 26 | } 27 | 28 | # Ensures TMUX_PLUGIN_MANAGER_PATH global env variable is set. 29 | # 30 | # Put this in `.tmux.conf` to override the default: 31 | # `set-environment -g TMUX_PLUGIN_MANAGER_PATH "/some/other/path/"` 32 | set_tpm_path() { 33 | if ! tpm_path_set; then 34 | set_default_tpm_path 35 | fi 36 | } 37 | 38 | # 1. Fetches plugin names from `@plugin` variables 39 | # 2. Creates full plugin path 40 | # 3. Sources all *.tmux files from each of the plugin directories 41 | # - no errors raised if directory does not exist 42 | # Files are sourced as tmux config files, not as shell scripts! 43 | source_plugins() { 44 | "$SCRIPTS_DIR/source_plugins.sh" >/dev/null 2>&1 45 | } 46 | 47 | # prefix + I - downloads TPM plugins and reloads TMUX environment 48 | # prefix + U - updates a plugin (or all of them) and reloads TMUX environment 49 | # prefix + alt + u - remove unused TPM plugins and reloads TMUX environment 50 | set_tpm_key_bindings() { 51 | local install_key="$(get_tmux_option "$install_key_option" "$default_install_key")" 52 | tmux bind-key "$install_key" run-shell "$BINDINGS_DIR/install_plugins" 53 | 54 | local update_key="$(get_tmux_option "$update_key_option" "$default_update_key")" 55 | tmux bind-key "$update_key" run-shell "$BINDINGS_DIR/update_plugins" 56 | 57 | local clean_key="$(get_tmux_option "$clean_key_option" "$default_clean_key")" 58 | tmux bind-key "$clean_key" run-shell "$BINDINGS_DIR/clean_plugins" 59 | } 60 | 61 | supported_tmux_version_ok() { 62 | "$SCRIPTS_DIR/check_tmux_version.sh" "$SUPPORTED_TMUX_VERSION" 63 | } 64 | 65 | main() { 66 | if supported_tmux_version_ok; then 67 | set_tpm_path 68 | set_tpm_key_bindings 69 | source_plugins 70 | fi 71 | } 72 | main 73 | -------------------------------------------------------------------------------- /.tmux/renew_env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | pane_fmt="#{pane_id} #{pane_in_mode} #{pane_input_off} #{pane_dead} #{pane_current_command}" 6 | tmux list-panes -s -F "$pane_fmt" | awk ' 7 | $2 == 0 && $3 == 0 && $4 == 0 && $5 ~ /(bash|zsh|ksh|fish)/ { print $1 } 8 | ' | while read -r pane_id; do 9 | # renew environment variables according to update-environment tmux option 10 | # also clear screen 11 | tmux send-keys -t "$pane_id" 'Enter' 'eval "$(tmux show-env -s)"' 'Enter' 'C-l' 12 | done; -------------------------------------------------------------------------------- /.tmux/tmux.remote.conf: -------------------------------------------------------------------------------- 1 | # show status bar at bottom for remote session, 2 | # so it do not stack together with local session's one 3 | set -g status-position bottom 4 | 5 | # Set port of SSH remote tunnel, where tmux will pipe buffers to transfer on local machine for copy 6 | set -g @copy_backend_remote_tunnel_port 11988 7 | 8 | # In remote mode we don't show "clock" and "battery status" widgets 9 | set -g status-left "$wg_session" 10 | set -g status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host | #{online_status}" 11 | -------------------------------------------------------------------------------- /Library/Application Support/code/user/keybindings.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Library/Application Support/Übersicht/widgets/list: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My-MacOS 2 | 3 | Todo 4 | 5 | Upload Files: 6 | * Brew / App List / Fonts 7 | * Gem 8 | * Pip 9 | * npm 10 | * `default writes` commands 11 | * Backup script 12 | 13 | Write Wiki: 14 | * Hammerspoon 15 | * Karabiner 16 | * Safari 17 | * Emacs Config 18 | * Vim Config 19 | * Tmux 20 | * p10k 21 | * VSC Config + Extensions 22 | * Übersicht Widgets 23 | * Swiftbar 24 | * .Scripts 25 | * Launchd 26 | * Alfred 27 | * Better Touch Tool 28 | * Keyboard Maestro 29 | * iTerm2 + color schemes 30 | * Firefox Extensions + Themes 31 | * MacForge 32 | -------------------------------------------------------------------------------- /Wallpapers/Big-Nord-BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/Wallpapers/Big-Nord-BG.png -------------------------------------------------------------------------------- /Wallpapers/Big-Nord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/Wallpapers/Big-Nord.png -------------------------------------------------------------------------------- /images/Screen Shot 2021-04-14 at T02.57.29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/images/Screen Shot 2021-04-14 at T02.57.29.png -------------------------------------------------------------------------------- /images/Screen Shot 2021-04-14 at T03.33.21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/images/Screen Shot 2021-04-14 at T03.33.21.png -------------------------------------------------------------------------------- /images/Screen Shot 2021-04-14 at T04.33.05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SxC97/dotfiles/5db5e13f894f7677227587933b1201e7633009ef/images/Screen Shot 2021-04-14 at T04.33.05.png --------------------------------------------------------------------------------