Last active
September 12, 2021 02:21
-
-
Save edouard-lopez/9973056 to your computer and use it in GitHub Desktop.
Switch profile/color scheme in Konsole from command line (also works for Yakuake). The wrapper allows to work both in konsole and tmux session
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
# Konsole color changing | |
theme-night() { | |
switch-term-color "colors=TomorrowNightBlue" | |
} | |
theme-light() { | |
switch-term-color "colors=Tomorrow" | |
} | |
switch-term-color() { | |
arg="${1:-colors=Tomorrow}" | |
if [[ -z "$TMUX" ]] | |
then | |
konsoleprofile "$arg" | |
else | |
printf '\033Ptmux;\033\033]50;%s\007\033\\' "$arg" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to
nicm
on#tmux
channel.See related answer on stackOverflow.