little productivity thing for linux that i would like: terminal integration of the XDG (?) "Recent" folder. make it an actual Folder ~/Recent with links to the files, or a FUSE fs. i often have to integrate console and desktop tools and this would make it less painful.
also would be nice to have a little more mouse interactivity integration in terminals. when i type `ls`, give me an icon next to each result that has a context menu or lets me drag that file handle to another app, or copy the path / open with. i.e. make a hybrid of file explorer and terminal.
a DE on linux could really embrace and amplify the fact that linux people have to use the terminal a lot. instead of trying to hide that and emulate windows or mac os, integrate this duality really well.
@mntmn You should look at midnight commander `mc`.
While not drag and drop, it is a more hybrid version of a file explorer and terminal. I have long thought of experimenting with a more modern take on the Norton Commander layout.
@mntmn And i have `xdg-open` aliased to `open`. Which is one of my most used shortcuts. Any file i want to touch graphically is just a `open image.jpg` away.
Also really handy is to do `open .` to open the current folder in your file manager.
@soupglasses ohhh yeah i used to do that a lot on mac os
@mntmn I have also created a `l` shortcut to print directories and pager print files for me.
I have also had the thought to create an `edit` shortcut that could open a wide variety of files for editing explicitly (nvim, gimp, audacity, etc). This however im uncertain if XDG can handle, and would require my own lookup table for mimetypes.
@soupglasses the latter is really interesting. i have a feeling that xdg mimetypes are constantly messed up. so a replacement that you can only set up explicitly/where explicit manual rules have priority would be nice.
@mntmn This is something i am personally angry at. Especially with regards to wine packaging.
I really do think one can easily solve a lot of xdg mimetype mismatches by packaging for usability, rather than packaging for what upstream gives you.
@soupglasses @mntmn ^this
> xdg-open opening up my .xml with wInE-eXpLoReR
@soupglasses omg yes
@soupglasses @mntmn
back in 2012 I looked into it and found some gtk clones of mc (I think one of them was called "sunflower"?) but none of them were as well polished in terms of keyboard navigation
@mntmn This exists. It is called Emacs.
(I will show myself out)
@algernon i am an emacs user. notmuch-emacs is my primary email client. but i'm not talking only about text. i work a lot with kicad, freecad, inkscape, gimp, libreoffice calc, video and audio players etc etc.
@mntmn As somebody who might start developing their own DE in the next couple years… would you mind telling me a bit more?
I read the rest of your thread and most of this would seem to be stuff that shells and terminals have to do, not the DE.
@mntmn A thing that I've personally been pondering for a long time is the addition of a new basic stream besides stdin, -out and -error to hold structured data that can be visualized while a program is running. Things from simple progress bars for cp to complex graphs could be done this way – but I kinda think I'd have to write a new OS from scratch for that… ^^;
@phryk hehe. If memory serves me right, yes, powershell has these structured streams in between processes.
@matzipan So, like more structured pipes? Nce, but I'm more interested in providing something the terminal can interpret and visualize.
@phryk well you can always represent structured information how ever you want if enough structure exists. The problem is that currently that structure doesn't exist in posix.
I remeber in the 2010s there was some webkit-based terminal solution which was aiming to do something like you are suggesting, but I could never remember or find it any more
@matzipan Yes, exactly – and I'd want something that is designed well enough to become a de-facto standard supported by most POSIX-y systems.
As for a webkit-based terminal… thanks, but no thanks. ^^;
@phryk the webkit part was an easy way to give interactivity in a small project. The important part was the rich terminal features.
@phryk oh I think I found it. https://github.com/unconed/TermKit
@matzipan Thanks!
@phryk also I'm guessing you know libsixel? https://github.com/saitoha/libsixel
@phryk given that Powershell runs on MacOS and Linux it might not be that unrealistic!
nushell could also be worth checking out. But it's again a structured stream thing so not exactly what you're looking for
@dngrs Huh, I actually was not aware of that. Is it straight-up FOSS? I mean I won't use it personally because MS, but code access would be nice for further research.
@phryk this repo at least is MIT licensed - the wording on PS 5.1 is a bit confusing but afaik that's just a legacy version
https://github.com/PowerShell/PowerShell
@mntmn Something like RStudio, but for Gnome. A GUI file manager with a terminal pane and a manual pane .
(Edit - typo)
@mntmn This reminded me of https://hisham.hm/userland/
That's something Dolphin actually does. Go to your recent files, open the integrated terminal and boom
@mntmn NB: you can open the terminal through the command palette: press CTRL + I and type "terminal"
@mntmn
i3 is a good place to start. Add a good terminal with context-integration on top of that (I use sakura) and it is a lovely place to work for developers, designers and admins.
@mntmn if linux people have to use terminal at all, their DE/distro has failed it's job. Regular user should never ever need to use terminal for anything.
(But as a heavy terminal user, I'd appreciate such Recent folder :)
@mntmn I really like the idea of introducing typical GUI/mouse interactivity with the terminal results.
It would architecturally require a fairly different implementation of the terminal and likely even a lot of the current POSIX compatible commands. But it would be really cool. Maybe enough with some special escape string to feed back non-ASCII data.
Props for the idea.
@mntmn oooh yes, +1000, I've been wishing for this for years... I think Hyper has a few bits and pieces that are close, but not really usable in the way I hoped for (https://github.com/vercel/hyper)
@mntmn There is an escape sequence that can include links (e.g.: file:///path/to/file) in terminals. A terminal could potentially allow a right click menu.
@mntmn Konsole has this kind of file integration (opens files on Ctrl + Click, context menu with more actions). IIRC it's not enabled by default though
@mntmn sounds like you want plan9
@6d03 i have tried plan9 a few times and it is not like this?
@mntmn not exactly, that's true. but it is, in the sense that all the text on screen is somehow interactive (and modifiable).
@mntmn There is an escape sequence to mark a region as a hyperlink. `ls --hyperlink=auto` emits it and VTE-based terminals (and surely others) can consume it. Ctrl+clicking any of the dotted-underlined filenames in this screenshot opens that file in the Graphviz viewer I have installed.
@wjt yep, i know, so maybe patching a context menu in there with some more options would be a low-hanging fruit
@mntmn Plan 9’s plumber gets bits of this (very cheaply). We don’t have this concept of Recents at all, but for example you can “plumb” any text in the terminal. So right-click on what e.g. ‘ls’ gives you to open the file in your editor. And the rules for where a file gets opened are explicit, in a (relatively) straight-forward config file, to your later point.
@mntmn The plumber really would be one of the easiest bits of Plan 9 for Unix folks to productively copy/adapt.
@mntmn Wonder if the way forward is more powerful configurability for `ls` (or `ls`-alternatives like exa/eza)? Imagine if it exposed a lua plugin interface, then writing powerful extensions like this would be a breeze. Probably just a pipe dream...
@mntmn Like this? https://yewtu.be/watch?v=T5Bpu4thVNo
I couldn't stop thinking about your idea, so I did some digging. The video is linked from the wiki of NGS (https://github.com/ngs-lang/ngs). The shell part is early days, but it looks very promising...
@mntmn So I couldn't let this go and I've just opened a PR on Eat (great package, give it a go if you haven't already). https://codeberg.org/akib/emacs-eat/pulls/147
Combined with the link-hint and Embark packages, you can click links, and (without the mouse) act on them in interesting ways, all inside the terminal. LInks are distinguished by the `eat-term-hyperlink' face.
Not perfect, but it's a start.
@mntmn While not what you are asking for, I have had this `add to recents` script on my system since forever.
Its been very helpful for when i generate screenshots, which was my primary use-case for it.
https://github.com/soupglasses/dotfiles/blob/main/configs/scripts/.scripts/recently_used.py
@soupglasses @mntmn I’d never thought of manually adding to the recent list—genius! Perfect for screenshots as you mention.
@mntmn your idea prompted me to look up how GNOMEs nautilus keeps track of recent files (a xml file). In a SO answer a user posted a nice little helper with xmlstarlet - https://unix.stackexchange.com/a/470934 - if you don't strip file:// gnome terminal will give you context click.
In a "Show HN" a dev showed his terminal/mouse interaction ideas called "hucksh", comments were interesting too - https://news.ycombinator.com/item?id=38720369 - the notion links showed how it works.
@mntmn uh, this is helpful:
```
function rfiles() {
xmlstarlet sel -t -m '/xbel/bookmark[starts-with(@href, "file://")]' -v '@href' -n ${XDG_DATA_HOME:-~/.local/share}/recently-used.xbel | tac | head -n32
}
```
@wupatz cool, thanks!
@mntmn you can see the files with `gio list recent:// -ld` so there should be some way to get gvfs-fused to mount them.