DEV Community

Cover image for Solve: There is no Brightness button on my new keyboard ヽ( 〇 )ノ
Parth Agarwal
Parth Agarwal

Posted on • Updated on

Solve: There is no Brightness button on my new keyboard ヽ( 〇 )ノ

As the title says, I bought a new keyboard for my laptop, unfamiliar with world of keyboards, I went with the safest option, approved by many, the Logitech G213 Prodigy.

Much to my suprise, I was not able to control brightness with this new keyboard.

  • No function keys were mapped to brightness settings
  • There was no specific keys for that
  • Even G Hub software had no System Action for brightness

So, the dev inside me said, lets tackle it with software!


By the help of stack-overflow and powershell docs, I wrote a simple powershell script, to adjust my brightness...


.\brightness.ps1 <# No agrs will increase brightness (+10) #>
Enter fullscreen mode Exit fullscreen mode
.\brightness.ps1 desc <# desc as arg will decrease brightness (-10) #>
Enter fullscreen mode Exit fullscreen mode



Now I compiled this file to .exe, to replicate that,

  • First Install ps2exe module in powershell (as admin)
Install-Module ps2exe
Enter fullscreen mode Exit fullscreen mode
  • Simply use this module to convert ps1 to exe
Invoke-ps2exe .\brightness.ps1 .\brightness.exe -noConsole
Enter fullscreen mode Exit fullscreen mode



First I thought of using AutoHotKey, but i couldn't utilise any function key there. So, settled with G-Hub instead

Now, head over to G-Hub add this file as application, twice , one for +10 and other for -10, remember to add desc there and then change whatever Function keys you want map to brightness.

FYI: I used F6 key to change to G-shift mode. and F7 to increase brightness and F8 to decrease brightness in G-shift mode. No updation made in default mode.



Please comment, for any suggestion regarding this keyboard, or any wonderful hack you have in mind.

Top comments (5)

Collapse
 
dotnvo profile image
dotnVO

Pretty cool! I'll write a post related to tackling this that takes a slightly different approach. Good job:)

Collapse
 
ra101 profile image
Parth Agarwal

Great! Looking forward to it.

Collapse
 
hanoman profile image
Sanny Tan

could you please give help ?
PS C:\WINDOWS\system32> Invoke-PS2EXE .\brightness.ps1 .\brightness.exe -noConsole
Invoke-PS2EXE : The 'Invoke-PS2EXE' command was found in the module 'ps2exe', but the module could not be loaded. For more information, run 'Import-Module ps2exe'.
At line:1 char:1

  • Invoke-PS2EXE .\brightness.ps1 .\brightness.exe -noConsole + ~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (Invoke-PS2EXE:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Thread Thread
 
ra101 profile image
Parth Agarwal • Edited
  • Open powershell in admin mode
  • Install the module again
  • Change Directory to where the script is (I think this is the main problem)
  • Run that command again.
Collapse
 
adityavofficial profile image
ADITYA VERMA

Hey can you pls pls create a video tutorial for this on YouTube. Really need it