Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-05-17 21:08:04

va9iff
Member
From: Baku
Registered: 2024-04-23
Posts: 17

run command from Thunar's location bar

Windows file explorer can run commands from location bar (the place where the path to the current folder is written in and can be changed to go to the different path)

I usually type the starting of the name of the folder, hit enter to go open it, then inside, I hit ctrl + L to give focus to the location bar, then I can write `cmd .` or `code .` to run a command easily

the only closer thing I can think of in Thunar was to bind a key binding for opening terminal in the current folder (which can behave not in the expected way since argument can either take the folder, or the highlighted folder in that folder if we have a selection). to run a simple command, I have to open a terminal and close it and even worse if it has to keep terminal open, I have to have it as a window.

then how to identify whether it's a command or path question appears. well just like in the run interface, use a match or prefix. I mean, can a path start with a `>` anyways?

so yeah. one thing I miss from windows is being able to run commands from file explorer. maybe it's `.` like `~` being not expanded in keyboard commands as well but anyways,

I want to write a command with ctrl + L in Thunar's location/path bar and expect it to be run

Last edited by va9iff (2024-05-17 21:08:32)

Offline

#2 2024-05-17 21:32:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,402

Re: run command from Thunar's location bar

What version of thunar are you running. It works for me if I type in, for example:

/usr/bin/xfce4-terminal

...and press enter in the location widget. It seems I need to type in the full path to the executable into the location bar for it to execute.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-05-17 22:23:28

va9iff
Member
From: Baku
Registered: 2024-04-23
Posts: 17

Re: run command from Thunar's location bar

that's actually not a big problem for me. I always have a drop-down terminal. the reason that I cared about running it from Thunar is to pass the current open folder as argument. I can write this to anywhere from verve command to instant xfce dropdown terminal (I really like it) so "being able to run a command" isn't why I want to run it from Thunar's location. I want to run it from there so I can have that `pwd` or somehow make use of where I am in Thunar.

Last edited by va9iff (2024-05-17 22:23:56)

Offline

#4 2024-05-18 01:23:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,402

Re: run command from Thunar's location bar

In that case you will need to create an enhancement request for it.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-05-19 09:07:56

chang-zhao
Member
Registered: 2023-11-20
Posts: 41

Re: run command from Thunar's location bar

va9iff wrote:

that's actually not a big problem for me. I always have a drop-down terminal. the reason that I cared about running it from Thunar is to pass the current open folder as argument. I can write this to anywhere from verve command to instant xfce dropdown terminal (I really like it) so "being able to run a command" isn't why I want to run it from Thunar's location. I want to run it from there so I can have that `pwd` or somehow make use of where I am in Thunar.

There's no need to request it as a Thunar feature because the functionality is already there.

Create a Custom Action in Thunar:

Name:
Terminal here

Command:

exo-open --working-directory %f --launch TerminalEmulator

Icon:
org.xfce.terminal

Put it in the Thunar's Toolbar for instant access.


Likewise,
you can create a "root terminal" action:

Name:
Root terminal here

Command

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xfce4-terminal --default-working-directory=%f

Icon:
utilities-terminal

Last edited by chang-zhao (2024-05-19 09:10:22)

Offline

#6 2024-05-22 13:46:48

va9iff
Member
From: Baku
Registered: 2024-04-23
Posts: 17

Re: run command from Thunar's location bar

chang-zhao wrote:

There's no need to request it as a Thunar feature because the functionality is already there.

I know, that's what I'm doing right now. I have a shortcut to open a terminal in the current directory, which still requires to have a terminal window and requires me to close this after I run the command. 
now you're thinking "if you just run it and close it, why not create a key binding for that" and you'd be right. I have key binding for terminal, ide, text editor or similar frequent things. but sometimes I don't want to have a key binidng. for example, to create an http server on a folder, I don't want to block a key binding for that nor have it so simple to launch. I want to type out the exact command such as `live-serever .` but this exapmle doesn't make lot of sense since I wouldn't be able to close it easily when launched this way haha. but I think you get the point. sometimes you don't want it to be reachable from key binding but neither want to have a terminal window. a better example would be opening some app from cli that requires the terminal to stay open. then I just close the window of that app, and the process is ended as well (which has started from thunar's location bar command).

I see why you didn't see the difference, and yes it's kinda subtle, but I think it now makes sense to you

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 545.7 KiB (Peak: 546.55 KiB) ]