leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.29k stars 41 forks source link

Default pdf viewer #271

Closed x61 closed 4 months ago

x61 commented 4 months ago

How do I set sioyek as my default pdf viewer? Each time I open a pdf file, zathura is opened. I noticed that zathura is among the applications called for viewing pdf files in mimlist.clifm file so I stripped everything off to only have sioyek but it still opens in pdf files in zathura. X:.*/pdf$=sioyek I exited clifm and came back in but the change did not take effect. Is this the right file to make this change? How do I get the change to take effect?

On a separate note, how do I unassign ll that toggles long view? I want to define a different command for long view and a separate command for horizontal view. Is that possible?

Thank you

leo-arch commented 4 months ago

Hi @x61.

The rules for reading the mimelist file are quite simple:

  1. It's read top to bottom and left to right (the first existing application in the first matching rule will be used).
  2. Applications are checked for existence. If an app does not exist, it is skipped.

According to the above

In case of need, take a look at the documentation for Lira (our resource opener).

I want to define a different command for long view and a separate command for horizontal view. Is that possible?

Yes it is. Using aliases (much like you do in bash and other shells) you can reassign commands however you like. For example, to use lv instead of ll to toggle long view, and reassing ll to some other command, edit the config file (F10) and add these lines;

alias lv='ll'
alias ll='CMD'
x61 commented 4 months ago

Thank you very much for the prompt response. I moved the line up but still no effect so i ended up uninstalling zathura and it opened successfully in sioyek. Does clifm reload automatically after making changes in mimelist or do we have to close and reopen clifm for it to take effect.

Also, if I alias lv='ll', does that not still toggle long view each time lv command is executed? How would I get non-long view mode if I were to assign a key for that? I understand that ll toggles but I just want to assign a key for long view and a separate key for horizontal view. In other words, can I have the following?: alias lv=long-view and alias hv=horizontal-view

leo-arch commented 4 months ago

You're welcome.

Does clifm reload automatically after making changes in mimelist

Yes, it does.

I just want to assign a key for long view and a separate key for horizontal view

There's a single command (ll) to toggle long-view on/off (also the Alt-l keybinding). However, you can still have something like this:

alias lv='ll on'
alias hv='ll off'

Btw, lv is by default another name for the ll command. Check ll --help.

x61 commented 4 months ago

Perfect. Thanks again