Programming :: Programmatically Set File Associations In Gnome/KDE?
Jun 3, 2010
I would like to associate my program with several file extensions programatically.
Everything I've been finding online is how a user would set a file association, does anyone know how to do this progormatically (bash, C++, etc)?
I would mostly like to get this to work with Gnome, but KDE would be nice as well.
View 3 Replies
ADVERTISEMENT
Jul 14, 2010
Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).
Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).
View 4 Replies
View Related
May 25, 2011
How do I change the default file associations in F15/gnome 3? My system is currently set to open .tex files with emacs. But I prefer TeXworks, and while TeXworks shows up in the "Open With" menu, it would be convenient if double-clicking on a tex file opened it in TeXworks. In gnome2, the "Open with-->Other application" option let me select the default program associated with a particular type of file, but this functionality seems to be gone in Gnome 3. Do I have to edit some config file?
View 5 Replies
View Related
May 4, 2009
I am developing a application in which i have to show the name of default browser and mail client. i want to run this application on RedHat, SuSE, Mandriva, and Ubuntu. I have checked similar threads but not found any useful information.
View 8 Replies
View Related
Oct 3, 2010
Given a matrix with 0,1 entries, how can I create a graphic in linux such that we have a black square or pixel if the entry is one and white otherwise?
For example, if the matrix is:
0001000
0011100
0111110
0000000
then I want a graphic that looks like:
[code]....
I will be working with many large matrices, e.g. 1000x1000, or 5000x1000 so I need to do this automatically.
View 6 Replies
View Related
Jun 18, 2011
Yesterday on my laptop I minimized Konqueror file browser and did something else for 10 minutes. When I went back to Konqueror no files would open; any file type asked for an app to use.
I found even in KDE settings/file associations everything had disappeared. No file type any longer has an app associated with it. Worse, if I assign one it doesn't 'take'. I haven't deleted anything or installed/updated anything, and I restored ~/kde/share/apps and ~/kde/share/config from backups but no joy.
I figure I may have a corrupted or missing data file, but which one?
View 2 Replies
View Related
Jan 21, 2010
I've edited the default file list association; sudo gedit/etc/gnome/defaults.list replacing all the totem.desktop with vlc.desktop (ctrl+H). however I don't understand how but VLC opens only certain files such as .flac, .wmv but not .mp3, .avi
View 9 Replies
View Related
Mar 25, 2010
I would like to change some of the file associations. for example, I like to exaile and every time I click on a mp3 I end up 'pulling' up totem the movie player. I have seen in the past but do not use this feature that much so have forgotten.
View 1 Replies
View Related
Jan 4, 2010
I know Dolphin/Konqueror is the manager of choice while in KDE, but I prefer Nautilus, mostly because I'm used to it. If I launch either a pure Openbox or Gnome session, Nautilus works perfectly fine. If I launch a KDE or KDE/Openbox session, Nautilus seems to 'forget' all the file associations for... well, pretty much everything. Thumbnail image previews and the mouse-over playing of audio files also seems to have stopped working, though these I can live without.
I looked into how Openbox handles it, and it seems to be that it launches 'Gnome services' to allow it, but I've not found exactly what those are, or how to launch them within KDE to fix Nautilus.
This is on Debian Lenny, with the KDE 4.3 repository containing the backport for Lenny enabled.
View 1 Replies
View Related
Mar 16, 2016
For some time (I don't remember exactly how long/since when, maybe since I switched to i3 window manager?) I have the problem from title.
Chromium browser uses completely different programs to open files than file browser (thunar). And most of the time thunar has associations I want. For example thunar opens PDFs with iceweasel, and chromium opens them with GIMP (!), note that I have never changed this king of settings. Until I changed it today chromium also used Baobab (I didn't even know it existed before I saw it) to open directories ("show file in directory" for downloaded files).
I know how to change for a single file type (at least for browser), but is there some way to set all file types to something sensible and keep both, browser and thunar in sync without doing all of that manually? Or at least revert it all to default?
Debian version: latest "testing" version. (I use testing because I really need up to date versions of a lot of programs)...
View 0 Replies
View Related
May 1, 2010
When using firefox to open a file attachment in web mail the update configuration runs but next time the same box appears to select which program to use , in firefox preferences / applications there is no way to add a new file association for a new filetype eg .doc or .xls ....!
I tried switching off suse integration with firefox but it made no difference .if anyone has a fix for for this i can save myself a lot of time .
Firefox version 3.5.9
open suse 11.2
AMD Athlon(tm) II X2 240 Processor
Speed: 2,800.00 MHz1.8 GiB
Free memory: 788.6 MiB (+ 605.2 MiB Caches)
Free swap: 2.0 GiB
View 2 Replies
View Related
Aug 22, 2011
I'm curious how file association management is implemented in Linux. Where is the related information stored? How do I modify it (I'm interested in non-KDE-based ways; I know there's a system configuration page for that in KDE)?
View 2 Replies
View Related
Feb 1, 2010
I am unable to double-click a file of a given type, e.g. .pdf, and have it open in the appropriate application. While some file types have the correct associations, others do not, and I am unable to assign apps for some file types.
An example is Adobe portable document files ending in .pdf. If I right-click on a .pdf in Nautilus, and select "Open with," I get a dialog containing two tabs. One lists applications already associated with that file type, which at present is blank. The other tab seems as if it should allow me to assign an application to that file type, but when I click it, the dialog simply closes suddenly, as if crashing.
What is going on here, and how do I fix it?
(Ubuntu 9.10 64-bit)
View 9 Replies
View Related
Jun 7, 2010
i initially installed ubuntu, working with gnome for a while. i now migrated to kde as i like it better. however, the kde session still has lots of the "old" file associations set as they are in gnome...
some examples? text files open in gedit, instead of kate pdfs open in "document viewer" instead of okular double clicking zip folder opens the "archiver" (gnome?), extracting an archive from the archiver and then pressing the "open folder" dialog after extracting has finished, opens nautilus (although dophin is the default program for inodes). etc.
i'm aware of the possibility to edit file associations, however thats a tedious thingy to do, if you want to get it complete... furthermore, the file association edit dialog has the "defaults" button disabled, hence my questions:
is there any way to "restore" the kde default file associations, just as i would have installed kubuntu initially? i don't want to reinstall just because of this.
View 5 Replies
View Related
Apr 19, 2011
I have my default text files (also source codes etc.) associated with gedit (checked with ubuntu tweak).However, nautilus tries it to open with some "notepad" - dunno what it is I don't even have such a program. Files are OK, opening them directly from gedit or vim is fine.Some weird things:- nautilus correctly displays gedit icon- I have dualboot system with windows 7 and notepad command looks like it came from "there"- when I click on open with -> gedit, file is correctly open. However this option is not remembered by nautilus (even though I checked it as always open with ...)- nautilus (after clicking on open with) also suggest to use some "iexplore" command, I totally don't have idea where that came from Any suggestions? I really don't feel like using another file manager, but opening text files is pretty elementeray action and should work properly
View 9 Replies
View Related
Jun 15, 2011
I recently upgraded to Fedora 15 and am super-happy with it. Unfortunately, I have a minor issue that I haven't yet figured out how to fix: I can't change the default applications or the file type associations. For instance, I'd like to set Chromium as my default browser. When I first login, I tell it to set itself as default. But after I end my session and log back it, Firefox is back to being the default browser.
I have the same issues when trying to change what applications open filetypes. .rtf files have been opening in Wordpad in Wine. When I try to change it to Writer through the "Open with" dialog, it retains the change for that session but resets after I log out. I actually ended up having to uninstall Calibre because it was opening .odt files instead of LibreOffice and I couldn't change it permanently.
View 5 Replies
View Related
May 16, 2010
How do i change file type associations? i looked but i don't see anything...i'm having that problem where google chrome won't stya set as default and i fixed it in fedora by changing the file associations manually :-)
View 1 Replies
View Related
Jan 20, 2010
I'm running a standalone compiz (not in gnome, but just compiz, gnome-do and AWN).I use tracker to search for my stuff all the time, however, since I started using compiz without gnome, when I click results they're always opened by the browser (folders, mp3s, etc).I belive tracker uses xdg-open, and I noticed xdg-open exhibits the same behaviour.Where do I change the file associations xdg-open uses? I've found little to no documentation about it.
View 1 Replies
View Related
May 13, 2011
On Ubuntu 11.04, I have a need to use gnome-open from another application to open files in assigned applications. I think I understand how mime types are given in /usr/share/mime. I understand how default application associations are done in /usr/share/gnome/applications/defaults.list. I understand how update-desktop-database is used to maintain defaults.list. I know how to specify file associations (open with) from Nautilus. I understand how ~/.local/share/applications and ~/.local/share/mime override the system settings. I get all that.
What I don't understand is why the command gnome-open or double-clicking a file in nautilus, for certain file types (e.g. PDF), generates an error message:
Quote:
Could not display "<whatever file>". The location is not a folder.
The occurrences of application/pdf in the different applicable files all point to evince as the associated application.
By the way, mimeopen does work. What is the relationship between mimeopen and gnome-open? Manual pages for these commands are not helpful in understanding their operation.
In addition, I might throw in one other question. In the various .desktop files, I see that some application commands are enclosed in single quotes, but never the file name identifier, %f. If dealing with file/directory names with spaces in them, it would seem that quoting the '%f' would be important.
View 3 Replies
View Related
Jun 29, 2011
For the past few days my file associations have gone for a toss. For example : an icon on the desktop to open eclipse says eclipse.desktop and doesn't show the eclipse image when i right click a .bz2 file it doesn't show the extract here option for text files, a small bit of the text is showing outside the icon where it usually shows inside The same problems are present in nautilus as well as the desktop.
Need some quick help to reset these to the default.
Have attached a screenshot to show the issue.
View 7 Replies
View Related
Feb 17, 2011
Only "Favourites", "Run Command" and "Leave" is shown on the classic KDE menu, same thing when switching to Launcher Menu Style. Missing Applications and everything else. File associations is not working. Double clicking any type of file it asks to install the program and the known applications menu is empty.
I tried to add a new user, same problem with that. I also noticed that when running Chrome it asks to be the default web browser each time even when I say yes.
I have not been messing with anything, I suspect it happened during a update, but I got the exact same repositories on 2 other x64 machines where there is no problem.
I'm using KDE 4.6.0 from the factory repository.
I tried to reinstall some KDE4 packages without any luck.
I do not want to reinstall the entire system or downgrade KDE.
Code:
# | Alias | Name | Enabled | Refresh
---+------------------------------+----------------------------------------------+---------+--------
1 | buildservice-education | openSUSE BuildService - Education | Yes | Yes
[Code].....
View 9 Replies
View Related
Mar 1, 2010
Every applications of KDE 4 menu are missing.
[URL]
When I try to open some file, including directories, "Open with..." window appears.
View 3 Replies
View Related
Mar 12, 2011
Is there any way to get the name(s) of the file(s) selected in the window manager (gnome 2.32) in a bash script?
View 7 Replies
View Related
May 27, 2011
My system doesn't reacts at writing values below 255 to /sys/class/hwmon/hwmon0/device/pwm(2,3) which correspond to 3-wire case fans connected via M/B (ga-890gpa-ud3h) headers. The idea was taken from [url]
ls /sys/class/hwmon/hwmon0/device/
It indeed shows the actual speed:
But refuses to write to fanX_input: permission denied (even for root).
More specs: kernel 2.6.38.4, sensors output is:
I do not run any daemons for fan control, but suppose the speed may be set by CPU in-kernel governor. How to stop a fan under this conditions without doing hardware tricks?
Upd: part of pwmconfig's output:
Devices:
Found the following PWM controls:
hwmon0/device/pwm2 is currently setup for automatic speed control. In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y hwmon0/device/pwm3 hwmon0/device/pwm3 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y
Test:
Warning! This program will stop your fans, one at a time, for approximately 5 seconds each! This may cause your processor temperature to rise! If you do not want to do this hit control-C now!
Hit return to continue:
Would you like to generate a detailed correlation (y)? y
This was stopping CPU fan. And:
View 2 Replies
View Related
Dec 14, 2010
I have a USB modem and a large C++ application that needs to detect whether that device is present or not. I was hoping to get advice for what the best method to do so would be. The only solution I've thought of is to parse the output of lsusb and look for the vendor and product ID of my device, but that seems a little hack-ish and inefficient. Is there a command or program that I can provide it a vendor/product ID for a USB device and it can tell me whether or not such a device is present in the system? Or another, better way to detect the device than parsing the lsusb output that I've been thinking
View 2 Replies
View Related
Jan 10, 2011
I am writing an Air application and I would like to have the app use the font indicated in Appearance Preferences.
A similar problem to this one :
[URL]
I do not have Gtk::Settings and I have looked in ~/.gconf/desktop/gnome/ but I do not have an interface folder and none of the others I opened have any font details.
I have tried simply not setting a font within my application but it is using a font not specified in the Appearance Preferences at all. It looks like Times.
Ideally I would like to be able to get this information from Ubuntu using a native process :
[URL]
get the font name of the Application font or would I have to write a script and call that from inside Air?
I have a default installation of Ubuntu 10.4 with Unity running on top of Gnome. (I think this is correct. I certainly can get Nautilus running quite easily and as I mentioned earlier I have ~/.gconf/desktop/gnome/ folders).
The brief is to get the application working on the default installation so I cannot install anything but the target machine I am using has got 'gconftool'.
View 2 Replies
View Related
Apr 1, 2011
I need to generate pdf documents programmatically using Ruby. i.e. I don't want a GUI interface but an API interface. The bulk of my document is text but there are images included as well. I've looked at this thread: [URL] and it's 2 main recommendations PDFEdit and ImageMagik. PDFEdit has scripting available but I can't get my head round how to call this using Ruby. ImageMagik has a number of Ruby wrappers and is the kind of thing I want but as far as I can tell it only deals with Images and my stuff is mainly text.
View 1 Replies
View Related
May 11, 2010
I am writing an application that has a web service client on a Windows PC that needs to call a web service on a Linux server. In order to create the client, I need to be able to programmatically read the WSDL on the server and use it to create the client. I'm using the web tools in MyEclipse to build the client.
The Linux server is running Red Hat, I believe, with ssh enabled. I can connect from Linux to Windows with no problem, but I can't reach the Linux box from Windows. I get one of three errors when I try: no path to host, connection reset, or unknown error number, depending on the port I use. I've googled for an answer, but haven't found anything yet.Is there some way to add the Windows IP to a permission file on the Linux machine so it will be recognized when it queries for the WSDL?
View 9 Replies
View Related
Aug 31, 2010
I wonder if there's a way to capture the same information I can get from nethogs to a file. All I need it per process (rather than per interface) what is the sent/received traffic.
View 1 Replies
View Related
Jul 7, 2010
I know the tool system-config-display can tell me all about my display but it's not available on all systems and so I'm looking for alternative ways to get my monitor type. Ideally, I could just look in /proc but I don't see anything there and I would like to be able to do so from a script perhaps written in bash or perl. Is there some place to get this info, say in a config file somewhere?
View 2 Replies
View Related