-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ibus restart if it's running
This commit adds the functionality to restart ibus if it's already running. It checks if the ibus-daemon process is running using the `pgrep` command, and if it is, it restarts ibus using the `ibus restart` command. This improves the user experience by ensuring that ibus is always in a consistent state.
- Loading branch information
1 parent
de5add6
commit 66ec043
Showing
5 changed files
with
23 additions
and
13 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
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,12 +1,12 @@ | ||
# Shell-GPT integration for ZSH | ||
_sgpt_zsh() { | ||
if [[ -n "$BUFFER" ]]; then | ||
_sgpt_prev_cmd=$BUFFER | ||
BUFFER+=" " | ||
zle -I && zle redisplay | ||
BUFFER=$(sgpt --shell <<< "$_sgpt_prev_cmd" --no-interaction) | ||
zle end-of-line | ||
fi | ||
if [[ -n "$BUFFER" ]]; then | ||
_sgpt_prev_cmd=$BUFFER | ||
BUFFER+=" " | ||
zle -I && zle redisplay | ||
BUFFER=$(sgpt --shell <<< "$_sgpt_prev_cmd" --no-interaction) | ||
zle end-of-line | ||
fi | ||
} | ||
zle -N _sgpt_zsh | ||
bindkey "^p" _sgpt_zsh |
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