This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[IDEA] Local/User units scripts

Tags: None
(comma "," separated)
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS

[IDEA] Local/User units scripts

Sun Apr 12, 2020 10:07 am
Hello,

I use to play too much with my Linux, finding myself in the need of reinstalling it once in a while (ok, maybe a little bit more often than "once in a while"). Of course I have my "home" in a different disk so all my personal data is safe as well as my own scripts and the likes. But every time I need to re-install the software, Skrooge among it. And something I really find annoying is the fact that I have my "per user" configuration files (/home/jesusm/.skrooge; /home/jesusm/.config/skroogerc; /home/jesusm/.local/share/skrooge) but the scripts used to download units exchange rates are global (/usr/share/skrooge), so I need to re-link my personal scripts. Some time ago I didn't realize this and I lost the scripts needing to rewrite them, now I have them in my personal folder, and I simply create a link in the global folder, but I wonder if it wouldn't be better that Skrooge could use global scripts AND personal scripts, reading them also from /home/<user>/.local/share/skrooge for example).

What do you think?

(now you will tell me that this is already possible and I am a moron that didn't know how :< )

thanks!
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 10:15 am
Well, I do not tell you that you are a moron, but it really is possible to use systemd-user-scripts. Just use the same commands as usual with the flag --user

Code: Select all
systemctl --user edit --full --force myNewUnit.service  # will create a new, empty service automatically saved to your homefolder
systemctl --user enable --now myNewUnit  # will start it and mark it as "autostart"
systemctl --user status myNewUnit  # will shot the stati
…  # and so on

On arch these things are saved in e.g. ~/.local/share/systemd/user/
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 10:24 am
Hi,

First of all, thanks for the answer and the idea.

Now, on one hand, Slackware is not using systemd and I have been using Slackware for almost 25 years and for the time being I will stick with it (sort of a masochistic? maybe ;D )

And on the other hand, this solution is not actually integrated with Skrooge, I would need still a way to use whatever the myNewUnit.service generates into Skrooge, so the initial need stands.

Thanks.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 11:17 am
I didn't know you are systemd-free. Most systems use it these days, so I didn't even think about not using it :)

As I do not know enough about skrooge, I do not know what is needed systemd-wide. The configuration itself is handled by KSharedConfig which uses the local stuff automatically. Which settings have to be global set?
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 11:25 am
In the UNITS module, you can see a series of scripts to automatically download the exchange rates. Then you can configure each unit (currency, quotes, etc.) to use the script you want to. And that configuration is per user, so no problem on it, after reinstalling Skrooge my units are still there using the script I set to use.

BUT ... the scripts itself are located by default under "/usr/share/skrooge", but I am using some of my personal scripts. Yes, I can share those scripts and I know Stéphane includes them in the Skrooge distribution if they are well written and globally interesting, but I have a couple with a very limited audience and also I know that the source changes quite often, so I need to adapt them once in a while. So, to the point, these scripts are not included in the global Skrooge distribution, so when I install a fresh copy Skrooge tries to download units values using a script (because the configuration is right) that doesn't exist, unless I copy (link) them again in the global folder.

Not sure if I made it clearer or not o)
User avatar
smankowski
Moderator
Posts
1047
Karma
7
OS
Hi,

Your personal scripts can be put in ~/.local/share/skrooge/quotes.
They will be found be skrooge.

When you download a new source from KNHS, they are downloaded in this local directory.


Skrooge, a personal finances manager powered by KDE
Image - PayPal
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 12:58 pm
smankowski wrote:Hi,

Your personal scripts can be put in ~/.local/share/skrooge/quotes.
They will be found be skrooge.

When you download a new source from KNHS, they are downloaded in this local directory.


how could I identify that I needed to create "/usr/share/skrooge/quotes/" and didn't think on "~/.local/share/skrooge/quotes"? :<

At least you were polite and didn't repeat my adjective :D

Thanks!
User avatar
smankowski
Moderator
Posts
1047
Karma
7
OS

Re: [IDEA] Local/User units scripts

Sun Apr 12, 2020 1:09 pm
JesusM wrote:
smankowski wrote:Hi,

Your personal scripts can be put in ~/.local/share/skrooge/quotes.
They will be found be skrooge.

When you download a new source from KNHS, they are downloaded in this local directory.


how could I identify that I needed to create "/usr/share/skrooge/quotes/" and didn't think on "~/.local/share/skrooge/quotes"? :<

When you enter a new source name in skrooge, a text file is created in this directory and you default text editor is launched.
So, you can see it in your text editor.
JesusM wrote:
At least you were polite and didn't repeat my adjective :D

Thanks!


Skrooge, a personal finances manager powered by KDE
Image - PayPal


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]