Programming :: Get Program Based On Mime-type In C
Feb 10, 2010
I need to launch programs in my program and the program can be a script, a Linux executable or even a Windows executable. The first thing i tried is to use xdg-open from my program, but i can't pass arguments to it, otherwise it would have worked perfectly. Is there maybe a way to determine which program is set as default according to the mime-type of the program i want to launch? I also tried kfmclient and gnome-open, they don't allow arguments either.
I have a folder containing the output from Windows XP "File and Settings Transfer Wizard" - the folder refuses to be imported into any flavour of Windows and the original windows system is no more - so I found a little program called fastconv [URL] which extracted all the files but fails to rename them - been working on this solidly for 3 days now, there are 47,000 files in 20gb, so naturally the customer is very concerned.
I noticed that Ubuntu cleverly recognises the type of file, assuming its looking at the contents of the file rather than the extension.
Is there any way I can automatically rename the files based on the mime type?
I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
I installed faenza icon theme and would like to have for my pdf docs only mime type (included in mime types/ icon theme), not a thumbnail. Is there some easy way to change this system wide? I tried this and similar suggestions found on net, but no go: http://ubuntuforums.org/showthread.php?t=770142
I installed MS office 2003 via wine on Slackware 13. I need to know how to associate files with the right Office (msword, msexcel, msppt) program. I made launcher scripts that can launches office files from the CL, but the user on this computer will want to be able to just double click a file in dolphin and have the right office program come up.For some reason all office files show up as x-ole-storage instead of application/msword or something similar. So, even if I tell Excel to associate with that file, it will do it for Word and PowerPoint files as well.
.ppt, .doc, and .xls extensions were configured via the KDE file associations panel, but this did not help. I played around with the raw files under ~/.local/share, but I did not find the solution.The version of WINE is 1.1.24 (built from SBo SlackBuild).
I am trying to transfer extracted music files from a CD into Rhythm Box music library, and I get the response, "Unable to locate encoding profile for mime-type"
I installed a trial copy of Anquet Map V06 under Wine then decided to remove it. Afterwards I could find many remnants associated with the Anquet program which I've deleted. Except what remains is an association between my .gpx files with Anquet and that includes and any new gpx file I download. My interpretation is that during the install process an association has been created with the gpx file type and the Anquet map program. This is what I want to stop. If I download a .gpx file and look at it's properties I see- Type: GPX File -Anquet Mapsv06 (application/x-wine-extension-gpx) I found this file and it's contents-
Running "sudo update-mime-database /usr/share/mime" and rebooting didn't remove the association. How can I stop the Anquet name making as association with my gpx files?
I can't setup or change MIME-Types in Mate/Caja (filemanager)
I use MATE Desktop on Debian 8.1 - File Manager is Caja (1.8.2) - I put in a USB Stick whit Pics. In the Popup Window they came up, normally i can setup a Default behavior for Pics, Music ... But, in my Window the Options are not available. (Grey) The same in "Settings" from Caja (Datenträger) Data Medium.
attempting to install VLC I get the following errors;
Error in file "/usr/share/applications/kde4/kfontview.desktop": "fonts/package" is an invalid MIME type ("fonts" is an unregistered media type) Warning in file "/usr/share/applications/gnome-nautilus-folder-handler.desktop": usage of MIME type "x-directory/gnome-default-handler" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent) Warning in file "/usr/share/applications/gnome-nautilus-folder-handler.desktop": usage of MIME type "x-directory/normal" is discouraged ("x-directory" is an old media type that should be replaced with a modern equivalent)
Thoughts or suggestions on how to fix this. I running Fedora 13 and I used 'yum install vlc' to install the app.
Is there a way to set Firefox to place downloaded files in different folders based on the file type?e.g. in my Downloads folder place all .doc files in a sub-folder called ".doc", all .jpgs in a sub-folder called ".jpg"I'd assume there's probably a rule, or a script that can be used to accomplish this, but being a graduate student, I don't have alot of free time to poke around and figure it out myself
Is there any application that will let me restrict search results, by, for example, whether it is a plain text document or a jpeg image (not by extension, but the same way nautilus knows if something is a jpeg even if it doesn't have an extension)?It would be nice to have an easy way to search for, e.g., just images, just videos, or just music without relying on file extensions.
I am trying to generic way to convert the string datatype to other primitive data type. To achieve, i used Template . But i getting error and couldn't resolve the issue and error reported is also clueless.
I have recently been programming with Qt and slowly getting my head around it.I want to have a pet project to learn some more and then I got to thinking how should I go about this.My question is what is the proper way to program for Linux based GUIs? One of the things I would like to write is a small front end for newspost. I want to include extra stuff like rar and creating pars on the fly. So how should I go about integrating other CLI programs to make my GUI feature rich? I thought of three ways to approach this.
1. Take all source code and throw it into one self containing project. (think this is evil) 2. The GUI will basically assemble CLI commands and call them. This is nice but can very fragile. 3. The GUI will compile against rar-libs and other libs?
I am originally an MS programmer and don't think I should apply same practices toward Linux. So let me know what your opinions are and how you roll out GUIs.
any way to make a certain file extension (.etxt) open with a certain jar application (enotes.jar) that uses files with that file extension? i tried (for the custom open command on a .etxt file):
Code:
java -jar /home/me/Programs/enotes.jar "%1" %*
which was proposed (for windows) here: [URL]but it doesn't work when adapted to linux...
I just found out about this distro using search on these forums and it kind of excited me because I am a chemistry student. I was wondering if anyone has used it and if so does it have any Chemsketch equivalent programs included with it ?
If not (or even if it does) do you have any suggestions of programs that are the same as (on a ease of use/quick to pick up scale) or better than for simple/quick organic and inorganic modeling/reaction modeling ?
Is there a program like peer block for ubuntu? It is an ip filter program. Here is the website to help answer questions on what type of program it is. http://www.peerblock.com/
I'm wondering if there exists software that serves the same kind of function as Tasker or Locale for Android except for Linux. I think it would be really great to be able to have certain things run automatically based on a set of conditions. For example, I would like to automatically sync my mp3s to my laptop from my home computer when my laptop connects to my home network.
I've been given one of these ubiquitous usb-sleep buttons which is basically a supersimple usb-keyboard. It's a big button that sends a SLEEP keypress to the computer when you slam it. But that is pretty boring. I'd love to remap it to do something more fun but I can't figure out how to bind to only the sleep press from the button and not from my ordinary keyboard.
The button identifies as
Bus 001 Device 035: ID 1130:600d Tenx Technology, Inc.
I'd like to know if there's either
a way of mapping a key from a specific keyboard to an action OR a way of remapping the sleep key from a specific keyboard to a new key-code or something like that.
I currently doing a network emulator program and the features must includes the web-based interface for user configuration. I able to run my program through command line. But I would like to ask how to associate my program to web-based interface for user configuration?
Could you suggest feature-rich disk-based personal backup program for Linux (and I've seen a few)?
I want to do nightly backups of the whole system and be able to rollback to any of last 7 days. And, it must be incremental backups. What tool should I use? The tutorials I've read about rsync tell only how to store latest incremental backup and I need last 7.
I used MusicBrainz Picard to tag FLAC and Mp3 files, fixed any necessary genre tags in Rhythmbox, and used EasyTag to rename the actual files.But now I'm interested in using those genre tags as folder names...is there any program that will sort my music into folders based on their genre tags?
I like the convenience of having a music player that manages the placement of my music files based on the tags of the files, sorting into a root music folder with Artist/Album/01 - Track Title.mp3 sort of hierarchy. Previously, I was using Banshee for this feature, as even most of the other gui music players don't have this library management feature. Now, I've been trying to use console-based applications, and I have been using mpd + ncmpcpp fairly successfully. When I download new music, it is downloaded to a specific folder, and that's not part of my music collection. My previous workflow would be to open a gui filemanager at the downloaded folder, and drag and drop those songs onto banshee, which would then make a copy of those files in my library hierarchy. Currently, I'm doing the same thing, using Banshee only as a sort of import program, then closing it and updating my mpd database, and there we go.
If at all possible, I'd like to automate this to something where I can define a watch folder, and when some magical program sees new music in said watch folder, it identifies the correct place for the files to be copied into my heirarchy, renaming folders and files to the correct format. I know I've written a lot describing, but I don't actually think this too uncommon a task, and I'm wondering if anyone has a solution for my problem.
I have included fstream in my file (#include <fstream>) In the file, I have a class declaration and a private variable static fstream fileStopWatch; Then I am getting the error "'fstream' does not name a type" It was working in gcc version 4.1.2 20080704 (Red Hat 4.1.2-48) but not working in gcc version 4.4.4 (GCC)