is there a scripted way to toggle between saved conky themes?[SOLVED]

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

Looking to make a desktop shortcut of a bash script to load a specific CM2 saved theme.
Last edited by Logansfury on Sat Mar 30, 2024 9:18 pm, edited 2 times in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
vimes666
Level 6
Level 6
Posts: 1259
Joined: Tue Jan 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved themes?

Post by vimes666 »

Those settings are kept in dconf and you can change them with gsettings.

For the gtk-theme:

Code: Select all

gsettings set org.cinnamon.desktop.interface gtk-theme 'Mint-Y-Dark-Purple'
For the icon-theme:

Code: Select all

gsettings set org.cinnamon.desktop.interface icon-theme 'Mint-Y-Legacy-Dark-Yellow'
By now you should be able to make something out of that :)

Btw: you can also set them through dconf-editor gui.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved themes?

Post by Logansfury »

vimes666 wrote: Sat Mar 30, 2024 6:41 pm Those settings are kept in dconf and you can change them with gsettings.

For the gtk-theme:

Code: Select all

gsettings set org.cinnamon.desktop.interface gtk-theme 'Mint-Y-Dark-Purple'
For the icon-theme:

Code: Select all

gsettings set org.cinnamon.desktop.interface icon-theme 'Mint-Y-Legacy-Dark-Yellow'
By now you should be able to make something out of that :)

Btw: you can also set them through dconf-editor gui.
Thank you for the reply, but this seems to be a way to change the computer theme, I am just looking to change from theme to theme of saved conky widgets being enabled/disabled.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
vimes666
Level 6
Level 6
Posts: 1259
Joined: Tue Jan 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved themes?

Post by vimes666 »

change from theme to theme of saved conky widgets
It would help if you mention that in your title.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved themes?

Post by Logansfury »

vimes666 wrote: Sat Mar 30, 2024 7:12 pm
change from theme to theme of saved conky widgets
It would help if you mention that in your title.
It is in the post body but I will add it to the title as well.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?

Post by Logansfury »

I'm partway there.

I found the following bash script works for individual widgets:

Code: Select all

#!/bin/bash

conky -c /home/logansfury/.conky/m3_clock/conkyrc
but the -c command errors if pointed at a .cmtheme file due to "unexpected symbol"

I guess with this I can brute force the script and just call each widget that makes up the theme individually with separate lines in the bash script.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?

Post by Logansfury »

No good. I tried setting up my widgets with a bash:

Code: Select all

#!/bin/bash

conky -c /home/logansfury/.config/conky/Mizar/Mizar\ no\ date.conf &
conky -c /home/logansfury/.conky/Bleys\ Calendar/3-month-conkyrc &
conky -c /home/logansfury/.conky/Bleys\ Weather\ Header/wea_header.conf &
conky -c /home/logansfury/.conky/Bleys\ Weather/transparent.conf &
conky -c /home/logansfury/.conky/Cal\ Info/conky.conf &
and because some of these widgets call on bash scripts themselves with ${exec} commands the script is erroring saying they aren't at expected file paths.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2906
Joined: Wed Oct 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved conky themes?

Post by zcot »

You're using conky-manager2 right?

take a look at file: ~/conky/conky-startup.sh -this is generated by the manager. You can get the idea of what a proper start script should be from that. go ahead and add a few, you will see, save it / close it and check that script lines.

So depending on your setup, and what you specifically mean by "toggle", you should be able to build a proper script to do the thing.

the error you are experiencing has to do with not starting in the correct config file directory when you run conky.

At any point on terminal you can check that command echo $PWD(print working directory) and that translates because programs that are run pay attention to that to see what context they are dealing with, so when you issue a relative path command it will be built from that point, that's why it is important.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?

Post by Logansfury »

zcot wrote: Sat Mar 30, 2024 8:27 pm You're using conky-manager2 right?

take a look at file: ~/conky/conky-startup.sh -this is generated by the manager. You can get the idea of what a proper start script should be from that. go ahead and add a few, you will see, save it / close it and check that script lines.

So depending on your setup, and what you specifically mean by "toggle", you should be able to build a proper script to do the thing.
Hello Zcot, how are you?

Yes, I have CM2. I will check out the file you suggested.

I have found that my primary Minimalis and a few additional clocks and calendars enabled allows my system to run normally. Unfortunately the secondary Minimalis I have on my 2nd monitor badly effects my computer and causes youtube videos to skip and pause to the point they are unwatchable.

My ultimate goal is to have a desktop shortcut that sets the lite configuration then launches my browser. I wish there was a way my system could detect my closing of all browser tabs and react to it by setting the full conky theme with everything enabled across the multiple monitors, but I suspect that isn't possbile.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?

Post by Logansfury »

Far out!!

That was perfect Zcot :)

I used the startup.sh as a template and I have a working script that launches everything I wan't running when I close the internet. I didn't get dizzy, pass out, or fall over. Not even ONCE. Gonna take this momentum and make a bash with the "lite" set of widgets enabled and a scripted launch of Chromium.

Thank you :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?

Post by Logansfury »

I am now set up with 2 working bash scripts. The script to set the "lite" widgets setting and launch Chromium browser is working fine, except that I can't seem to get it to recognize the command to close window if launched via terminal. Otherwise, I am going to assign a chromium icon to it and launch it from my desktop when I want to watch YouTube vids on my Linux Box.

Code: Select all

#!/bin/sh

if [ "$DESKTOP_SESSION" = "cinnamon" ]; then 
    killall conky
    chromium &
   cd "$HOME/.config/conky/Mizar"
   conky -c "$HOME/.config/conky/Mizar/Mizar no date.conf" &
   cd "$HOME/.conky/Bleys Calendar"
   conky -c "$HOME/.conky/Bleys Calendar/3-month-conkyrc" &
   cd "$HOME/.conky/Bleys Weather Header"
   conky -c "$HOME/.conky/Bleys Weather Header/wea_header.conf" &
   cd "$HOME/.conky/Bleys Weather"
   conky -c "$HOME/.conky/Bleys Weather/transparent.conf" &
   cd "$HOME/.conky/Cal Info"
   conky -c "$HOME/.conky/Cal Info/conky.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/CPU Panel.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/Fan Speeds 3M.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/hdd 3M.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/header large.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/memory.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/net icon 40.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/networkpc.conky" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/temperatures 3M.conf" &
   cd "$HOME/.conky/Minimalis Conky"
   conky -c "$HOME/.conky/Minimalis Conky/wired public IP.conf" &
   conky -c "$HOME/.conky/Server/conky.conf" &
   cd "$HOME/.conky/NowPlayingConky"
   conky -c "$HOME/.conky/NowPlayingConky/audacious.conf" &
   exit 
fi

exit
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

Things just took a positive turn!

I decided not to give up so quickly on my original desire for a way to auto-set my full array of minimalis widgets when browser was closed. I worked with online scripting resources, and was presented with this:

monitor_browser.sh

Code: Select all

#!/bin/bash

# Define the browser command used to start the browser
BROWSER_COMMAND="chromium"  # Change this to the command used for your browser

# Check if any browser processes are running
while pgrep -x "$BROWSER_COMMAND" > /dev/null; do
    sleep 1  # Check every second
done

# All browser windows are closed, trigger your action here
echo "All browser windows are closed"
IT FREAKIN' WORKS:

I had 2 chromium windows open, then launched this script, and upon close of the 2nd window the script reacted!

Code: Select all

logansfury@OptiPlex-5040:~$ cd Desktop
logansfury@OptiPlex-5040:~/Desktop$ chmod +x monitor_browser.sh
logansfury@OptiPlex-5040:~/Desktop$ ./monitor_browser.sh
All browser windows are closed
logansfury@OptiPlex-5040:~/Desktop
I am going to edit my set-lite-conky script to launch this bash as well, and add the necessary code to it to launch my full conky.

This is SO cool :D
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2906
Joined: Wed Oct 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by zcot »

good.

also, instead of using killall conky you could actually stop specific config(s) instead. One possibility although there are many, you could use the window title as the determining factor instead of parsing pid's or doing anything more complex.

own_window_class, and own_window_title are usable for something. :wink:

You can also profile each of these configs to see exactly where you are getting the overload, and fix that problem.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

zcot wrote: Sat Mar 30, 2024 11:23 pm good.

also, instead of using killall conky you could actually stop specific config(s) instead. One possibility although there are many, you could use the window title as the determining factor instead of parsing pid's or doing anything more complex.

own_window_class, and own_window_title are usable for something. :wink:

You can also profile each of these configs to see exactly where you are getting the overload, and fix that problem.
Is there any downside to using the killall conky? I had heeded your advice about splitting my minimalis into individual widgets and my monitor1 minimalis is 9 separate pieces. The single command seems less klunky than doing the nine individual closes. I am definitely happy to learn about the alternatives however!

Profiling each config sounds like the best idea but doing so may be beyond my current knowledge of how to drive conky. Koentje had done some work for me on one of my widgets to reduce load on my system, but I cannot figure out how to control it's colors or size, so it is stuck in monotone, not matching my dual-tone setup, and is a bit wider than the other 8 widgets so it doesn't fit within the boarders set by the other widgets.

I know my widget that calls upon radeontop for data has a 5 second delay, but I'm not sure if this delay causes unwanted load, and I am at this point unaware of any other way to duplicate the great data that radeontop makes available - most especially the data that drives the GPU graph I like so much.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2906
Joined: Wed Oct 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by zcot »

good job.

put up a config with only this in it for a simple example, this is one way, just look at the processing load without getting into too much detail. you can get further, deeper, more detailed, but it's not necessary when you see some obvious overload like this, it will be easy to spot.

run this, only, in a config. don't screw around with colors, fonts, anything, just use it for an analysis tool:

Code: Select all

WTH?: ${cpu cpu0}%
you run that, open conky manager, then click ONE other config and let it run through some cycles, take a look at this simple cpu load output.. now turn it off and move to the next one. you will see when the cpu load goes way out of order, and that's where you find a problem and start to fix it.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

zcot wrote: Sun Mar 31, 2024 11:37 pm good job.

put up a config with only this in it for a simple example, this is one way, just look at the processing load without getting into too much detail. you can get further, deeper, more detailed, but it's not necessary when you see some obvious overload like this, it will be easy to spot.

run this, only, in a config. don't screw around with colors, fonts, anything, just use it for an analysis tool:

Code: Select all

WTH?: ${cpu cpu0}%
you run that, open conky manager, then click ONE other config and let it run through some cycles, take a look at this simple cpu load output.. now turn it off and move to the next one. you will see when the cpu load goes way out of order, and that's where you find a problem and start to fix it.
Awesome! Thank you for the diagnostic conky, I'll start going thru my widgets with this :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

zcot wrote: Sun Mar 31, 2024 11:37 pm good job.

put up a config with only this in it for a simple example, this is one way, just look at the processing load without getting into too much detail. you can get further, deeper, more detailed, but it's not necessary when you see some obvious overload like this, it will be easy to spot.

run this, only, in a config. don't screw around with colors, fonts, anything, just use it for an analysis tool:

Code: Select all

WTH?: ${cpu cpu0}%
you run that, open conky manager, then click ONE other config and let it run through some cycles, take a look at this simple cpu load output.. now turn it off and move to the next one. you will see when the cpu load goes way out of order, and that's where you find a problem and start to fix it.
I made what I thought was the bare minimum for the script to run:

diagnostic.conf

Code: Select all

conky.config = {

	alignment = 'middle_middle',
    gap_x = 0,
    gap_y = 0,
};

conky.text = [[
WTH?: ${cpu cpu0}%
]];
I used the stop all running widgets button in CM2, then enabled diagnostic.config and then the first of my minimalis pieces. After about 3 mins I closed the minimalis down but I dont see anything on screen or any newly generated text docs in the .conky directory.

Have I missed a step?
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2906
Joined: Wed Oct 19, 2016 6:08 pm

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by zcot »

there is no generated text docs.

You just look at the thing in the middle of the screen where it's showing the cpu usage. you get an idea of what idle looks like before the afflicted conky is run, then you are looking at it while you run the possible afflicted config, then you see the cpu usage again after you stop the possible cpu-hog conky. it's really very simple and most basic. But with you mentioning the cpu running "idle" up around 80 or 90 percent it should be pretty clear that one or more of the single configs, with no other ones running, will show a big step in the cpu usage.
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

zcot wrote: Tue Apr 02, 2024 3:01 pm there is no generated text docs.

You just look at the thing in the middle of the screen where it's showing the cpu usage. you get an idea of what idle looks like before the afflicted conky is run, then you are looking at it while you run the possible afflicted config, then you see the cpu usage again after you stop the possible cpu-hog conky. it's really very simple and most basic. But with you mentioning the cpu running "idle" up around 80 or 90 percent it should be pretty clear that one or more of the single configs, with no other ones running, will show a big step in the cpu usage.
I wasn't getting any screen display so I added some window settings to the config and now I have the WTH? showing midscreen and tracking the widgets usage.

Code: Select all

conky.config = {

	alignment = 'middle_middle',
    gap_x = 0,
    gap_y = 0,

-- — Conky settings

	background = false,
	total_run_times = 0,
	no_buffers = true,	

-- — Window specifications with Background

	own_window = true,
	own_window_type = dock,
    own_window_hints = 'skip_taskbar,skip_pager,undecorated,below',
    own_window_transparent = false,
	own_window_argb_visual = true,
	own_window_argb_value = 0,
	own_window_colour = '000000', 

};

conky.text = [[
WTH?: ${cpu cpu0}%
]];

Going to begin going down the line of widgets now.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 7
Level 7
Posts: 1809
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: is there a scripted way to toggle between saved conky themes?[SOLVED]

Post by Logansfury »

There doesn't seem to be anything in my monitor 2 minimalis that is producing a particularly heavy load. I have all 6 of it's widgets, plus 4 simple icon displays running now and WTH?: is staying within 39%-43%. Individual widgets seem to run average 24%-29%. Nothing seems close to the dangerous 90% ranges.

I enabled everything and WTH?: increased to a 51%-53% range.

This would seem to be good news, but I still experience video lag on youtube with everything running.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”