in your bashrc command you can add following function,

openit() {

    FILE=$1
    if [ $(file $FILE | grep -q "OpenDocument Text"; echo $?) -eq 0 ]; then
oowriter $FILE; fi

}



After adding this to your bashrc , re-launch the terminal,

If you have an .odt file, then you can do this

$ cd Desktop
$ openit MyData.odt

This openit command will open the MyData.odt file into openoffice writer,

We can together modify this command so that openit command can open any
document or media file,

Example, media files can be opened with vlc, image files can be opened with
someviewer, pdf files can be opened with okular automatically. text file
with gedit and so on..

you can see the syntax of openit command and using this you can reply back
somemore similar lines (pdf, mp4, txt etc)



-- 
┌─────────────────────────┐
│    Narendra Sisodiya
│    http://narendrasisodiya.com
└─────────────────────────┘

-- 
LUG@IITD - http://lug-iitd.org/Footer

Reply via email to