Stupid kioslaves for the masses.
What is kiobashin?
You are probably a KDE linux user, if you are reading this. And probably you already know that a kioslave is something handles a virtual file system under KDE.
Well. I like KDE very much and I wanted to write something using KDevelop. After one or two minutes I realized that KDE programming is really easy and I decided to write something as stupid as cool. Here you are kiobashin, which is a Kio-slave that allow you to write your personal kioslave... using plain bashscripts.
What is surprising is that it was written in about 4 hours. And I'm not a C++ programmer.
How to get Kiobashin?
Well. Download the sources here:
What kind of license? Nothing. Take it and do what you want.
Untar and do the classical
Create a directory called
How to use Kiobashin?
Open konqueror and go to kiobashin:/. There are all the avaible scripts shown as folders. Simply click on one of these and happy browsing!
Let's try the "kwedshin.sh" script. Click the script's folder.
remix.kwed.org is a very nice MP3 site. It has lotsa of Commodore 64 remixes... and is one of my favourite sites. Well... let's see how I've "kiobashined©" the homepage...
Hey! Seems like the "kwedshin.sh" folder contains some MP3s organized by author! ;) Saying the truth these MP3s aren't downloaded. The homepage was a bit grepped and reformatted by a script and the content was sent to kiobashin. However looks like a well organized folder!
How to listen the MP3s? Let's simply copy the MP3s like any file on the desktop, on a folder or directly on your MP3 player! LOOL! Don't try to launch directly these files... Kiobashin is still a bit buggy... :)
How it works?
Really simple. The kiobashin root shows all your *.sh scripts in your "kiobashin" directory in your home.
When you "go into" a kiobashin script, it runs the script and parses the output. How?
Will be called when you are at
Will be called when you are at
When the script is called, it must return some stuff that descripts the virtual directory in this way:
1. If you want a folder simply echo a "*" with the folder name.
2. If you want a file, echo a "." with the file name...
...and another line that describes the file...
That's all for directory listing. You can test directly your script from the command line...
Really easy, isn't it?
Well... now let's explain how kiobashin retrieve files. The kiobashin script is called with the first argument as
it will return only the mime type...
If kiobashin needs the real file, it will call the script using the
Running it from the command line, it will show the pure file.
Clear? Look the
Any particular reason. I just wanna know how hard should be write a virtual filesystem for KDE and now I'm impressed about how easy is. I've just expanded the example provided by KDevelop. And not too much! KDE is a really cool and easy enviroment and has a really well-organized structure. I think that lacks a more n00b-friendly code editor (cough cough... code autocompletion...) and an updated tutorial.
Some suggestions? A good tutorial for KDE application development? Two friendly words? Write @ email@example.com. I'll surely answer to you!