Konsole DCOP Scheme Automation Tool

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
Description:

This is a Bash script to automatically set the desired Konsole Schema when apps such as VIM and less are executed.

It is a simple Bash script I wrote which allows you to automatically have the desired schema set when apps are run from within the shell.

For example, by default, when the user runs VIM with this script installed, the Konsole schema will switch to "VIM Colors" for the duration the user is in VIM. When the user exits VIM, the schema will change back to whatever it was before VIM was run. Other apps this script is setup for by default are:

less
man
info
watch
top
htop

I decided to create this because I became tired of switching my Konsole schema whenever I ran vim. I am now releasing it to everyone as I'm sure someone else out there will find this usefull too.

This is a also nice way to impress your friends with how much more advanced the Linux shell is than those of the competitors! ;)

Users may also wish to enable this for other applications, such as mutt. To do so, simply edit the file ~/.konsole_dcop/schemas and follow the existing syntax.

If you like this script, please leave a comment to let me know!
Last changelog:

12 years ago

This is the initial release. It is expected to be fairly stable and fully usable. If you have any bugs to report, please do so in the Issues category of the project homepage. Thank you.

mscroggi

11 years ago

I love this package.. I ran into a couple of things I didnt like and tweaked on my copy a bit. The biggest change I made was to change the way the app and schema values were parsed from the schemas file. My change allows the command to be multiple words with spaces etc.. Here is my tweak -

set -- `grep -w --color=never ${appName} ~/.konsole_dcop/schemas`
appLabel=$1
shift
appSchema=$1
shift
appCmd=$@

Also, I figured out how to get the current session name, and set it back after the command executes, just like you did with the schema name -

(in getKonsoleInfo() )
origsessionName=`dcop $konsole $session sessionName`

(towards the bottom of the script where the commands are fired)

dcop $konsole $session renameSession "${appLabel}"
dcop $konsole $session setSchema ${appSchema}

${appCmd} ${*}

dcop $konsole $session renameSession "${origsessionName}"
dcop $konsole $session setSchema "${origSchema}"

Report

mscroggi

11 years ago

I love this package.. I ran into a couple of things I didnt like and tweaked on my copy a bit. The biggest change I made was to change the way the app and schema values were parsed from the schemas file. My change allows the command to be multiple words with spaces etc.. Here is my tweak -

set -- `grep -w --color=never ${appName} ~/.konsole_dcop/schemas`
appLabel=$1
shift
appSchema=$1
shift
appCmd=$@

Also, I figured out how to get the current session name, and set it back after the command executes, just like you did with the schema name -

(in getKonsoleInfo() )
origsessionName=`dcop $konsole $session sessionName`

(towards the bottom of the script where the commands are fired)

dcop $konsole $session renameSession "${appLabel}"
dcop $konsole $session setSchema ${appSchema}

${appCmd} ${*}

dcop $konsole $session renameSession "${origsessionName}"
dcop $konsole $session setSchema "${origSchema}"

Report

hronir

12 years ago

It's been a long time since I start looking for something similar!
Actually my point was to change schema depending on the remote machine I'm logged in, so your great solution is not usable "as is". I can use the machine name after the ssh command to trigger the load of proper schema, but then I can't use any more dcop, once I land on the remote machine (and, for example, ssh to another different machine again...).

Report

12 years ago

This is the initial release. It is expected to be fairly stable and fully usable. If you have any bugs to report, please do so in the Issues category of the project homepage. Thank you.

12345678910
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.9.0
updated Feb 23 2007
added Feb 23 2007
downloads 24h
0
mediaviews 24h 0
pageviews 24h 0