XED - Change Default "Save to" location to Desktop [solved]

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
AZgl1500
Level 9
Level 9
Posts: 2742
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

XED - Change Default "Save to" location to Desktop [solved]

Post by AZgl1500 » Mon Sep 24, 2018 6:41 pm

about a year ago, I thought I had got this fixed, but somewhere along the way, an update?
something, reverted the Default path back to /home and that is just not acceptable at all.

I need it to be the Desktop so that I can get immediate access to the file I save, edit it, put it where it belongs, or delete it.... which is what happens to 90% of the little files I make.

so, where is the config file for XED?

I have looked in /etc and can't find anything referencing 'xed'
Last edited by AZgl1500 on Mon Sep 24, 2018 8:56 pm, edited 1 time in total.

gm10
Level 12
Level 12
Posts: 4125
Joined: Thu Jun 21, 2018 5:11 pm

Re: XED - Change Default "Save to" location to Desktop

Post by gm10 » Mon Sep 24, 2018 7:23 pm

I don't think there is, but you can just edit the launcher and change the command line to this:

Code: Select all

sh -c "cd /home/user/Desktop; xed %U"
(adjust the path to point to your desktop)

User avatar
AZgl1500
Level 9
Level 9
Posts: 2742
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: XED - Change Default "Save to" location to Desktop

Post by AZgl1500 » Mon Sep 24, 2018 8:56 pm

gm10 wrote:
Mon Sep 24, 2018 7:23 pm
I don't think there is, but you can just edit the launcher and change the command line to this:

Code: Select all

sh -c "cd /home/user/Desktop; xed %U"
(adjust the path to point to your desktop)
Okay,
I added that to Custom Keyboard Shortcuts and it does indeed make it default to my desktop.
thanks for that hint.

added that to my Notebook. but, had to drop the %U from the command line, that forces it to save to a filename of "%U"

just deleting that from the end of the line, leaves it with a highlight "unknown document" as the name, and I can simply start typing and it takes the new typed name, which is exactly like I had it before.

thanks.

gm10
Level 12
Level 12
Posts: 4125
Joined: Thu Jun 21, 2018 5:11 pm

Re: XED - Change Default "Save to" location to Desktop

Post by gm10 » Tue Sep 25, 2018 2:15 am

AZgl1500 wrote:
Mon Sep 24, 2018 8:56 pm
added that to my Notebook. but, had to drop the %U from the command line, that forces it to save to a filename of "%U"

just deleting that from the end of the line, leaves it with a highlight "unknown document" as the name, and I can simply start typing and it takes the new typed name, which is exactly like I had it before.
My bad, should have thought of that. You cannot use field codes within quotes, they won't get interpreted. While this won't matter for you since you've only added this to a keyboard shortcut (and it would never have worked for that, anyway), for the benefit of anybody actually wanting to modify the launcher in the menu as I had suggested, they should leave the launcher alone (i.e. keep the xed %U command line) and run this instead to create a script that will set the default folder for you no matter how you launch xed (including through a keyboard shortcut):

Code: Select all

mkdir -p ~/.local/bin
echo -e '#!/bin/sh\ncd $HOME/Desktop/\n/usr/bin/xed $@' > ~/.local/bin/xed
chmod u+x ~/.local/bin/xed
edit: Turns out the script above was way too simple to cover all use cases. Run this in afterwards (copy & paste as a whole)

Code: Select all

tee ~/.local/bin/xed <<'EOB'
#!/bin/bash
CWD=$PWD/
cd $HOME/Desktop/
case "$1" in
  ['/']*|'admin://'* ) CWD="";;
esac
/usr/bin/xed "$CWD$@"
EOB
Last edited by gm10 on Sat Oct 06, 2018 8:55 am, edited 1 time in total.

User avatar
AZgl1500
Level 9
Level 9
Posts: 2742
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: XED - Change Default "Save to" location to Desktop

Post by AZgl1500 » Tue Sep 25, 2018 5:10 am

gm10 wrote:
Tue Sep 25, 2018 2:15 am
AZgl1500 wrote:
Mon Sep 24, 2018 8:56 pm
added that to my Notebook. but, had to drop the %U from the command line, that forces it to save to a filename of "%U"

just deleting that from the end of the line, leaves it with a highlight "unknown document" as the name, and I can simply start typing and it takes the new typed name, which is exactly like I had it before.
My bad, should have thought of that. You cannot use field codes within quotes, they won't get interpreted. While this won't matter for you since you've only added this to a keyboard shortcut (and it would never have worked for that, anyway), for the benefit of anybody actually wanting to modify the launcher in the menu as I had suggested, they should leave the launcher alone (i.e. keep the xed %U command line) and run this instead to create a script that will set the default folder for you no matter how you launch xed (including through a keyboard shortcut):

Code: Select all

mkdir -p ~/.local/bin
echo -e '#!/bin/sh\ncd $HOME/Desktop/\n/usr/bin/xed $@' > ~/.local/bin/xed
chmod u+x ~/.local/bin/xed
THAT FIXED IT RIGHT!!!

Image

to prove it, used Menu select Text Editor
and then immediately selected File Save As and noted that it does indeed now default to Desktop

Thank you so much for staying with me on this gm10

gm10
Level 12
Level 12
Posts: 4125
Joined: Thu Jun 21, 2018 5:11 pm

Re: XED - Change Default "Save to" location to Desktop

Post by gm10 » Tue Sep 25, 2018 5:19 am

AZgl1500 wrote:
Tue Sep 25, 2018 5:10 am
Thank you so much for staying with me on this gm10
You're welcome. Was just cleaning up after myself. ;)

Post Reply

Return to “Software & Applications”