Announcement

Collapse
No announcement yet.

Open file based on extension and not just file/mime type

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Open file based on extension and not just file/mime type

    I use Unreal Engine 4, it produces C++ project files for CodeLite (e.g. MyProject.workspace). The type of this file is application/xml.

    I can right-click on MyProject.workspace and then select Open With, Other, Development, CodeLite, which works fine, but it's annoying having to do that each and every time. It also means that when UE4 creates MyProject.workspace, it opens it with Firefox instead of CodeLite (I then have to close Firefox, navigate to the directory, then do the "Open With" thing).

    If I right-click on MyProject.workspace, then select Properties, General Tab, File Type Options, and then add "*.workspace" to the "Filename Patterns" section, and "CodeLite" to the "Application Preference Order" section, then all XML files are opened with CodeLite (which is not what I want - I only want CodeLite projects (*.workspace) to be opened with CodeLite).

    How do I configure KDE to open files of type application/xml, but with the extension *.workspace, with CodeLite?

    #2
    Managed to solve this:
    1. Go to System Settings.
    2. Click on Applications.
    3. Click on File Associations.
    4. Expand Application in the Known Types tree.
    5. Click the Add button (make sure "Group" is set to "Application").
    6. In the Name textbox, enter: x-codelite-workspace (and click OK).
    7. In File Patterns, click the Add button and add *.workspace
    8. In the Application Preference Order click the Add button add CodeLite.
    9. Optional: click on the icon box and select the CodeLite icon (which is in System Icons | Applications).
    10. Reboot (changes didn't take effect until I rebooted - there's probably a way of doing this without a reboot).

    Comment


      #3
      Nice work. Thanks for posting your solution.

      Please Read Me

      Comment


        #4
        Nice work! Thanks for posting your solution.
        Concerning step #10 - just logging off and back on will also work.

        An aside: One can use kcmshell5 in a Konsole to see and do many things on the CLI
        Code:
        [FONT=monospace][COLOR=#000000]$ kcmshell5 --list[/COLOR]
        The following modules are available:
        about-distro               - Information About This System
        autostart                  - Automatically Started Applications
        bluedeviladapters          - Bluetooth Adapters
        bluedevildevices           - Bluetooth Devices
        bluedevilglobal            - Advanced Bluetooth Settings
        cache                      - Configure web cache settings
        clock                      - Date and Time
        colors                     - Application Color Scheme
        componentchooser           - Default Applications
        cookies                    - Configure the way cookies work
        cursortheme                - Mouse Cursor Theme
        desktop                    - Navigation, Number and Layout of Virtual Desktops
        desktoppath                - Location for Personal Files
        device_automounter_kcm     - Configure automatic handling of removable storage media
        devinfo                    - Device Viewer
        dma                        - DMA information
        emoticons                  - Emoticon Theme
        filetypes                  - Configure file associations
        fontinst                   - Font Installation, Preview and Removal
        fonts                      - Fonts
        formats                    - Numeric, Currency and Time Formats
        icons                      - Icon Theme
        interrupts                 - Interrupt information
        ioports                    - IO-port information
        joystick                   - Joystick
        kamera                     - Configure Kamera
        kcm_activities             - Activities help you to focus on a specific task
        kcm_baloofile              - Configure File Search
        kcm_desktoptheme           - Desktop Theme
        kcm_energyinfo             - Energy Consumption Statistics
        kcm_fileindexermonitor     - Monitor State of File Indexer
        kcm_kdeconnect             - Connect and sync your devices
        kcm_keyboard               - Keyboard Hardware and Layout
        kcm_kscreen                - Manage and configure monitors and displays
        kcm_lookandfeel            - Look And Feel
        kcm_memory                 - Memory information
        kcm_networkmanagement      - Edit your Network Connections
        kcm_pci                    - PCI information
        kcm_phonon                 - Phonon Audio and Video
        kcm_plasmasearch           - Configure Search
        kcm_plymouth               - Plymouth Splash Screen
        kcm_printer_manager        - Configure your printers
        kcm_pulseaudio             - Configure the Audio Volume
        kcm_sddm                   - Select Login Theme
        kcm_splashscreen           - Splash Screen Theme
        kcm_ssl                    - SSL Versions and Certificates
        kcm_systemd                - Configure the systemd daemon
        kcm_touchpad               - Touchpad settings
        kcmaccess                  - Accessibility Options
        kcmkded                    - Background Services
        kcmkwineffects             - Desktop Effects
        kcmlaunch                  - Application Launch Feedback
        kcmnotify                  - Event Notifications and Actions
        kcmsmserver                - Desktop Session Login and Logout
        kcmusb                     - USB devices attached to this computer
        kcmview1394                - Attached IEEE 1394 devices
        kde-gtk-config             - Widget Style of GNOME/GTK Applications
        keys                       - Global Keyboard Shortcuts
        kgamma                     - A monitor calibration tool
        khotkeys                   - Configure Input Actions settings
        kwalletconfig5             - KDE Wallet Configuration
        kwincompositing            - Compositor Settings for Desktop Effects
        kwindecoration             - Look and Feel of Window Titles
        kwinoptions                - Window Actions and Behavior
        kwinrules                  - Individual Window Behavior
        kwinscreenedges            - Active Screen Corners and Edges
        kwinscripts                - Manage KWin scripts
        kwintabbox                 - Navigation Through Windows
        kwintouchscreen            - Touch screen swipe gestures
        mouse                      - Mouse Controls
        netpref                    - Configure generic network preferences, like timeout values
        nic                        - Network interface information
        opengl                     - OpenGL information
        powerdevilactivitiesconfig - Per-Activity Power Management
        powerdevilglobalconfig     - Advanced Power Management Settings
        powerdevilprofilesconfig   - Energy Saving
        proxy                      - Configure the proxy servers used
        screenlocker               - Screen Locking Timeouts
        smb                        - Credentials used to access SMB shares
        smbstatus                  - Samba status monitor
        solid-actions              - Manage actions available to the user when connecting new devices
        spellchecking              - Spell Checker Dictionaries and Options
        standard_actions           - Standard Keyboard Shortcuts for Applications
        style                      - Widget Style and Behavior
        translations               - No description available
        user_manager               - Add, remove or edit system users
        useragent                  - Configure the User Agent exposed by the HTTP kioslave
        wayland                    - Information about the Wayland Compositor
        webshortcuts               - Configure web shortcuts
        workspaceoptions           - Workspace Behavior
        xserver                    - X-Server information
        [/FONT]
        Last edited by GreyGeek; Aug 15, 2017, 09:38 AM.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment

        Working...
        X