summaryrefslogtreecommitdiffstats
path: root/local/bin/input_control.sh
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2024-09-11 04:25:38 +0900
committerMitsuo Tokumori <[email protected]>2024-09-11 04:25:38 +0900
commit37ff7062874b72bafa99afe661f42653565ed511 (patch)
tree60372bf7fdb94c9034c7d1cc5a17cd7df526c4fc /local/bin/input_control.sh
parentdca319b8d9d221f1aaf3a00ee457d202096c66ac (diff)
downloaddotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.gz
dotfiles-37ff7062874b72bafa99afe661f42653565ed511.tar.bz2
dotfiles-37ff7062874b72bafa99afe661f42653565ed511.zip
RESTRUCTURE. Replicate relative paths in public/
Diffstat (limited to 'local/bin/input_control.sh')
-rwxr-xr-xlocal/bin/input_control.sh62
1 files changed, 0 insertions, 62 deletions
diff --git a/local/bin/input_control.sh b/local/bin/input_control.sh
deleted file mode 100755
index f63de3b..0000000
--- a/local/bin/input_control.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-
-# Use either X keyboard extension layouts (setxkbmap), or fcitx (or both).
-#
-# At first I configured this to use setxkbmap, it works fine.
-#
-# fcitx already provides keybindings, but I wanted to display
-# the current input method in dwmblocks immediatly. So I'm
-# adding such support through fcitx5-remote.
-
-signal=20
-
-# signal dwmblocks to update block
-send_signal() {
- pkill -RTMIN+$signal dwmblocks
-}
-
-# Cycle X keyboard extension layouts
-cycle_layouts() {
- layouts=(us latam) # X keyboard extension
- STATE_FILE="$XDG_STATE_HOME/keyboard_layout_state"
-
- if [ -f "$STATE_FILE" ]; then
- index=$(cat "$STATE_FILE")
- else
- index=0
- fi
- next_index=$(( (index + 1) % ${#layouts[@]} ))
- echo $next_index > "$STATE_FILE"
-
- setxkbmap ${layouts[$index]}
-}
-
-fcitx_control() {
- # For this to correctly reflect the state of the system "Share Input State"
- # should be set to "All" in fcitx5-configtool.
-
- case $1 in
- en)
- fcitx5-remote -c # Closed
- fcitx5-remote -g Default
- ;;
- es)
- fcitx5-remote -c # Closed
- fcitx5-remote -g Spanish
- ;;
- ja)
- fcitx5-remote -g Default
- fcitx5-remote -o # Open
- ;;
- *)
- fcitx5-remote -q #
- fcitx5-remote -n
- fcitx5-remote
- ;;
- esac
-}
-
-#cycle_layouts
-fcitx_control $1
-
-send_signal