gnome interview questions
Top gnome frequently asked interview questions
I have ubuntu + x11 + gnome.
I want to run a graphical application as another user.
However, when I start it from the command line using sudo -u otheruser app
I get the error "No protocol specified".
How can I work arround this?
Source: (StackOverflow)
Once installing Fedora 19 Desktop Edition, I run the systray of Qt Example. But I could not look for the system tray icon.
There is no Notification area in the Activities overview.
Please let me know to display the notification area or the tray icon.

Source: (StackOverflow)
Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it.
I'm running on Red Hat Enterprise Linux 4.4.
Thanks!
Source: (StackOverflow)
How do you programmatically change volume in Gnome on Ubuntu, either from the command line or an API (Python preferrably)?
The only answers I found to similar questions use amixer
, which seems to have no effect on Ubuntu 12.04. Running:
amixer set Headphone 10-
shows:
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 115
Mono:
Front Left: Playback 0 [57%] [-57.50dB] [on]
Front Right: Playback 0 [57%] [-57.50dB] [on]
The x% changes each time I run it. Unfortunately, it has no effect on the actual volume. Eventually it says 0%, but volume is still at full blast.
The other downside is I have to specify the exact active output device, which I might not know if there are multiple devices. For example, if I have a "Master" and "Headphone", how do I determine which one is the active device?
Source: (StackOverflow)
I have a script that I need to start up after the user logs in via a nx client. From what I understand, Gnome starts up after a user logs in (correct me if I am wrong here). Where would I put my script so that it starts up after the user logs in?
Relevant Information:
I am working on a redhat machine and assume that I have access only to the files within the home directory (the ~ directory) and not the / directory (can someone tell me what that directory is called? the / one). Are there any files that I can modify/add in the home directory that will help me start up my script? What about if I wanted to start the script from / directory?
Just to clarify since it might've not been clear. The ~/home directory implies all files in the home directory including the ones in the subdirectories; same with the / directory.
Source: (StackOverflow)
I am using the following code to set a tray icon in Windows and Linux. It works wonderful in Windows and works okay in Linux. In Linux (Ubuntu) I have my panel set to be (somewhat) transparent and when I add a GIF (with a transparent background) the background of the icon shows up all grey and ugly (see image, green diamond "!")....Any ideas on how to make the GIF image I am adding "keep" its transparent background?

and the image I am using, if you'd like to test:

import java.awt.*;
import java.awt.event.*;
public class TrayFun {
static class ShowMessageListener implements ActionListener {
TrayIcon trayIcon;
String title;
String message;
TrayIcon.MessageType messageType;
ShowMessageListener(
TrayIcon trayIcon,
String title,
String message,
TrayIcon.MessageType messageType) {
this.trayIcon = trayIcon;
this.title = title;
this.message = message;
this.messageType = messageType;
}
public void actionPerformed(ActionEvent e) {
trayIcon.displayMessage(title, message, messageType);
}
}
public static void main(String args[]) {
Runnable runner = new Runnable() {
public void run() {
if (SystemTray.isSupported()) {
final SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().getImage("green_info.png");
PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon = new TrayIcon(image, "The Tip Text", popup);
trayIcon.setImageAutoSize(true);
MenuItem item = new MenuItem("Close");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tray.remove(trayIcon);
}
});
popup.add(item);
try {
tray.add(trayIcon);
} catch (AWTException e) {
System.err.println("Can't add to tray");
}
} else {
System.err.println("Tray unavailable");
}
}
};
EventQueue.invokeLater(runner);
}
}
Source: (StackOverflow)
Using C++ on the Linux desktop, what is the best way to get the icon, the document description and the application "associated" with an arbitrary file/file path?
I'd like to use the most "canonical" way to find icons, mime-type/file type descriptions and associated applications on both KDE and gnome and I'd like to avoid any "shelling out" to the command line and "low-level" routines as well as avoiding re-inventing the wheel myself (no parsing the mime-types file and such).
Edits and Notes:
Hey, I originally asked this question about the QT file info object and the answer that "there is no clear answer" seems to be correct as far as it goes. BUT this is such a screwed-up situation that I am opening the question looking for more information.
I don't care about QT in particular any more, I'm just looking for the most cannonical way to find the mime type via C++/c function calls on both KDE and gnome (especially Gnome, since that's where things confuse me most). I want to be able show icons and descriptions matching Nautilus in Gnome and Konquerer/whatever on KDE as well as opening files appropriately, etc.
I suppose it's OK that I get this separately for KDE and Gnome. The big question is what's the most common/best/cannonical way to get all this information for the Linux desktop? Gnome documentation is especially opaque. gnome-vsf has mime routines but it's deprecated and I can't find a mime routine for GIO/GFS, gnome-vsf's replacement. There's a vague implication that one should use the open desktop applications but which one to use is obscure. And where does libmagic and xdg fit in?
Pointers to an essay summarizing the issues gladly accepted. Again, I know the three line answer is "no such animal" but I'm looking for the long answer.
Source: (StackOverflow)
Whenever I start my console gnome-terminal
in Ubuntu, it starts in the home directory. How can I make it start in a different directory say ~/myfolder
?
I tried to write cd ~/myfolder
in ~/.profile
but nothing happens.
Source: (StackOverflow)
I am wondering, which type and version of JavaScript/CSS engines is Gnome 3
aka Gnome Shell
using?
Is there any information about current version, etc?
Source: (StackOverflow)
I want to make gnome-terminal behave in such a way that when the
end user selects a region on the terminal (with a mouse or mouse
key), it gets automatically copied into the clipboard. Is it
possible at all? If so, how?
Source: (StackOverflow)
How do you add a 'keyword' to the GEdit list of keywords? I basiclly want to make the printf function look like a keyword.
printf("Hello World\n");
Source: (StackOverflow)
I am new to gtk and gnome programming and like to study GTK+ 3.0 and Gnome 3 programming. Since both of these are recent APIs, I can't find a good tutorial or blog post about these topics. The books I found on GTK+ or GNOME programming are very old ones. So I decided to start with the latest gtk tutorial at http://developer.gnome.org/gtk-tutorial/ which currently happened to be about GTK+ 2.90.7.
I need your help to find any tutorial or blogs or any book which cover GTK+ 3.0 or GNOME 3 programming topics. Would you please share any links that you know about these topics and thank you in advance.
Source: (StackOverflow)
On my Ubuntu linux box I can easily mount USB connected drives or CDROM clicking on devices icons that I can found on the Desktop.
For example if I click on a USB connected drive icon the following things happen:
- a /media/LABEL directory is automatically created (where LABEL is the label of the disk and may vary from disk to disk)
- the filesystem on the device is mounted on /media/LABEL
This process is significantly different from mounting using the mount
command. In particular:
- you don't need to be root (or you don't need to modify /etc/fstab to allow ordinary user to mount the device)
- the /media/LABEL directory is automatically created
- the name of the directory changes according the volume label.
There is a command line command that behaves like the Gnome GUI mounting facilities does?
Source: (StackOverflow)