mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
sync: from macOS 2024-12-05
This commit is contained in:
parent
7d220c3873
commit
053304c4d5
39 changed files with 1025 additions and 379 deletions
11
platforms/mac/DefaultKeyBinding.dict
Normal file
11
platforms/mac/DefaultKeyBinding.dict
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// ~/Library/Keybindings/DefaultKeyBinding.dict
|
||||
{
|
||||
// Colemak Vim Style Arrows
|
||||
"^h" = "moveBackward:";
|
||||
"^n" = "moveDown:";
|
||||
"^e" = "moveUp:";
|
||||
"^i" = "moveForward:";
|
||||
// Colemak Vim Style Home/End, Insert & Append
|
||||
"^l" = "moveToBeginningOfLine:";
|
||||
"^a" = "moveToEndOfLine:";
|
||||
}
|
||||
28
platforms/mac/sketchybar/plugins/battery.sh
Executable file
28
platforms/mac/sketchybar/plugins/battery.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"
|
||||
CHARGING="$(pmset -g batt | grep 'AC Power')"
|
||||
|
||||
if [ "$PERCENTAGE" = "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "${PERCENTAGE}" in
|
||||
9[0-9]|100) ICON=""
|
||||
;;
|
||||
[6-8][0-9]) ICON=""
|
||||
;;
|
||||
[3-5][0-9]) ICON=""
|
||||
;;
|
||||
[1-2][0-9]) ICON=""
|
||||
;;
|
||||
*) ICON=""
|
||||
esac
|
||||
|
||||
if [[ "$CHARGING" != "" ]]; then
|
||||
ICON=""
|
||||
fi
|
||||
|
||||
# The item invoking this script (name $NAME) will get its icon and label
|
||||
# updated with the current battery status
|
||||
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}%"
|
||||
8
platforms/mac/sketchybar/plugins/clock.sh
Executable file
8
platforms/mac/sketchybar/plugins/clock.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# The $NAME variable is passed from sketchybar and holds the name of
|
||||
# the item invoking this script:
|
||||
# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
|
||||
|
||||
sketchybar --set "$NAME" label="$(date '+%d日周%u %H:%M')"
|
||||
|
||||
10
platforms/mac/sketchybar/plugins/front_app.sh
Executable file
10
platforms/mac/sketchybar/plugins/front_app.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Some events send additional information specific to the event in the $INFO
|
||||
# variable. E.g. the front_app_switched event sends the name of the newly
|
||||
# focused application in the $INFO variable:
|
||||
# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
|
||||
|
||||
if [ "$SENDER" = "front_app_switched" ]; then
|
||||
sketchybar --set "$NAME" label="$INFO"
|
||||
fi
|
||||
8
platforms/mac/sketchybar/plugins/music.sh
Executable file
8
platforms/mac/sketchybar/plugins/music.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
music_info=$(curlie GET http://localhost:10767/api/v1/playback/now-playing | jq -r '"\(.info.name) - \(.info.artistName)"')
|
||||
|
||||
|
||||
ICON=""
|
||||
|
||||
sketchybar --set $NAME label="$music_info" icon="$ICON"
|
||||
7
platforms/mac/sketchybar/plugins/space.sh
Executable file
7
platforms/mac/sketchybar/plugins/space.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# The $SELECTED variable is available for space components and indicates if
|
||||
# the space invoking this script (with name: $NAME) is currently selected:
|
||||
# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item
|
||||
|
||||
sketchybar --set "$NAME" background.drawing="$SELECTED"
|
||||
20
platforms/mac/sketchybar/plugins/volume.sh
Executable file
20
platforms/mac/sketchybar/plugins/volume.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# The volume_change event supplies a $INFO variable in which the current volume
|
||||
# percentage is passed to the script.
|
||||
|
||||
if [ "$SENDER" = "volume_change" ]; then
|
||||
VOLUME="$INFO"
|
||||
|
||||
case "$VOLUME" in
|
||||
[6-9][0-9]|100) ICON=""
|
||||
;;
|
||||
[3-5][0-9]) ICON=""
|
||||
;;
|
||||
[1-9]|[1-2][0-9]) ICON=""
|
||||
;;
|
||||
*) ICON=""
|
||||
esac
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" label="$VOLUME%"
|
||||
fi
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# $DOTFILES/platforms/mac/sketchybarrc
|
||||
# Date: 2024-11-30
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# TODO: Reorganize this file
|
||||
# This is a demo config to showcase some of the most important commands.
|
||||
# It is meant to be changed and configured, as it is intentionally kept sparse.
|
||||
|
|
@ -41,7 +41,7 @@ sketchybar --default "${default[@]}"
|
|||
# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item
|
||||
# to indicate active and available mission control spaces.
|
||||
|
||||
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
|
||||
SPACE_ICONS=("" "" "" "" "" "" "7" "8" "9" "10")
|
||||
for i in "${!SPACE_ICONS[@]}"
|
||||
do
|
||||
sid="$(($i+1))"
|
||||
|
|
@ -89,7 +89,7 @@ sketchybar --add item clock center \
|
|||
--add item battery right \
|
||||
--set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \
|
||||
--subscribe battery system_woke power_source_change \
|
||||
--add item apple_music right
|
||||
--add item apple_music right
|
||||
|
||||
sketchybar --add item music right
|
||||
sketchybar --set music \
|
||||
|
|
@ -1,36 +1,19 @@
|
|||
# $DOTFILES/platforms/mac/skhdrc
|
||||
# Date: 2024-11-30
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
|
||||
# Location: $XDG_CONFIG_HOME/skhd/skhdrc
|
||||
# Linking:
|
||||
# ln -sf $DOTFILES/platforms/mac/skhdrc $XDG_CONFIG_HOME/skhd/skhdrc
|
||||
|
||||
# Navigation
|
||||
cmd - h : yabai -m window --focus west
|
||||
cmd - n : yabai -m window --focus south
|
||||
cmd - e : yabai -m window --focus north
|
||||
cmd - i : yabai -m window --focus east
|
||||
alt - h : yabai -m window --focus west
|
||||
alt - n : yabai -m window --focus south
|
||||
alt - e : yabai -m window --focus north
|
||||
alt - i : yabai -m window --focus east
|
||||
|
||||
# Moving windows
|
||||
shift + cmd - h : yabai -m window --warp west
|
||||
shift + cmd - n : yabai -m window --warp south
|
||||
shift + cmd - e : yabai -m window --warp north
|
||||
shift + cmd - i : yabai -m window --warp east
|
||||
|
||||
shift + alt - h : \
|
||||
yabai -m window --resize left:-20:0 ; \
|
||||
yabai -m window --resize right:-20:0
|
||||
|
||||
shift + alt - n : \
|
||||
yabai -m window --resize bottom:0:20 ; \
|
||||
yabai -m window --resize top:0:20
|
||||
|
||||
shift + alt - e : \
|
||||
yabai -m window --resize top:0:-20 ; \
|
||||
yabai -m window --resize bottom:0:-20
|
||||
|
||||
shift + alt - i : \
|
||||
yabai -m window --resize right:20:0 ; \
|
||||
yabai -m window --resize left:20:0
|
||||
|
||||
shift + alt - h : yabai -m window --warp west
|
||||
shift + alt - n : yabai -m window --warp south
|
||||
shift + alt - e : yabai -m window --warp north
|
||||
shift + alt - i : yabai -m window --warp east
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
# $DOTFILES/platforms/mac/yabairc
|
||||
# Date: 2024-11-30
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# TODO: Reorganize this file
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# $DOTFILES/platforms/mac/zshrc
|
||||
# Date: 2024-11-30
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# Sourced by user's zshrc if is macOS 在用户的 zshrc 中被引用,macOS 特定配置
|
||||
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
|
||||
|
||||
|
|
@ -25,3 +25,4 @@ fi
|
|||
unset __conda_setup
|
||||
# <<< conda initialize <<<
|
||||
|
||||
alias start-twm="source $DOTFILES/scripts/__twm_osx_start.zsh"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# $DOTFILES/platforms\win\Microsoft.PowerShell_profile.ps1
|
||||
# Date: 2024-12-01
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# PowerShell profile for Windows
|
||||
|
||||
### Load Configs ###
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# $DOTFILES\platforms\win\wslconfig
|
||||
# Date: 2024-12-01
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# Config Files (mainly for networking) for WSL2 (Windows Subsystem for Linux 2)
|
||||
# 适用于 Windows 的 Linux 子系统 2 的配置文件(主要用于网络)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# $DOTFILES/platforms/wsl/zshrc
|
||||
# Date: 2024-12-01
|
||||
# Author: contact@js0ny.net
|
||||
# Author: js0ny
|
||||
# Sourced by user's zshrc if is WSL 在用户的 zshrc 中被引用,WSL 特定配置
|
||||
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue