diff options
| author | Loris383 <194787933+Loris383v@users.noreply.github.com> | 2026-02-01 17:46:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-01 11:46:17 -0500 |
| commit | 0c663c83dc4436a94c8d47445c51636868d0a895 (patch) | |
| tree | 3ba55b1d5079229ad2c4de8254bb3766300d4b42 /config/hypr/scripts | |
| parent | 218e2b85622e397686fd8a6bd085c006bb6a92f2 (diff) | |
Docs: i18n edits (#940)
* Add SummitSplit v3 configuration for top and bottom bars (#935)
Added the configuration for SummitSplit to include 0-JA-0 Top and updated the bottom bar settings.
* Refactor Tak0-Per-Window-Switch script, fixing issue (#936)
Fixed the issue that made the script to forget the choice of language on windows.
In case of switching from language 1 to language 3, switching a window, then getting back to the previous window - you had to switch from half-saved state to language 1 and then all the way to language 3.
* Add french readme
* Change i18n architecture
* docs: commit message guidelines french translation
* docs: add contributing.md french translation
* docs: add code of conduct french translation
Translation taken from https://www.contributor-covenant.org/fr/version/2/1/code_of_conduct/code_of_conduct.md
* docs: linked french translations in readme.md
Added under the spanish ones, same format
---------
Co-authored-by: Martin Guzman <55927935+brockar@users.noreply.github.com>
Co-authored-by: tak0dan <tmtroshko@gmail.com>
Co-authored-by: Donald Williams <129223418+dwilliam62@users.noreply.github.com>
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/Tak0-Per-Window-Switch.sh | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/config/hypr/scripts/Tak0-Per-Window-Switch.sh b/config/hypr/scripts/Tak0-Per-Window-Switch.sh index d652f0f7..6cd0c564 100755 --- a/config/hypr/scripts/Tak0-Per-Window-Switch.sh +++ b/config/hypr/scripts/Tak0-Per-Window-Switch.sh @@ -1,17 +1,21 @@ ################################################################## +# # +# # # TAK_0'S Per-Window-Switch # # # +# # +# # # Just a little script that I made to switch keyboard layouts # # per-window instead of global switching for the more # -# smooth and comfortable workflow. # +# smooth and comfortable workflow. # +# # ################################################################## -# This is for changing kb_layouts. Set kb_layouts in +# This is for changing kb_layouts. Set kb_layouts in MAP_FILE="$HOME/.cache/kb_layout_per_window" CFG_FILE="$HOME/.config/hypr/configs/SystemSettings.conf" ICON="$HOME/.config/swaync/images/ja.png" SCRIPT_NAME="$(basename "$0")" -LISTENER_PIDFILE="$HOME/.cache/kb_layout_per_window.listener.pid" # Ensure map file exists touch "$MAP_FILE" @@ -37,8 +41,8 @@ get_keyboards() { # Save window-specific layout save_map() { local W=$1 L=$2 - grep -v "^${W}:" "$MAP_FILE" >"$MAP_FILE.tmp" - echo "${W}:${L}" >>"$MAP_FILE.tmp" + grep -v "^${W}:" "$MAP_FILE" > "$MAP_FILE.tmp" + echo "${W}:${L}" >> "$MAP_FILE.tmp" mv "$MAP_FILE.tmp" "$MAP_FILE" } @@ -70,7 +74,7 @@ cmd_toggle() { break fi done - NEXT=$(((i + 1) % count)) + NEXT=$(( (i+1) % count )) do_switch "$NEXT" save_map "$W" "${kb_layouts[NEXT]}" notify-send -u low -i "$ICON" "kb_layout: ${kb_layouts[NEXT]}" @@ -92,10 +96,7 @@ cmd_restore() { # Listen to focus events and restore window-specific layouts subscribe() { local SOCKET2="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" - [[ -S "$SOCKET2" ]] || { - echo "Error: Hyprland socket not found." >&2 - return 1 - } + [[ -S "$SOCKET2" ]] || { echo "Error: Hyprland socket not found." >&2; exit 1; } socat -u UNIX-CONNECT:"$SOCKET2" - | while read -r line; do [[ "$line" =~ ^activewindow ]] && cmd_restore @@ -103,26 +104,12 @@ subscribe() { } # Ensure only one listener -start_listener_once() { - if [[ -f "$LISTENER_PIDFILE" ]]; then - local existing_pid - existing_pid=$(cat "$LISTENER_PIDFILE" 2>/dev/null || true) - if [[ -n "$existing_pid" ]] && kill -0 "$existing_pid" 2>/dev/null; then - return - fi - fi - - subscribe & - echo $! >"$LISTENER_PIDFILE" -} - -start_listener_once +if ! pgrep -f "$SCRIPT_NAME.*--listener" >/dev/null; then + subscribe --listener & +fi # CLI case "$1" in -toggle | "") cmd_toggle ;; -*) - echo "Usage: $SCRIPT_NAME [toggle]" >&2 - exit 1 - ;; + toggle|"") cmd_toggle ;; + *) echo "Usage: $SCRIPT_NAME [toggle]" >&2; exit 1 ;; esac |
