Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filebrowser:ranger not working #87

Open
neelchakrabrty opened this issue Jul 17, 2019 · 3 comments
Open

filebrowser:ranger not working #87

neelchakrabrty opened this issue Jul 17, 2019 · 3 comments
Labels

Comments

@neelchakrabrty
Copy link

No terminal programs working , I want my file browser to be ranger , but it doesn't open ranger , I want my default fileoopener to me vim , but it doesn't work

@anuvc
Copy link

anuvc commented Jul 18, 2019

ranger and vim are terminal programs, so they won't open if they are not opened through a terminal.
By default, dmenu_extended uses xdg-open to open correct application with corresponding filetype. You can set your own defaults for xdg-open by using xdg-mime, but that setting would apply for all your GUI apps.

So for ranger you have two options here:

  1. For system-wide setting:
  • change the xdg-mime default by opening /usr/share/applications/ranger.desktop and editing the Exec entry to the following
    Exec=urxvt -e ranger

  • Then set ranger as your default file browser using
    xdg-mime default ranger.desktop inode/directory

  1. For dmenu_extended only
  • In dmenuExtended_preferences.txt, change the filebrowser entry to the following
    "filebrowser": "urxvt -e ranger",

(change urxvt to your own terminal emulator)

For vim, you could do something similar to the first, however the second option won't work, as for files too, dmenu_extended uses xdg-open, but assuming there are different file types in your system, everything would be opened in vim, which I don't think is the way you want it to behave, maybe @MarkHedleyJones could shed some light on that.

@MarkHedleyJones
Copy link
Owner

@anubhabckbty Nice response!
@stallonen Yes, for vim to open your text-files you could think about setting gVim as your default text editor. For a no-gui setup I would look into what @anubhabckbty suggested as the system-wide solution but with vim.

I'm not sure what your system is but on Ubuntu I have a .desktop file for vim:

[Desktop Entry]
Name=Vim
GenericName=Text Editor
GenericName[de]=Texteditor
Comment=Edit text files
Comment[af]=Redigeer tekslêers
Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ
Comment[ar]=ﺡﺭّﺭ ﻢﻠﻓﺎﺗ ﻦﺼﻳﺓ
Comment[az]=Mətn fayllarını redaktə edin
Comment[be]=Рэдагаваньне тэкставых файлаў
Comment[bg]=Редактиране на текстови файлове
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
Comment[bs]=Izmijeni tekstualne datoteke
Comment[ca]=Edita fitxers de text
Comment[cs]=Úprava textových souborů
Comment[cy]=Golygu ffeiliau testun
Comment[da]=Redigér tekstfiler
Comment[de]=Textdateien bearbeiten
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ﻭیﺭﺍیﺵ پﺭﻮﻧﺪﻫ<200c>ﻫﺍی ﻢﺘﻧی
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Édite des fichiers texte
Comment[ga]=Eagar comhad Téacs
Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો
Comment[he]=ערוך קבצי טקסט
Comment[hi]=पाठ फ़ाइलें संपादित करें
Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[it]=Modifica file di testo
Comment[ja]=テキストファイルを編集します
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
Comment[ko]=텍스트 파일을 편집합니다
Comment[lt]=Redaguoti tekstines bylas
Comment[lv]=Rediģēt teksta failus
Comment[mk]=Уреди текстуални фајлови
Comment[ml]=വാചക രചനകള് തിരുത്തുക
Comment[mn]=Текст файл боловсруулах
Comment[mr]=गद्य फाइल संपादित करा
Comment[ms]=Edit fail teks
Comment[nb]=Rediger tekstfiler
Comment[ne]=पाठ फाइललाई संशोधन गर्नुहोस्
Comment[nl]=Tekstbestanden bewerken
Comment[nn]=Rediger tekstfiler
Comment[no]=Rediger tekstfiler
Comment[or]=ପାଠ୍ଯ ଫାଇଲଗୁଡ଼ିକୁ ସମ୍ପାଦନ କରନ୍ତୁ
Comment[pa]=ਪਾਠ ਫਾਇਲਾਂ ਸੰਪਾਦਨ
Comment[pl]=Edytor plików tekstowych
Comment[pt]=Editar ficheiros de texto
Comment[pt_BR]=Edite arquivos de texto
Comment[ro]=Editare fişiere text
Comment[ru]=Редактор текстовых файлов
Comment[sk]=Úprava textových súborov
Comment[sl]=Urejanje datotek z besedili
Comment[sq]=Përpuno files teksti
Comment[sr]=Измени текстуалне датотеке
Comment[sr@Latn]=Izmeni tekstualne datoteke
Comment[sv]=Redigera textfiler
Comment[ta]=உரை கோப்புகளை தொகுக்கவும்
Comment[th]=แก้ไขแฟ้มข้อความ
Comment[tk]=Metin faýllary editle
Comment[tr]=Metin dosyalarını düzenle
Comment[uk]=Редактор текстових файлів
Comment[vi]=Soạn thảo tập tin văn bản
Comment[wa]=Asspougnî des fitchîs tecses
Comment[zh_CN]=编辑文本文件
Comment[zh_TW]=編輯文字檔
TryExec=vim
Exec=vim %F
Terminal=true
Type=Application
Icon=gvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

So for me it's as simple as right-cliking on a text file, -> Properties -> Open With, and setting the Default Application to Vim.
After that, any text file I open using dmenu-extended (or by any means for that matter) is opened using the terminal version of vim.

Hopefully that helps you.

@jsilve24
Copy link

For those who want to make ranger the default I think there is a small issue with @anubhabckbty answer.

Personally I found you needed to pass the -x flag instead of the -e flag. so the option should look like:

"filebrowser": "urxvt -x ranger",

where urxvt is your terminal emulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants