Skip to content

Instantly share code, notes, and snippets.

@edouard-lopez
Last active September 12, 2021 02:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edouard-lopez/9973056 to your computer and use it in GitHub Desktop.
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
# 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
}
@edouard-lopez
Copy link
Author

Thanks to nicm on #tmux channel.

See related answer on stackOverflow.

@ahillio
Copy link

ahillio commented Aug 1, 2020

thank you <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment