LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-22-2011, 10:29 AM   #1
akamikeym
Member
 
Registered: May 2008
Posts: 112

Rep: Reputation: 21
Advice to get started with making 'a SIMPLE dock'


Hi,

This is probably hopelessly ambitious as I'm not a C or C++ programmer (I normally like to stick to scripting languages like BASH or Perl).

Basically I'm looking on good advice to get me started with writing a Application Dock with the functionality of the OSX dock but without the overly flamboyant graphics that have characterised the Linux versions.

At the moment the closest I've found to what I would like is bbdock. However it falls well short of the functionality of what I would like.

What bbdock does is read a file to create an icon for the openbox dock/fluxbox slit/wmaker whatever that launches an application when first clicked, shows an little arrow when the application is running, and brings the application to the fore when clicked once running.

Here's a screenshot of it doing just that.

The drawback to bbdock is that it doesn't really look for running applications, only those launched from bbdock. So for example it wont notice if I've launched an instance of pcmanfm from the openbox menu. And therefore it obviously also doesn't add icons for other applications that are running.

What I would like to be able to do is detect new running applications and add a bbdock icon for them. Also to detect if an application already with a shortcut has been run and update it's status to show it's open. Probably have an up and down arrow to move the icons up and down when there are too many to fit on the screen.

None of the above needs fancy animation. The fade to gray effect used by bbdock is quite nice and could probably be augmented with a fade in and out to grey to represent another action, say fading to grey and back when launching and greyed when iconified.

So, my question is what do I need to get started doing this? Am I best using the pretty outdated bbdock wmaker dockapp style? What functions and libraries am I likely to need to achieve the effects I want? Are there any examples of how to monitor running applications (well windows and figure out what constitutes a new application) that I could look at for inspiration. Is there anyone who's into C++ for linux who would be interested in helping me out to get this small project working?

Last edited by akamikeym; 03-22-2011 at 10:30 AM. Reason: touching up the tags
 
Old 03-22-2011, 11:13 AM   #2
posixculprit
Member
 
Registered: May 2010
Posts: 136

Rep: Reputation: 42
Hello.

This will probably not be a surprise but (IMO) if you plan to develop this utility in C or C++ a good starting point would be to actually learn the basics of one of these two languages. According to some programmers, these two aren't exactly -easy- to program in, even if you have some experience and have a serious interest in them (which I gather you don't). You might be able to put some libraries together with spit and sweat but my guess is it will happen after an intense period of frustration.

You claim you like Perl so why not take a look to see what libraries are available for it to help you write this utility (various libraries have all sorts of language bindings).
 
Old 03-22-2011, 11:24 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
For finding out what applications are installed, how to launch them, how to find their icons, etc. read this: http://portland.freedesktop.org/wiki/. That way it will nicely work with everything in a standard way.

And, of course, you will need to learn C with GTK+ or C++ with Qt.

IMO Qt is easier to work with, and it also has nice APIs for file/directory manipulation and running child processes (which will be necessary for such a project).

Last edited by MTK358; 03-22-2011 at 11:26 AM.
 
Old 03-22-2011, 11:37 AM   #4
akamikeym
Member
 
Registered: May 2008
Posts: 112

Original Poster
Rep: Reputation: 21
posixculprit, thanks for the reply.

No they're not easy languages (everything you can do in a line of another language seem to require about 5 in C and C++ is worse, in my experience). I would say I'm probably at a reading level at the moment, in that I can follow what something someone else has written (at least where it's not too opaque) and occasional tweaking, but I'm not much use at actually writing my own stuff.

It's part of the reason that this as a project appeals to me though as it really should be quite a simple program.

Are you suggesting I write the program in perl? Or are you suggesting I try out the libraries I could use in perl before I try to use them in C++?
 
Old 03-22-2011, 11:46 AM   #5
akamikeym
Member
 
Registered: May 2008
Posts: 112

Original Poster
Rep: Reputation: 21
MTK358, the bbdock app is one of those early linux applications that doesn't use anything like GTK or QT. I'm inclined to keep it that way if I can just to keep things super-light and super-simple. I've done a few GTK projects with perl (and I'm a fan of GTK) so I'd move that way if I were to go either way.

The xdg-utils are a much needed set of utilities but they don't really stretch to providing the kind of access to the currently running processes/windows/applications that this project really requires.

P.S. Also thanks for the reply
 
Old 03-22-2011, 11:54 AM   #6
posixculprit
Member
 
Registered: May 2010
Posts: 136

Rep: Reputation: 42
There's a lot of C++ hating on LQ so even though off-topic I'll start with this: in my experience a C++ program is, on average, smaller than the equivalent C program.. that is to say, on average, a line of C++ is more expressive than a line of C. Also in my experience, the number of lines is of limited importance (correctness, efficiency, robustness, clarity are all incomparably more important and difficult to obtain / combine).

Whilst kind of being able to read code written by others can work on some level.. kind of being able to program isn't as likely to be successful. The compiler can't kind of understand what you kind of thought you told it you want your program to do. Because of this, although it may seem like an easy task, you might find that your inexperience also impacts your ability to predict how easy a task is.

I was indeed suggesting you consider writing it in Perl. Both GTK+ and Qt (which MTK358 finds better, as he repeatedly tells us ;-) ) have Perl bindings (and I'm guessing other popular frameworks which might help you get the job done are either written in Perl or have Perl bindings too).

Last edited by posixculprit; 03-22-2011 at 11:56 AM.
 
Old 03-22-2011, 12:30 PM   #7
akamikeym
Member
 
Registered: May 2008
Posts: 112

Original Poster
Rep: Reputation: 21
Like I said I'm aware of the bindings of languages such as Perl as I've used them (certainly the GTK ones not so much the qt). I'm also aware of the importance of getting code right - and that you are less sheltered from poor programming in a language like C(++). (I also wasn't really having a go at either language I understand that the reason that it takes more lines of code (and it does even if those lines are wrapped up in a library) to achieve something is that the code that you write is closer to the machine level operation of the computer and that has a follow on affects on speed, reliability etc.

I also know that Perl (as much as I like it) is not the language to implement this project. The reason I came to ask the question here is so that instead of reading hundreds/thousands of pages on libraries and X11 window management to figure out how to get started I was hoping to get pointed in the right direction and only have to read dozens.

Telling me to use another language than the two I've identified as obvious candidates isn't really answering the question.
 
Old 03-22-2011, 12:46 PM   #8
posixculprit
Member
 
Registered: May 2010
Posts: 136

Rep: Reputation: 42
Understood, my apologies sir.
 
Old 03-22-2011, 12:59 PM   #9
akamikeym
Member
 
Registered: May 2008
Posts: 112

Original Poster
Rep: Reputation: 21
Apologies if I came across as snappy there. I have respect for anyone who's willing to take time to try and help out others. Just trying to make my intentions and query clear.
 
  


Reply

Tags
cpp, dock, openbox, programing, project



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Making Gnome Do A Dock Norwood Linux - Newbie 5 03-29-2010 04:04 PM
cairo-dock, gnome-dock, kiba-dock?? LinuxNewbie999 *BSD 0 04-03-2008 09:16 AM
Need help getting started simple simple shell script dhonnoll78 Programming 6 12-17-2007 05:34 PM
Advice on getting started. samurai_cyborg Linux - General 3 02-03-2006 09:04 PM
making windowmaker's dock horizontal rose_bud4201 Linux - Software 0 08-13-2003 05:53 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration