It is currently March 28th, 2024, 10:44 pm

DisplayFusion Command Line Tool

Skins that control functions in Windows or Rainmeter
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

DisplayFusion Command Line Tool

Post by StArL0rd84 »

Did you know?
You can control DisplayFusion with the built in command line tool!
DisplayFusion makes managing your multiple monitors easy.
When you intall DisplayFusion it also installs the command line tool automatically.

Here is my take on a Rainmeter implementation.

preview.png
There are many more commands,
but these are the seven most prevalent ones in my opinion.

Changelog 1.2 - 3/22/19
  • Skin now checks if the program is installed and provides a link if it's not.
You do not have the required permissions to view the files attached to this post.
Last edited by StArL0rd84 on March 22nd, 2019, 7:34 pm, edited 5 times in total.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DisplayFusion Command Line Tool

Post by balala »

Your skin requires DisplayFusion to be installed.
Probably many users don't have it. A link in the skin to the download site would be useful, for those who don't have the app installed. The skin should have to check if the app is installed (can be done!) and act accordingly: if it is already installed, it should show the existing strings, to can interact with the app, otherwise it should show a single link, to open the site where (the free version) of the app can be downloaded.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: DisplayFusion Command Line Tool

Post by StArL0rd84 »

balala wrote: โ†‘March 21st, 2019, 8:09 pmThe skin should have to check if the app is installed (can be done!)
How can i make it do that?
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DisplayFusion Command Line Tool

Post by balala »

StArL0rd84 wrote: โ†‘March 21st, 2019, 8:55 pm How can i make it do that?
You have to find a registry key which was created when you've installed the app. A very good candidate to be checked (however, since I don't have installed the app, I can't check if I'm right) is the following: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\. Here you should have to have a DisplayFusion (or something similary) key and within this key you should have to check an entry. Which one, depends, probably an InstallLocation would be good, if it exists. Anyway if you find a good entry, you should have to put the skin to verify if that entry does exist. If it does, the app is installed, otherwise it isn't.
As I said, I don't have installed the app, so can't say more specifically about it. But if you're interested, I can, about another app which I have installed and can even post an example. I suppose you are interested, right? If you are, let me know and tomorrow I'll post the sample code (sorry, but here is almost midnight and I won't continue working right now).
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: DisplayFusion Command Line Tool

Post by StArL0rd84 »

balala wrote: โ†‘March 21st, 2019, 9:15 pm You have to find a registry key which was created when you've installed the app. A very good candidate to be checked (however, since I don't have installed the app, I can't check if I'm right) is the following: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\. Here you should have to have a DisplayFusion (or something similary) key and within this key you should have to check an entry. Which one, depends, probably an InstallLocation would be good, if it exists. Anyway if you find a good entry, you should have to put the skin to verify if that entry does exist. If it does, the app is installed, otherwise it isn't.
As I said, I don't have installed the app, so can't say more specifically about it. But if you're interested, I can, about another app which I have installed and can even post an example. I suppose you are interested, right? If you are, let me know and tomorrow I'll post the sample code (sorry, but here is almost midnight and I won't continue working right now).
I am interested. Almost midnight here too ๐Ÿ˜” But I'll try and find the registry key tomorrow after work. I'll let you know if I get in trouble. Thank you
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DisplayFusion Command Line Tool

Post by balala »

StArL0rd84 wrote: โ†‘March 21st, 2019, 9:22 pm I am interested. Almost midnight here too ๐Ÿ˜” But I'll try and find the registry key tomorrow after work. I'll let you know if I get in trouble. Thank you
Ok, good luck. Many times it's not easy, but nor impossible is. I succeeded almost every time I tried.
User avatar
dudebaker
Posts: 55
Joined: July 17th, 2016, 4:42 pm
Location: Austria

Re: DisplayFusion Command Line Tool

Post by dudebaker »

Sadly the registry Uninstall-Folder doesn't contain a DisplayFusion entry.
But something like this should work...

Code: Select all

[MeasureCheckDisplayFusion]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Binary Fortress Software\DisplayFusion
RegValue=VersionSettings
IfCondition=MeasureCheckDisplayFusion = 0
IfTrueAction=[!SetOption MeterString1 Hidden "1"][!SetOption MeterString2 Hidden "1"]...[!SetOption MeterDownloadLink Hidden "0"][!Redraw]
UpdateDivider=-1
Last edited by balala on March 22nd, 2019, 4:40 pm, edited 1 time in total.
Reason: Please use <code> tags, whenever are you posting code snippets. It's the </> button.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: DisplayFusion Command Line Tool

Post by StArL0rd84 »

dudebaker wrote: โ†‘March 22nd, 2019, 1:35 pm Sadly the registry Uninstall-Folder doesn't contain a DisplayFusion entry.
But something like this should work...

[MeasureCheckDisplayFusion]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Binary Fortress Software\DisplayFusion
RegValue=VersionSettings
IfCondition=MeasureCheckDisplayFusion = 0
IfTrueAction=[!SetOption MeterString1 Hidden "1"][!SetOption MeterString2 Hidden "1"]...[!SetOption MeterDownloadLink Hidden "0"][!Redraw]
UpdateDivider=-1
Thank you that works.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DisplayFusion Command Line Tool

Post by balala »

dudebaker wrote: โ†‘March 22nd, 2019, 1:35 pm

Code: Select all

IfTrueAction=[!SetOption MeterString1 Hidden "1"][!SetOption MeterString2 Hidden "1"]...[!SetOption MeterDownloadLink Hidden "0"][!Redraw]
Although this definitely works, instead of setting the Hidden option of a meter to 1 or 0 when I want to hide / show it, I'd use the !HideMeter / !ShowMeter bang. For example I'd replace the above IfTrueAction option with the following one: IfTrueAction=[!HideMeter "MeterString1"][!HideMeter "MeterString2"]...[!ShowMeter "MeterDownloadLink"][!Redraw].
Again: setting the Hidden option to whatever value with some !SetOption bangs completely works and there is no problem with it, but using the !HideMeter / !ShowMeter bangs seems much more logical.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: DisplayFusion Command Line Tool

Post by StArL0rd84 »

balala wrote: โ†‘March 22nd, 2019, 4:47 pm Although this definitely works, instead of setting the Hidden option of a meter to 1 or 0 when I want to hide / show it, I'd use the !HideMeter / !ShowMeter bang. For example I'd replace the above IfTrueAction option with the following one: IfTrueAction=[!HideMeter "MeterString1"][!HideMeter "MeterString2"]...[!ShowMeter "MeterDownloadLink"][!Redraw].
Again: setting the Hidden option to whatever value with some !SetOption bangs completely works and there is no problem with it, but using the !HideMeter / !ShowMeter bangs seems much more logical.
Yep, caught that too.
Many better ways to do it, but ok for example.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))