This forum has been archived. All content is frozen. Please use KDE Discuss instead.
Please use bugs.kde.org for bug reports or feature requests. Development related questions should be directed to the okular-devel mailing list.

Okuar filetype on terminal

Tags: kde, okular, bash, completion kde, okular, bash, completion kde, okular, bash, completion
(comma "," separated)
User avatar
JZA
Registered Member
Posts
12
Karma
0
OS

Okuar filetype on terminal  Topic is solved

Mon Mar 26, 2012 3:19 pm
hi I want to get okular to autocomplete/filter when I try to run okular filetypes from the terminal. I think is best to give you an example of what I want:

1) start terminal
2) type oku (press tab to autocomplete to okular)
3) start typing the file I want to open (cbt or comic book tar)
4) press tab and have terminal autocomplete the name of the file

So this works for files like PDF

$ cat mydoc.pdf
$ ok->[tab]-> okular mydo->[tab]-> mydocs.pdf ;-D

But doesnt work with cbt

$ cat mydoc.cbt
$ ok->[tab]-> okular mydo->[tab]-> NOTHING :-[


Alexandro Colorado
http://jza.me
User avatar
JZA
Registered Member
Posts
12
Karma
0
OS

Re: Okuar filetype on terminal

Mon Mar 26, 2012 3:32 pm
Ah some googling got me to solve this rather easy.

bash_completion had the filetypes declarations and the line declaration. The file is located in /etc/ and had the following line:
complete -f -X '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rzt]|CB[RZT]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb?(2)|FB?(2)|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular

Adding the t/T to the |cb[rzt]|CB[RZT] gave me the accesibility for these filetypes.

Win!!


Alexandro Colorado
http://jza.me
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Okuar filetype on terminal

Tue Mar 27, 2012 5:57 am
Did you need to add this auto completion yourself? If so, I would recommend posting this in the Tutorials & Tips section of the forum.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell