Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-02-05 12:57:52

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

firefox .session files

is there a way to make xfce open firefox saved sessions (.session) with firefox but still open .txt files with gedit? I can set .session files to open with firefox but then all text files also open in firefox

Offline

#2 2015-02-05 22:19:00

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: firefox .session files

you first need to create a new mime type eg:

su -c "nano /usr/share/mime/packages/ffxsessionfile.xml"

with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
   <mime-type type="application/x-firefoxsession">
     <comment>Firefox Session </comment>
     <magic priority="50">
       <match value="search-string" type="string" offset="10:140"/>
     </magic>
     <glob pattern="*.session"/>
   </mime-type>
</mime-info>

save and update the mime database:

su -c "update-mime-database /usr/share/mime"

launch xfce4-mime-settings> search for firefoxsession and select your prefered application

Last edited by sixsixfive (2015-02-05 22:47:07)

Offline

#3 2015-02-06 13:26:16

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: firefox .session files

I get this error every time and am for sure using the correct password

cmcanulty@ubuntu1:~$ su -c "nano /usr/share/mime/packages/ffxsessionfile.xml"
Password:
su: Authentication failure

Offline

#4 2015-02-06 13:34:16

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: firefox .session files

cmcanulty wrote:

cmcanulty@ubuntu1:~$ su -c "nano /usr/share/mime/packages/ffxsessionfile.xml"
Password:
su: Authentication failure

if your distribution uses sudo(and you haven't set up a root password yet) you need to change the command eg

sudo nano /usr/share/mime/packages/ffxsessionfile.xml

Offline

#5 2015-02-06 15:03:17

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: firefox .session files

still errors but different error

cmcanulty@ubuntu1:~$ sudo -c "nano /usr/share/mime/packages/ffxsessionfile.xml"
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
cmcanulty@ubuntu1:~$

Offline

#6 2015-02-06 15:38:39

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: firefox .session files

you dont need the "-c" or the quotation marks - its only necessary if you use su

PS: just in case: nano is a simple texteditor you could also use mousepad, leafpad etc. to create the mimetype

Offline

#7 2015-02-07 12:58:46

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: firefox .session files

another error now

cmcanulty@ubuntu1:~$ sudo gedit /usr/share/mime/packages/ffxsessionfile.xml
[sudo] password for cmcanulty:

(gedit:4373): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

(gedit:4373): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

Offline

#8 2015-02-08 07:55:19

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: firefox .session files

hehe, gedit is probably the only editor that won't work wink

Offline

#9 2015-02-08 13:14:59

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: firefox .session files

maybe I should give up, more errors

cmcanulty@ubuntu1:~$ sudo  -c "nano /usr/share/mime/packages/ffxsessionfile.xml"
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
cmcanulty@ubuntu1:~$

Offline

#10 2015-02-08 17:00:28

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: firefox .session files

sixsixfive wrote:

you dont need the "-c" or the quotation marks - its only necessary if you use su

Offline

Board footer

Powered by FluxBB