You are not logged in.

#21 2018-03-13 22:06:02

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: Using command-line text-editors as bl-text-editor

martix wrote:

Why is it good if Editor and Visual are different tools?

Traditionally EDITOR is used for simple files where only quick changes are needed (ed is supreme at this once you're familiar with it) but VISUAL is for coding and suchlike where more extensive editing is required.

Last edited by Head_on_a_Stick (2018-03-13 22:10:33)

Offline

#22 2018-03-14 10:55:59

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Using command-line text-editors as bl-text-editor

^I see, good to know about it (it's history too).

Just for the record: I tried the .profile method, but it looks like ranger does not bother about it, nor about the alternatives system. This method works though.

Offline

#23 2018-03-15 03:18:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,558
Website

Re: Using command-line text-editors as bl-text-editor

martix wrote:

I tried the .profile method, but it looks like ranger does not bother about it...

LightDM ignores ~/.profile. If you want to set environment variables in an X session use ~/.xsessionrc


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#24 2020-05-04 01:40:04

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,558
Website

Re: Using command-line text-editors as bl-text-editor

Head_on_a_Stick wrote:
johnraff wrote:

Either we write a small man page, or symlink it to 'man editor'.

I think we should symlink to editor(1)

More than 3 years late, but that symlink just went in the code and the next upgrade of bunsen-configs (next week?) should make 'man bl-cli-editor' bring up the man page for whatever is set as 'editor' (probably nano or vim).

Tidying up man pages everywhere right now.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#25 2020-06-11 21:08:49

christopherisnow
Member
Registered: 2018-05-19
Posts: 57

Re: Using command-line text-editors as bl-text-editor

What is the solution to use a CLI editor (e.g. nvim) in place of Geany on Lithium -- haven't the relevant files changed somewhat from previous versions of BL?

I would also be curious to change my default file browser to ranger. I suppose this is analogous.

Would love to (1) leave kb shortcuts as they are, and (2) have different default terminal window sizes for different apps. Currently x-terminal-emulator opens at a 1/4-screen size with `Ctl+t` but I would prefer for nvim and ranger to be full-screen.

Bonus points if terminals running nvim or ranger would show up in the tint2 panel with their own icon and/or current file path, so I could distinguish them from all the other random open terminals!

Thanks in advance.

Last edited by christopherisnow (2020-06-11 21:12:49)

Offline

#26 2020-06-11 21:18:47

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Using command-line text-editors as bl-text-editor

christopherisnow wrote:

What is the solution to use a CLI editor (e.g. nvim) in place of Geany on Lithium -- haven't the relevant files changed somewhat from previous versions of BL?

I would also be curious to change my default file browser to ranger. I suppose this is analogous.

Menu > System > Edit Debian Alternatives > bl-text-editor

Would love to (1) leave kb shortcuts as they are, and (2) have different default terminal window sizes for different apps. Currently x-terminal-emulator opens at a 1/4-screen size with `Ctl+t` but I would prefer for nvim and ranger to be full-screen.

Thanks in advance.

Edit bl-rc.xml and add new "Applications" sections for the applications you want to behave differently. openbox.org/wiki/Help:Applications

Menu > Help & Resources > Openbox


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#27 2020-06-12 04:15:47

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,558
Website

Re: Using command-line text-editors as bl-text-editor

damo wrote:
christopherisnow wrote:

What is the solution to use a CLI editor (e.g. nvim) in place of Geany on Lithium -- haven't the relevant files changed somewhat from previous versions of BL?

I would also be curious to change my default file browser to ranger. I suppose this is analogous.

Menu > System > Edit Debian Alternatives > bl-text-editor

To expand slightly, set bl-text-editor to /usr/bin/bl-cli-editor
This makes calls to bl-text-editor open a terminal with your choice of the Debian alternative "editor".
By default, on BL that's /bin/nano but in the same "Edit Debian Alternatives" you can set "editor" to vim.tiny or anything else you choose to install.

There's no equivalent mechanism for a cli file manager like ranger to be used as bl-file-manager, unfortunately, although if you looked at how bl-cli-editor works, maybe you could roll your own. If you do, please post it back here, and we'll incorporate it in BL Beryllium!

Last edited by johnraff (2020-06-12 04:17:24)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#28 2020-06-12 23:10:07

christopherisnow
Member
Registered: 2018-05-19
Posts: 57

Re: Using command-line text-editors as bl-text-editor

Thanks both, I will give it a spin and report back.

It should probably be within my limited coding capacities to write a simple bash script to get ranger going. Stay tuned...

Offline

#29 2020-06-16 15:55:07

christopherisnow
Member
Registered: 2018-05-19
Posts: 57

Re: Using command-line text-editors as bl-text-editor

Opening ranger instead of Thunar with the usual Super+f is as easy as changing the relevant line in .xbindkeysrc to

"x-terminal-emulator -e ranger"
    Mod4 + f

I also wrote a bash script ~/bin/launch_ranger based on /usr/bin/bl-cli-editor:

#!/bin/bash

x-terminal-emulator -T "${1##*/} - CLI File Manager" -e ranger "$@"

and made it executable with chmod +x.

However, it doesn't work when I call it from .xbindkeys (same line as above) or when manually added to the Debian Alternatives and selected as "bl-file-manager". 

What am I missing?

TBH I don't know how badly I need to have ranger installed system-wide as bl-file-manager. Is there any other advantage other than being able to open files with ranger in GUI apps?. Just having the keyboard shortcut is already great. Maybe being able to open ranger in a different sized terminal window via Openbox would also be nice but not essential.

On the other hand I'm kinda curious to finish this miniproject for it's own sake!

Offline

#30 2020-06-16 17:10:38

christopherisnow
Member
Registered: 2018-05-19
Posts: 57

Re: Using command-line text-editors as bl-text-editor

Well, maybe I spoke too soon. After rebooting, the Super+f, +e, and all keybindings listed below 

"x-terminal-emulator -e ranger"
    Mod4 + f

in .xbindkeys are not working. What's goin on?

Offline

#31 2020-06-16 21:24:10

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Using command-line text-editors as bl-text-editor

christopherisnow wrote:

...
in .xbindkeys are not working. What's goin on?

man xbindkeys

Perhaps you can run it manually and see any error messages (after killing it first).


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB