Bug 490148 - WISH: Allow to define a standard-folder other than /home
Summary: WISH: Allow to define a standard-folder other than /home
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-12 06:36 UTC by Michael
Modified: 2024-07-19 07:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2024-07-12 06:36:13 UTC
SUMMARY
Starting a fresh document in KATE, saving stores it in /home/myname. After discussion https://discuss.kde.org/t/633 , I propose to add an option in 
Settings > KATE Settings > Open and save files
where user can define their standard location for new stuf, in my case f.e. /mnt/Data.
Comment 1 Waqar Ahmed 2024-07-12 07:00:31 UTC
Somehow I don't see this option getting added to Kate.

What you can try is:
- Open a file in your desired folder /mnt/Data
- Create a new file and save it -----> Save dialog will show the path of last selected file which should be /mnt/Data
Comment 2 Michael 2024-07-12 09:28:43 UTC
Thank you!
(In reply to Waqar Ahmed from comment #1)
> What you can try is: ...
This works, but only for the actual session. If I start KATE from scratch and write some  text, saving again offers /home/myname ...
Comment 3 Lassi Väätämöinen 2024-07-17 18:32:06 UTC
(In reply to Waqar Ahmed from comment #1)
> Somehow I don't see this option getting added to Kate.

I don't see a point in adding configuration clutter. But how about a commandline option? So, if a user wants to set a default saving URL, that would be set via some command line flag.

(Or maybe just if a directory is given as a startup URL: 'kate /mnt/myDir/' and the type is checked to be a directory, use that as a default save location for files.)

I'd be in favor of the first option. Say, 
'kate -d /mnt/myDir/'
Comment 4 Michael 2024-07-18 06:01:35 UTC
Thank you. What does the option -d
'kate -d /mnt/myDir/'
mean? '$ man kate' does not offer this value.
And: Please keep in mind, that I would like to define the starting folder for new files, which  - in my case -  
is always /mnt/Data and never /home/myname.
But new files may be stored in /mnt/Data/Private or /mnt/Data/Job or ...
Comment 5 Lassi Väätämöinen 2024-07-18 06:13:43 UTC
(In reply to Michael from comment #4)
>What does the option -d
> 'kate -d /mnt/myDir/'
> mean? '$ man kate' does not offer this value.

No it does not, please note I am replying Waqar's comment. This is a wishlist item and I am just proposing solutions.
Comment 6 Lassi Väätämöinen 2024-07-18 06:26:04 UTC
(In reply to Michael from comment #4)
> And: Please keep in mind, that I would like to define the starting folder
> for new files, which  - in my case -  
> is always /mnt/Data and never /home/myname.
> But new files may be stored in /mnt/Data/Private or /mnt/Data/Job or ...

Well, my proposal would mean that you could start Kate with 'kate -d /mnt/Data' and when you save files, it would always start offering at /mnt/Data.

Of course you then need to go to a proper subdirectory yourself.

And then you could define a Kate desktop launcher that launches 'kate -d /mnt/Data' to get you there by default.
Comment 7 Waqar Ahmed 2024-07-19 07:03:48 UTC
> kate -d /mnt/Data

Set the working directory beforehand just:

cd /mnt/Data && kate

That will do what you want.
Comment 8 Lassi Väätämöinen 2024-07-19 07:17:14 UTC
(In reply to Waqar Ahmed from comment #7)
> cd /mnt/Data && kate

Right, that's even easier. So just put that to the Kate launhcer desktop item, or create a new launcher.