LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-26-2021, 02:10 AM   #1
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Plasma5 automatic theme switcher


Hi,

If my memories are good, this option exists under gnome
And I wanted a similar one under KDE :
Be able to change themes according to the hours of the day

I made a slackbuild
It uses the wonderful daemon thanks to ZhaoLin & raforg

feedbacks are welcome

https://github.com/maravtdm/lookandfeel
 
Old 04-26-2021, 03:02 AM   #2
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by marav View Post
Hi,

If my memories are good, this option exists under gnome
And I wanted a similar one under KDE :
Be able to change themes according to the hours of the day

I made a slackbuild
It uses the wonderful daemon thanks to ZhaoLin & raforg

feedbacks are welcome

https://github.com/maravtdm/lookandfeel
Congratulation for you project and for practical demonstrating also that this daemon supervisor is of general purpose, for any "user target" daemons we will want eventually to handle.

And also looks like you understand properly what those "user target" daemons are, up to to creating your own ones.

Regarding your 5 minutes sleep from script, I believe that's a not so fortunate idea...

As well, you can split this sleep time in seconds sized pieces, making your script much more responsive.

Like this
Code:
COUNT=300

while [ "$NOW" -lt "2359" ] ; do
  if [ "$COUNT" -lt "300" ] ; then
    COUNT=$((COUNT+1))
    sleep 1
    continue;
  fi
  COUNT=0

  ...
done
Giving to the $COUNT a big value from start permits an initial execution of the loop, then it will do nothing (for 300 seconds / 5 minutes) other than processing the loop with sleeping 1 second each time.

Last edited by LuckyCyborg; 04-26-2021 at 03:09 AM.
 
1 members found this post helpful.
Old 04-26-2021, 03:10 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107
I wish you would stop mentioning in every post the systemd concept "user target". We do not have systemd and I'd like to keep the terminology out of the distro.
 
Old 04-26-2021, 03:21 AM   #4
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Original Poster
Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Quote:
Originally Posted by LuckyCyborg View Post

Regarding your 5 minutes sleep from script, I believe that's a not so fortunate idea...

As well, you can split this sleep time in seconds sized pieces, making your script much more responsive.
Thank you very much for your feeback

I will try your suggestion ;-)
 
Old 04-26-2021, 03:23 AM   #5
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by Alien Bob View Post
I wish you would stop mentioning in every post the systemd concept "user target". We do not have systemd and I'd like to keep the terminology out of the distro.
Okay, but how we should name this kind of programs like the one made by OP, which is designed to run in background and to be started on user login (for every user reaching the graphics desktop), then being stopped on user logout?

In fact, someone can just add an unit file and package it for openSUSE as well. Or Kubuntu.

Honestly, I believe we should be proud that we are The First non-systemd distribution having a consistent way to handle this kind of programs.

Last edited by LuckyCyborg; 04-26-2021 at 03:33 AM.
 
Old 04-26-2021, 03:43 AM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107
Quote:
Originally Posted by LuckyCyborg View Post
Okay, but how we should name this kind of programs like the one made by OP, which is designed to run in background and to be started on user login (for every user reaching the graphics desktop), then being stopped on user logout?
In desktop land that's just called session management. Nothing new or magical. Has worked for 10s of years without requiring systemd.

The fact is that pipewire is badly written so that it only works properly with systemd... and a separate daemon application had to be found for Slackware to make pipewire work with regular graphical session management.
 
2 members found this post helpful.
Old 04-26-2021, 03:59 AM   #7
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,071

Rep: Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305Reputation: 1305
With all respect, I do not think that this kind of programs is connected with the graphical session management only.

For example, I use this daemon supervisor to manage a VPN client, with a command put on ~/.profile and another on a XDG autostart file, then no matter if I login on Plasma5 from SDDM or in the Linux console, the VPN is automatically started and in logout it's automatically stopped.

How about to name them just "user daemons" or "user services" if the "user target daemons" naming is questionable?

Last edited by ZhaoLin1457; 04-26-2021 at 04:38 AM.
 
2 members found this post helpful.
Old 04-26-2021, 04:27 AM   #8
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Original Poster
Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Sorry to cut you
But, while it's not uninteresting, I don't think the thread's topic is: how to name this user daemon
 
2 members found this post helpful.
Old 04-26-2021, 05:03 AM   #9
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by marav View Post
Sorry to cut you
But, while it's not uninteresting, I don't think the thread's topic is: how to name this user daemon
Speaking of your user daemon, looks like you forgot to add the initial value of the $COUNT - proposed patch bellow.
Code:
diff -urN lookandfeel.orig/lookandfeel lookandfeel/lookandfeel
--- lookandfeel.orig/lookandfeel	2021-04-26 13:00:20.860031653 +0300
+++ lookandfeel/lookandfeel	2021-04-26 13:00:51.333031733 +0300
@@ -9,6 +9,8 @@
   . /etc/lookandfeel.conf
 fi
 
+COUNT=300
+
 while [ "$NOW" -lt "2359" ] ; do
   if [ "$COUNT" -lt "300" ] ; then
     COUNT=$((COUNT+1))
 
Old 04-26-2021, 05:12 AM   #10
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Original Poster
Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Quote:
Originally Posted by LuckyCyborg View Post
Speaking of your user daemon, looks like you forgot to add the initial value of the $COUNT - proposed patch bellow.
Code:
diff -urN lookandfeel.orig/lookandfeel lookandfeel/lookandfeel
--- lookandfeel.orig/lookandfeel	2021-04-26 13:00:20.860031653 +0300
+++ lookandfeel/lookandfeel	2021-04-26 13:00:51.333031733 +0300
@@ -9,6 +9,8 @@
   . /etc/lookandfeel.conf
 fi
 
+COUNT=300
+
 while [ "$NOW" -lt "2359" ] ; do
   if [ "$COUNT" -lt "300" ] ; then
     COUNT=$((COUNT+1))

Oups ...

EDIT : fixed. thanks again

Last edited by marav; 04-26-2021 at 05:29 AM.
 
Old 04-26-2021, 05:37 AM   #11
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by marav View Post
Oups ...

EDIT : fixed. thanks again
No problem.

And now you can probably delete also this text from your README.md
Code:
NB: because of the "sleep 5m" in the while loop
It needs ~5min. to exit the loop on logout
In fact, now it needs ~1sec. to exit the loop on logout.

Last edited by LuckyCyborg; 04-26-2021 at 05:39 AM.
 
Old 04-26-2021, 05:43 AM   #12
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Original Poster
Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Thumbs up

Quote:
Originally Posted by LuckyCyborg View Post
No problem.

And now you can probably delete also this text from your README.md
Code:
NB: because of the "sleep 5m" in the while loop
It needs ~5min. to exit the loop on logout
In fact, now it needs ~1sec. to exit the loop on logout.
Thx again again
 
Old 04-26-2021, 05:55 AM   #13
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by marav View Post
Thx again again
No problem.

BTW, WHY you ship that file README when you have README.md too?
 
Old 04-26-2021, 06:00 AM   #14
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,467

Original Poster
Rep: Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226Reputation: 4226
Quote:
Originally Posted by LuckyCyborg View Post
No problem.

BTW, WHY you ship that file README when you have README.md too?
because I had checked the box "create the readme.md" at the initialization of the repo
and I also have the file README in the directory I uploaded
I didn't pay attention to that
I'll clean up later

Last edited by marav; 04-26-2021 at 06:02 AM.
 
Old 04-26-2021, 06:06 AM   #15
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,630

Rep: Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516Reputation: 3516
Quote:
Originally Posted by marav View Post
because I had checked the box "create the readme.md" at the initialization of the repo
and I also have the file README in the directory I uploaded
I didn't pay attention to that
I'll clean up later
For a GIT repo like yours, I suggest you to keep the README.md
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The October Plasma5 prefers {systemd-,e}logind against ConsoleKit2, so SBo's skypeforlinux will broke the shutdown/reboot feature of Plasma5 LuckyCyborg Slackware 19 10-21-2019 09:49 AM
LXer: Atolm GTK Theme + Clarity Icon Theme = Perfect for Dark Theme Fans LXer Syndicated Linux News 0 02-26-2011 11:50 PM
openoffice force default theme / no theme | dark theme fix H_TeXMeX_H LinuxQuestions.org Member Success Stories 1 03-08-2010 12:56 PM
what's the best/coolest Gtk theme switcher ? frenchn00b Linux - General 1 04-04-2008 10:56 AM
random gdm theme switcher -- help me make it work bluefire Linux - General 2 06-06-2004 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration