Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:52:40+00:00 2026-05-13T11:52:40+00:00

I currently use a color scheme based on which directory that I’m working in.

  • 0

I currently use a color scheme based on which directory that I’m working in. I manually open up a Konsole shell and then cd into a directory and got to Settings and change the color scheme.

What I would like to do is have Konsole automatically set its foreground and background colors based on which directory I’m in. Basically if I’m in any subdirectory below /home/me/src/java then I would like to use text white, background blue, for example. If I’m below /home/me/src/documentation I want text black, background white, for example. I would like the color change to occur automatically, programmatically, when I call the “cd” command.

Is this possible? If so, can you provide me some direction as to how?

The way I see it I will need to be able to do a couple of things:

  • Be able to detect which Konsole the shell process (bash) is running in.
  • Be able to tell Konsole, probably via API call, to change the color scheme on the fly.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:52:40+00:00Added an answer on May 13, 2026 at 11:52 am

    To get you started, here‘s a little information about using D-Bus to script Konsole.

    You don’t say which shell you’re using, but if it’s Bash you may want to use the $PROMPT_COMMAND variable which holds a command to be executed each time the $PS1 prompt is issued. The Z shell has a similar facility that’s probably a bit more powerful (see man zshmisc for chpwd and precmd).

    Otherwise, you might be able to use xterm escape sequences.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a project that requires the use of a semi-colon
I currently use the free obfuscation tool that ships with VS and it does
I want to use a color picker to pick two colors and then draw
I'm currently working on an color-picker component using HTML, CSS and Javascript, one major
I currently have this working fiddle - http://jsfiddle.net/B8Abd/ I would like to use jquerys
We have a color animation that blends from red to white. Currently, this is
I'm currently composing an HTML-Mail using MFMailComposer. Everything like Background Color etc. is working
I have a site that I have built, with a colour scheme based around
I have an application that allows the user to change color schemes based on
I am trying to make the color scheme of my application dynamic so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.