Changing konsole profile from command line

  • To change the profile in the current session run:

    qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_SESSION org.kde.konsole.Session.setProfile "Profile 1"
    
  • To switch the profile on all active sessions (windows/tabs/splits) you can do it like this:

    #!/usr/bin/env bash
    PROFILE="Profile 1"
    
    for instance in $(qdbus | grep org.kde.konsole); do
      for session in $(qdbus "$instance" | grep -E '^/Sessions/'); do
        qdbus "$instance" "$session" org.kde.konsole.Session.setProfile "$PROFILE"
      done
    done
    
  • To change the default profile for new instances you can create a script that changes the value of DefaultProfile in the config file $HOME/.config/konsolerc

    [Desktop Entry]
    DefaultProfile=Profile 1.profile
    
  • Bonus: To change the color scheme of the current session (replace Breeze with other konsole color scheme name) run:

    konsoleprofile "colors=Breeze"
    
4 Likes