
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
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!
14 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.
14 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
12 years ago
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
12 years ago
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
13 years ago
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