konsolescripts

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

1
Score 50.0%
Description:

KonsoleScripts is script, which automatically renames konsole tabs to what command you are running.

There are some general commands predefined and an easy way to define your own. More documentation in script.

Installation:
just save file to ~/.konsolescripts and add this line in ~/.bashrc:
. ~/.konsolescripts
(dot, SPACE, tilde, slash and so on..)
Last changelog:

12 years ago

full changelog in file.
* 1.0.9
- Initial kde4-support (for yakuake)
* 1.0
- Added some commands
- trapped ctrl+c to prevent wrong label if command is cancelled.

* 0.84.0
- Fixed typo and added quotes, which caused problem when using several su-commands on the top of the other.
- Optimized KONSOLESCRIPTS_addCommand. No need for temporary file anymore and shell starts faster.

* 0.83.4
- New commands: yum, locate, updatedb and chroot.
- Bugfix: Removing temp-files with "rm -f" to prevent aliases like rm="rm -i" asking questions. Thanks to Vladimir Pouzanov, who noticed this bug.

* 0.83.3
- Some temporary files wasn't removed.($TMPDIR/konsolescripts.*)
- some bugfixes to linux32 and linux64 commands.

* 0.83.1
- Added new commands: linux32 and linux64
- Fixed labeling problem in ssh and ftp when using root. thanks to Nissa.

* 0.83.0
- added support for _upcoming_ yakuake.
(patch for yakuake-2.7.5 is also on downloads, but I won't provide any support for installing it. It will be included in upcoming yakuake versions).
- Fixed some problems with functions with "-", like apt-get.

jscm

12 years ago

hello!..

have you news for us to new release of konsolescripts for Konsole and Yakuare?

I have a question...
... how to install patch for yakuake into openSUSE 10.2 with rpm of yakuake. I don't found files to patch that you have provided.

best regars

jscm

Report

C

fsu

12 years ago

Hi!

If you have x86_64, you can use this rpm: http://ota.tr.spt.fi/~fisu81/suse/10.2/x86_64/yakuake-2.7.5-50.fsu.x86_64.rpm

There is also src.rpm. I haven't build i586, so you have to do it yourself:
1. Get this src.rpm -file
http://ota.tr.spt.fi/~fisu81/suse/10.2/src/yakuake-2.7.5-50.fsu.src.rpm
2. build it:
rpmbuild --rebuild yakuake-2.7.5-50.fsu.src.rpm

Report

LocoMojo

12 years ago

...and very useful!

However I'm getting an error every time I use vim or locate:

"bash: [: !=: unary operator expected"

The error isn't a showstopper as both vim and locate proceed to work correctly, but it is annoying to see the error being spit out all the time.

I'm using the patched Yakuake on Slackware current.

LocoMojo

Report

LocoMojo

12 years ago

Oops, I forgot to mention that I don't get this error in Konsole...only Yakuake.

LocoMojo

Report

C

fsu

12 years ago

Thanks reporting. I couldn't reproduce this. Would you send me some more data, so I can try to fix it:
- Take new konsole tab
- Run: bash -x
- Run: vim test.txt
- Quit vim
- Copy scrollback from the line "vim test.txt" to the end. (Make sure, error is there too)
- paste it to http://pastebin.ca (or something similar) and send link to me(here or send it by email).

Report

LocoMojo

12 years ago

I did exactly what you said, but the errors don't reproduce after I do bash -x.

Once I get out of bash -x the errors come back.

By the way, in addition to the abovementioned commands, I also get this error when I do 'top' and 'man'.

Let me know if you still want the output of bash -x even though the errors aren't spitting out.

Also remember that this is a Yakuake only problem...this is NOT a problem for Konsole.

LocoMojo

Report

LocoMojo

12 years ago

Update:

I figured out the problem. The errors were due to a misconfigured prompt in my .bashrc file, specifically the part of my prompt that put my path in Yakuake's titlebar.

My bad, sorry.

Interestingly, I've been using this prompt for well over a year now and I've never had any problems with it until I started using konsolescripts.

Thanks again for a very useful script!

LocoMojo

Report

jscm

12 years ago

I get only my userName in may Konsole tabs. I don't know why.

my standard prompt is:

08:20 jscm:~ >

if I run commands like wget, ftp, top, vi.. I don't get my Konsole tab renamed but I see always my username (jscm) in tab.

What can I do??

I use SuSE 10.1 with Konsole 1.6.4

Report

C

fsu

12 years ago

That's weird. Would you send me some information by email:
rpm -q vim
type -a vi

And then tricy one: First write KONSOLESCRIPTS_ and then press couple times tab, so bash tries to complete and gives list on functions beginning with KONSOLESCRIPTS_.

Output should be something like this:
http://pastebin.ca/152975

Report

jscm

12 years ago

I tried what you suggest me.

17:43 jscm:/ > rpm -q vim
vim-6.4.6-19
17:43 jscm:/ > type -a vi
vi is /bin/vi
vi is /usr/bin/vi
17:43 jscm:/ > KO ......[NOTHING]


I see that I don't find any KONSOLESCRIPTS_?????

my vim isn't the newer but I don't think that it could be a problem.


I haven't all information that I've saw in your link.

Why???

What do I have to do??

Report

C

fsu

12 years ago

I'm not sure, this is best place to give support but are you sure, you have line:
". ~/.konsolescripts"
(dot, space, pathToFile and without quotation marks) in ~/.bashrc and script saved in ~/.konsolescripts ?

Report

jscm

12 years ago

Ok... I understand!!!

I haven't use "dot and space" to pin up set script.

I had used ./path/script

so it was started only when konsole started.. after my konsole didn't use functions.

Now I see
18:19 jscm:~ > KONSOLESCRIPTS_
KONSOLESCRIPTS_addCommand KONSOLESCRIPTS_SUBLABEL_make
KONSOLESCRIPTS_getCommand KONSOLESCRIPTS_SUBLABEL_man
KONSOLESCRIPTS_KONSOLE_renameSession KONSOLESCRIPTS_SUBLABEL_nano
KONSOLESCRIPTS_KONSOLE_sessionName KONSOLESCRIPTS_SUBLABEL_pico
KONSOLESCRIPTS_renameSession KONSOLESCRIPTS_SUBLABEL_sftp
KONSOLESCRIPTS_restoreSession KONSOLESCRIPTS_SUBLABEL_smart
KONSOLESCRIPTS_runCommand KONSOLESCRIPTS_SUBLABEL_ssh
KONSOLESCRIPTS_SUBLABEL_apt KONSOLESCRIPTS_SUBLABEL_sudo
KONSOLESCRIPTS_SUBLABEL_apt_get KONSOLESCRIPTS_SUBLABEL_svn
KONSOLESCRIPTS_SUBLABEL_cvs KONSOLESCRIPTS_SUBLABEL_vi
KONSOLESCRIPTS_SUBLABEL_ftp KONSOLESCRIPTS_SUBLABEL_vim
KONSOLESCRIPTS_SUBLABEL_linux32 KONSOLESCRIPTS_SUBLABEL_yum
KONSOLESCRIPTS_SUBLABEL_linux32Andlinux64 KONSOLESCRIPTS_which
KONSOLESCRIPTS_SUBLABEL_linux64


Sorry.. I didn't see space between . and path because my font size is really small, i use 1680x1050 and firefoz have tiny text that i haven't changed.

thanks for you help.

Report

Nissa

12 years ago

Very useful.

Some kind of problem on my machine:

> ssh root@192.168.0.1

Tab displays:
nissa@192.168.0.1 instead of root@192.168.0.1

To make it work on my machine I have replaced the following lines:

L376:
userName=`echo "$parameters" | sed s/@.*$// | sed s/^[^\ ]*\ //g`

L385:
local computer="$(echo "$parameters" | sed 's/^.*@//')"

Report

C

fsu

12 years ago

Thanks. I fixed it in 0.83.1.

Report

nightwriter

12 years ago

http://www.kde-look.org/content/show.php?content=30372

Report

pfka

12 years ago

thanks a lot!

Report

pfka

12 years ago

Great idea! But how about Yakuake? When I'm running dcop --list-sessions --username user under Yakuake, is's returning 0. Is there a way to improve Yakuake this way?

Report

keegancsmith

12 years ago

Are you sure you haven't sshed into another box?
This has happened to me before without me realising it. ;)
Otherwise dcop works perfectly for me.

Report

12 years ago

full changelog in file.
* 1.0.9
- Initial kde4-support (for yakuake)
* 1.0
- Added some commands
- trapped ctrl+c to prevent wrong label if command is cancelled.

* 0.84.0
- Fixed typo and added quotes, which caused problem when using several su-commands on the top of the other.
- Optimized KONSOLESCRIPTS_addCommand. No need for temporary file anymore and shell starts faster.

* 0.83.4
- New commands: yum, locate, updatedb and chroot.
- Bugfix: Removing temp-files with "rm -f" to prevent aliases like rm="rm -i" asking questions. Thanks to Vladimir Pouzanov, who noticed this bug.

* 0.83.3
- Some temporary files wasn't removed.($TMPDIR/konsolescripts.*)
- some bugfixes to linux32 and linux64 commands.

* 0.83.1
- Added new commands: linux32 and linux64
- Fixed labeling problem in ssh and ftp when using root. thanks to Nissa.

* 0.83.0
- added support for _upcoming_ yakuake.
(patch for yakuake-2.7.5 is also on downloads, but I won't provide any support for installing it. It will be included in upcoming yakuake versions).
- Fixed some problems with functions with "-", like apt-get.

12345678910
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.0.9
updated Oct 29 2006
added Aug 07 2006
downloads today
0
page views today 1