abarbarian Posted June 5 Share Posted June 5 If you can survive their creation. Me new keyboard has rgb customisable for every key. This means that you can make different profiles for various programs. So I want several profiles and I want the keyboard to have a particular profile set when I boot the pc. Then automatically change when I open a particular program. Shouldn't be too difficult should it. I will be using openRGB for the light changes. Research on the net told me there were two ways to have openRGB start at boot. One involved creating a desktop file and the other was to create a systemd service file. Both were not very clear in instructions and gave various ways to do it. Also either method seemed to have difficulty in opening openRGB with the correct profile. There was a lot of reading to do and it left me baffled and unsure as to what to do. Then I remembered that good old Window Maker had a autostart function. After a quick read I placed this line in the autostart file and whoopeee it worked like a charm. Quote openrgb -p home.orp & So that was the first hurdle. Onwards. I wanted a particular set of lights for a game running through steam. An I wanted to have the light set on the keyboard and have steam open with one click. After loads of reading and trying out many combinations and test runs I finally achieved my goal. It took some time and once again loads of confusing research.Trouble is most of the basic bash script guides are concerned with echo's and printing or adding stuff. One script was my aim but no matter how many variations I tested I could not get steam and openRGB+particular profile to play nice in one script. So I settled on two scripts and one to open steam and one to open openRGB with the right profile, I ended up with , Quote #!/bin/bash steam=/bin/steam steam ; #Steam-rgb.sh Quote #!/bin/bash xterm -e openrgb -p wasd.orp #rgb-Steam.sh Along with a third script that would fire up the other two scripts together. Quote !#/bin/bash ./rgb-Steam.sh ./Steam-rgb.sh #rgb2.sh Steam does not seem to come with an icon that I can dock in my Window Maker so I had to follow my own guide on how to make a dockable icon from the Window Maker thread here at Scot's. Now all I had to do was set up the icon to launch the rgb2 script. After trying quite a few ways to launch rgb2 I was on the point of giving up for the day but I had a light bulb moment and thought all I need is an alias. Might be all I needed and seems pretty easy to accomplish. Took me quite some time and loads of test runs but I ended up with, Quote alias steam="sh rgb2.sh" So now I have a keyboard with rgb lights that give me my chosen profile when I boot the pc. Along with a steam icon on my dock which with one click changes the lights on my keyboard so it is set up for a particular game I am playing at the moment and opens steam. 1 Quote Link to comment Share on other sites More sharing options...
securitybreach Posted June 5 Share Posted June 5 Very cool Quote Link to comment Share on other sites More sharing options...
abarbarian Posted June 6 Author Share Posted June 6 12 hours ago, abarbarian said: Along with a third script that would fire up the other two scripts together. Quote !#/bin/bash ./rgb-Steam.sh ./Steam-rgb.sh #rgb2.sh Ha spot the rookie mistake. Should read Quote #!/bin/bash and it seems I do not need " ./ " to be included in the script. Well it seems that my icon creation has hit a bump in the road. I have set up two alias's for openRGB. Quote alias steam="sh rgb2.sh" alias home="/bin/openrgb -p home.orp" Both work when launched from a terminal. The idea was to use them with the created icon as you can have a left click or middle click action to launch items from icons in Window Maker.So the idea was to have left click to launch steam and change the keyboard and when steam closed use the middle click to reset the key board lights to my daily setting. However clicking the icon only launches steam but does not change the keyboard lights and the middle click does nothing. I have tried several different command combinations ,none worked fully. More research is needed, trouble is with Window Maker there are not many folk to ask for help. It seems that you can not run an alias from the icon. I did after more trial and error figure out that this will work for the left click on the icon Quote xterm -e rgb2.sh and this will work for the middle click, Quote xterm -e openrgb -p home.orp Also I have noticed that the keyboard lights will change from my commands but they revert to a multi coloured set after a period of time(this is the factory preset).It seems I have to set up a systemd or server thingy. Blimey more research. I am sure that there is a more elegant way to accomplish my aims. Still I have managed after a fair amount of research and trial and error to set up my system to suit me. Which after all is why I chose to run a penguin pc. One thing this adventure has taught me is how complicated an operating system or software is and my respect for the folk who develop open source increases as I learn more. Now that I have an almost finished project I think I will just make a click with the mouse and change my keyboard lights and open steam and play my game. 2 Quote Link to comment Share on other sites More sharing options...
raymac46 Posted June 6 Share Posted June 6 This is a very interesting thread. Thanks for posting it. Quote Link to comment Share on other sites More sharing options...
abarbarian Posted June 6 Author Share Posted June 6 4 hours ago, raymac46 said: This is a very interesting thread. Thanks for posting it. Nice to know that someone is getting some value from my ramblings. I think of scripts as just being bigger alias's. For my needs I don't require anything too complicated but it is nice to play around with them. In the winter I may look into trying to create a script to split and rename long audio drama files which is a pain to do manually. Plenty of guides about bash scripts out there hardest thing is finding a guide that is relevant to your needs. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.