You are not logged in.
Pages: 1
No shortcut for this in Thunar, but using xdotool you can have one:
1. Make a script, paste in the following save and make executable:
#!/bin/bash
## creates new file when thunar is active window
sleep 1
xdotool getactivewindow key alt+f d e
Create a new application shortcut, pointing to your new script file and with the key combination you prefer ( I used CTRL+SHFT+F)
Now when thunar is your active window and you need to create a new empty file, just hit the shortcut.
I found I had to put a 1 second delay in otherwise the script didn't seem to catch.
Last edited by Joe90 (2015-04-19 17:21:28)
Offline
Isn't there specifically an option in Thunar to create an empty file? Right click in Thunar -> Create Document -> Empty File
Offline
^ There is. I'd expect the code for it is something simple, like `read n; touch .\"$n"` wrapped in a dialog. To paraphrase William of Ockham, "Don't make things any more complicated than they have to be."
Offline
Aim was to use keyboard only, not mouse.
@pvsage please produce evidence, not just hypothesis, I did research this
If there is a better way, I am all ears but this is the simplest I could come up with, without using the mouse.
Offline
If there is a better way, I am all ears
sudo apt-get install pcmanfm
Then:
Crtl+Alt+N
Really... I don't understand, why (a great percentage of) everybody insists on using thunar, when pcmanfm has tabs, dual pane view, custom actions, no probs mounting external drives, etc.. pp.
I just don't understand. Maybe i'm dumb 8.(
Offline
@Kuno
When did it get custom actions? That was always one of the good things about thunar compared to others.
BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator
Offline
@Kuno
When did it get custom actions? That was always one of the good things about thunar compared to others.
Right-click/Open with
Offline
@Kuno
When did it get custom actions? That was always one of the good things about thunar compared to others.
libfm-modules - file management support (loadable modules for library)
enables a bunch of extra stuff for pcmanfm as far as I can tell. For instance, right click --> Create New gives me folder, script and text files as options. Also, right click will give you your default handler for media files. Very useful for mpv as it makes the command line optional for it.
The only minor annoyance that I know of is when I open as root, it still defaults to user-level home instead of /root. However, it just occurred to me that I can fix that in Openbox's menu by passing it /root, so not really a biggy.
Of course, it goes without saying the auto-mounting magic is entirely dependent on properly configured policykit configs.
Offline
Aim was to use keyboard only, not mouse.
@pvsage please produce evidence, not just hypothesis, I did research this
If there is a better way, I am all ears
but this is the simplest I could come up with, without using the mouse.
Don't know enough about the source code to know what method Thunar uses to create the empty file. (Apparently there was once a problem in Thunar with the option to create an empty document not being available; I've found a thread about that on these forums dated January 2012.)
Using keyboard only: In open Thunar window, press and release the Menu key to bring up Thunar's right-click context menu. Select Create Document -- Empty File. Type in name. Thunar automatically selects the newly created file and reports a size of 0 bytes. Total of four keystrokes (menu, down, down, right), not including the name of the file.
Anyway, all of this is beside the point. Your method works for you, and after you get it set up, it takes a couple fewer keystrokes, so that makes it more convenient if creating empty documents in the file manager is a frequent and natural part of your workflow.
Offline
@Kuno: Is there a way to open PCManFM's context menu without using the mouse? In many applications, a press-and-release of the menu key does this, but it doesn't seem to work in PCManFM, and I can't find an equivalent.
Offline
@Kuno: Is there a way to open PCManFM's context menu without using the mouse? In many applications, a press-and-release of the menu key does this, but it doesn't seem to work in PCManFM, and I can't find an equivalent.
That's strange, because for me the menu key works fine that way.
BTW: a sample file for custom actions can be found here: https://madebits.github.io/#r/linux-pcmanfm-actions.md
Offline
^ If a file or directory within the PCManFM window is selected, then the context menu pops up with the menu key. If nothing is selected, the menu key does nothing. (This is with PCManFM in Jessie. Can't remember if you mentioned you're sticking with Waldorf for now? Older PCManFM may be better behaved.)
Offline
^ If a file or directory within the PCManFM window is selected, then the context menu pops up with the menu key. If nothing is selected, the menu key does nothing. (This is with PCManFM in Jessie. Can't remember if you mentioned you're sticking with Waldorf for now? Older PCManFM may be better behaved.)
Confirmed - nothing selected, nothing happening. PCManFM in Sid, which is where i switched to 6 months ago.
Offline
^ Good - sidebar resolved.
Back to my backpedal: Linux is about choice. If the default options don't work for you, there are always other ways. Basically, what Joe90 did is make an xdotool macro to simulate the keystrokes that activate Thunar's File menu and `touch` a new document from there. I never would have thought of anything like that! (Well, I would have back when I was using Mac System 7, but that was literally half a lifetime ago.)
Offline
Thanks pvsage for the background
I posted the tip as thunar is the default file manager in #! (or whatever!)
Yes, it only saves me a single key, but fits with the new folder shortcut.
Didn't know pcmanfm had come on so much, but have just got so used to my thunar setup and custom actions, and especially rename (for which I have not found anything better either- here we go again )
Offline
Of course, it goes without saying the auto-mounting magic is entirely dependent on properly configured policykit configs.
PCManFM automounts OOTB in Debian Jessie LXDE.
Offline
Linux is about choice.
(With sincere apologies to Joe90 for 2 off-topic posts in a row)
Offline
AHHHHHH a giant NO, ma eyes, ma po eyes !
Sorry for 3 off topic's in a row Joe.
Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.
Vll ! = ( Viva la gnu/Linux !) Vl#!! = ( Viva la #! !) Last but not least, UD ... OD ! = ( Use Debian ... or die !)
Offline
Poor, poor Adam Jackson. Seven years later and we're still saying "Linux is about choice"...with the tacit understanding on practically every side of the conversation that by "Linux" we mean "GNU/Linux distros", though it also allows people like Adam to choose to ignore such obvious implications.
...and with that, I think I should really say:
/sidebar (read the "/" as "end of")
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat