forked from FelixKratz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add proper svim support to sketchybar
- Loading branch information
1 parent
cab7d3d
commit 80f938d
Showing
8 changed files
with
62 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
svim=( | ||
script="$PLUGIN_DIR/svim.sh" | ||
icon=$INSERT_MODE | ||
icon.font.size=20 | ||
updates=on | ||
drawing=off | ||
) | ||
|
||
sketchybar --add event svim_update \ | ||
--add item svim right \ | ||
--set svim "${svim[@]}" \ | ||
--subscribe svim svim_update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
source "$CONFIG_DIR/icons.sh" | ||
source "$CONFIG_DIR/colors.sh" | ||
|
||
if [ "$SENDER" = "svim_update" ]; then | ||
DRAWING=on | ||
DRAW_CMD=off | ||
COLOR=$WHITE | ||
case "$MODE" in | ||
"I") ICON="$MODE_INSERT" DRAWING=off | ||
;; | ||
"N") ICON="$MODE_NORMAL" | ||
;; | ||
"V") ICON="$MODE_VISUAL" COLOR=$YELLOW | ||
;; | ||
"C") ICON="$MODE_CMD" DRAW_CMD=on COLOR=$RED | ||
;; | ||
"_") ICON="$MODE_PENDING" | ||
;; | ||
*) DRAWING=off | ||
;; | ||
esac | ||
|
||
sketchybar --set $NAME drawing="$DRAWING" \ | ||
label.drawing="$DRAW_CMD" \ | ||
icon="$ICON" \ | ||
icon.color="$COLOR" \ | ||
label="$CMDLINE" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
WezTerm | ||
kitty | ||
Alacritty | ||
iTerm2 | ||
WezTerm | ||
MacVim | ||
Neovide | ||
JupyterApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,8 @@ | ||
#!/usr/bin/env sh | ||
#!/bin/bash | ||
|
||
# This script is executed when either the mode changes, | ||
# or the commandline changes | ||
|
||
# if [ "$MODE" = "" ]; then | ||
# MODE="-" | ||
# fi | ||
# | ||
# DRAW_CMD="off" | ||
# if [ "$CMDLINE" != "" ]; then | ||
# DRAW_CMD="on" | ||
# fi | ||
# | ||
# sketchybar --set system.svim label="[$MODE]" \ | ||
# label.drawing=$(if [ "$MODE" = "" ]; then echo "off"; else echo "on"; fi) \ | ||
# icon.highlight=$(if [ "$MODE" = "-" ]; then echo "off"; else echo "on"; fi) \ | ||
# popup.drawing=$DRAW_CMD \ | ||
# --set svim.cmdline label="$CMDLINE" | ||
# Here I am simply passing the event to sketchybar, where an item handles it. | ||
|
||
sketchybar --trigger svim_update MODE="$MODE" CMDLINE="$CMDLINE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,3 @@ noremap k j | |
noremap l k | ||
noremap ö l | ||
noremap ß $ | ||
nmap <C-k> <Esc>:m .+1<CR> | ||
nmap <C-l> <Esc>:m .-2<CR> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters