Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm thinking of a new small Linux Desktop Environment. The main goal why I want to develop it is to dive more deeply into the development of Linux. For that, I want to use C++ and Qt4.
My first thinking is, to have a panel at the top which will look a little bit like the one of Gnome3, but without the activities and a full integration of the User-panel with the working chat client. For the notifications of programs I want to implement a little tray-icon like it's used in the kde4.5 desktop.
At the bottom will be a macintosh like Panel where the user can place his favorite programs and where a menu will be placed in.
The primary goal of this desktop will be ease of use. The normal user will just get a few possibilities to customize his desktop (as it is the strategy of the Gnome-project) but with an option to get a full list of options available for the advanced user.
The reason, why I'm writing this post is to get some feedback of my ideas and to get some ideas, how to improve the experience of Linux.
As soon as I have something implemented, I will post some screenshots.
to have a panel at the top which will look a little bit like the one of Gnome3, but without the activities and a full integration of the User-panel with the working chat client.
You can remove anything you want from the top panel including the chat integration.
Quote:
For the notifications of programs I want to implement a little tray-icon like it's used in the kde4.5 desktop.
Haven't used KDE for along time, so not exactly sure what it is.
Quote:
At the bottom will be a macintosh like Panel where the user can place his favorite programs and where a menu will be placed in.
Have you tried AWN? From your description it is exactly what you want.
I was under the impression you didn't want it, or much else, in the panel? Trying to point out that if you want a minimal panel it is easily done.
Personally I use the panel fairly extensively, and AWN to some degree. But that's the wonderful think about Linux, you can do whatever you want with it.
If you want to do this in order to get your hands dirty in development that's great. But from your stated requirements it sounds like everything you want is already there in current DE's. But again nothing at all wrong with doing it just to do it.
And yeah, definitely post some screenshots. I would like to see it.
Qt is far easier than GTK+. I tried programming with GTK+, and it was incredibly hard. But with Qt it was a breeze!
I see no reason not to go with Qt, I also prefer it.
People who think Qt is huge for a GUI toolkit probably don't know that it's much more than a GUI toolkit. It's pretty much a cross-platform library for just about everything from file I/O to networking to 3D graphics.
1. How can you find GTK+ hard to use? What were you trying to do? I'm sure whatever you did with QT can be done with GTK+ in fewer lines of code. Creating a window is as simple as
Code:
GtkWindow * w = gtk_window_new ( GTK_WINDOW_TOPLEVEL ) ;
2. GTK+ too has a component graphics library, an I/O library, a native low level toolkit that communicates with actual system interfaces (GDK), a general purpose utility library, and much more.
3. It is lightweight, easy to use and "themable" i.e you can make a "skinnable" app.
3a. GTK+ and all its component libraries are cross platform too.
4. I've got nothing against QT, but in my opinion GTK is a better choice. Plus, you've got the silly "no commercial use on windows" licensing issue with QT. GTK is all open source.
#include <stdlib.h>
#include <gtk/gtk.h>
/* Create a new hbox with an image and a label packed into it
* and return the box. */
static GtkWidget *xpm_label_box( gchar *xpm_filename,
gchar *label_text )
{
GtkWidget *box;
GtkWidget *label;
GtkWidget *image;
/* Create box for image and label */
box = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 2);
/* Now on to the image stuff */
image = gtk_image_new_from_file (xpm_filename);
/* Create a label for the button */
label = gtk_label_new (label_text);
/* Pack the image and label into the box */
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 3);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 3);
gtk_widget_show (image);
gtk_widget_show (label);
return box;
}
/* Our usual callback function */
static void callback( GtkWidget *widget,
gpointer data )
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
int main( int argc,
char *argv[] )
{
/* GtkWidget is the storage type for widgets */
GtkWidget *window;
GtkWidget *button;
GtkWidget *box;
gtk_init (&argc, &argv);
/* Create a new window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Pixmap'd Buttons!");
/* It's a good idea to do this for all windows. */
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
/* Sets the border width of the window. */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* Create a new button */
button = gtk_button_new ();
/* Connect the "clicked" signal of the button to our callback */
g_signal_connect (button, "clicked",
G_CALLBACK (callback), (gpointer) "cool button");
/* This calls our box creating function */
box = xpm_label_box ("info.xpm", "cool button");
/* Pack and show all our widgets */
gtk_widget_show (box);
gtk_container_add (GTK_CONTAINER (button), box);
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (window);
/* Rest in gtk_main and wait for the fun to begin! */
gtk_main ();
return 0;
}
Equivalent Qt program:
Code:
#include <QtCore>
#include <QtGui>
#include <QtDebug>
class Window : public QWidget
{
Q_OBJECT
Window::Window()
{
QVBoxLayout layout = new QVBoxLayout(this);
setLayout(layout);
QPushButton button = new QPushButton(this, "cool button");
button->setIcon(QIcon("info.xpm"))
layout.addWidget(button);
connect(button, SIGNAL(clicked()), this, SLOT(onButtonPressed()));
}
public slots:
void onButtonPressed()
{
qDebug() << "Button was pressed";
}
};
int main(int argc, char **argv)
{
QApplication app(&argc, &argv);
Window w;
w.show()
return app.exec()
}
Definitively Qt is easier to understand from the two examples.
But the discussion is not about which toolkit is better, the discussion is about how can we improve the Linux experience for users and how could that fit in a new desktop environment.
So, as you can see, the same thing in 3 effective lines of code. Note that there is no way to check for errors if we use gtk_image_new_from_file (). It would be better to load the image as a GdkPixbuf via gdk_pixbuf_new_from_file (), which takes a ** GError as an argument, and reports if the image is not found or cannot be loaded.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.