SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2015-04-19 17:20:52

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Thunar - Create New File

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

Be excellent to each other!

#2 2015-04-19 18:31:22

woodape
#! CrunchBanger
From: Cape Town, South Africa
Registered: 2014-03-27
Posts: 113

Re: Thunar - Create New File

Isn't there specifically an option in Thunar to create an empty file? Right click in Thunar -> Create Document -> Empty File

Offline

#3 2015-04-19 19:54:38

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

^ There is. smile  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

#4 2015-04-20 20:32:11

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Thunar - Create New File

Aim was to use keyboard only, not mouse.

@pvsage please produce evidence, not just hypothesis, I did research this wink

If there is a better way, I am all ears smile but this is the simplest I could come up with, without using the mouse.

Offline

#5 2015-04-20 23:55:16

Kuno
#! Die Hard
From: Osnabrück - DE
Registered: 2009-01-09
Posts: 674

Re: Thunar - Create New File

sudo apt-get install pcmanfm

Offline

#6 2015-04-21 00:14:40

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: Thunar - Create New File

@Kuno

When did it get custom actions? That was always one of the good things about thunar compared to others.

Offline

#7 2015-04-21 00:27:04

Kuno
#! Die Hard
From: Osnabrück - DE
Registered: 2009-01-09
Posts: 674

Re: Thunar - Create New File

Offline

#8 2015-04-21 00:39:10

tknomanzr
#! Die Hard
From: Heavener, OK
Registered: 2014-12-09
Posts: 777

Re: Thunar - Create New File

Offline

#9 2015-04-21 07:35:33

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

Offline

#10 2015-04-21 07:38:36

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

@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

#11 2015-04-21 09:15:29

Kuno
#! Die Hard
From: Osnabrück - DE
Registered: 2009-01-09
Posts: 674

Re: Thunar - Create New File

Offline

#12 2015-04-21 09:51:48

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

^ 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

#13 2015-04-21 12:47:08

Kuno
#! Die Hard
From: Osnabrück - DE
Registered: 2009-01-09
Posts: 674

Re: Thunar - Create New File

Offline

#14 2015-04-21 17:06:33

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

^ 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

#15 2015-04-21 17:19:11

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Thunar - Create New File

Thanks pvsage for the background smile

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 wink )

Offline

#16 2015-04-21 18:40:45

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Thunar - Create New File

Offline

#17 2015-04-21 18:43:54

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Thunar - Create New File

Offline

#18 2015-04-22 05:37:19

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,865

Re: Thunar - Create New File

AHHHHHH a giant NO, ma eyes, ma po eyes !

Sorry for 3 off topic's in a row Joe. smile

Offline

#19 2015-04-22 08:18:50

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Thunar - Create New File

Offline

Board footer

Powered by FluxBB

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

Debian Logo