Change OpenRGB profile on unlock

I have a computer, which my son uses primarly for gaming. I also use it for gaming, when it is available (as of right now, when he has gone to bed). The computer is pimped out with RGB. I got tired of Asus Armoury Crate every now and then maxing the CPU causing the fans to make too much noice, so I replaced it with OpenRGB.

OpenRGB is started automagically when either of us logs in, and sets our own profile. The problem was when we switched between users the last logged in users profile would be the active one.

A combination of a VB script and a scheduled task solves this problem. Create a color profile in OpenRGB and save it with a good name (preferably without spaces).

As an example, create C:\OpenRGB.vb with the following contents:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "C:\Program Files\OpenRGB\"
WshShell.Run "OpenRGB.exe --profile ""my-openrgb-profile""", 0, false

Then create a scheduled task that is trigger on workstation unlock and runs the C:\OpenRGB.vb script, something like:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2023-01-13T21:39:19.3700162</Date>
<Author>COMPUTER\User Name</Author>
<URI>\OpenRGB</URI>
</RegistrationInfo>
<Triggers>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>
<StateChange>SessionUnlock</StateChange>
<UserId>COMPUTER\User Name</UserId>
</SessionStateChangeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-775115785-2816134056-1390457888-1001</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\OpenRGB.vbs</Command>
</Exec>
</Actions>
</Task>

Now I just need QMK to finish their new client protocol XAP, and for OpenRGB to implement support for that protocol so it also can control the RGB lightning on the keyboard.

Customize Ubuntu and Unity

This is mostly a checklist for myself, might end up as a script, who knows?

Applications & Indicators

Unity Tweak Tool

sudo apt-get install unity-tweak-tool

Compiz Settings Manager

sudo apt-get install compizconfig-settings-manager

System Load indicator

sudo apt-get install indicator-multiload

Search for “System Load Indicator” in dash to enable it.

Workspace indicator

sudo apt-get install python-wnck python-appindicator
cd ~/Downloads
wget "http://ppa.launchpad.net/geod/ppa-geod/ubuntu/pool/main/i/indicator-workspaces/indicator-workspaces_0.6.4_all.deb"
sudo dpkg -i indicator-workspaces_0.6.4_all.deb
indicator-workspaces & disown

Right click on the indicator, chose “Preferences” and check “Start indicator at login”.

Redshift

sudo apt-get install redshift-gtk

Unity Launcher

Flatten launcher icons

Remove icon “backdrop” in the Unity launcher, to get a cleaner look.

git clone https://github.com/mjsolidarios/unity-flatify-icons.git
cd unity-flatify-icons
sh unity-flatify-icons.sh

Remove animations and decorations

Start the settings manager by pressing Alt+F2 and entering about:config. Go to the “Launcher” tab and scroll down to the bottom. Set “Launcher Backlight Mode” to “Backlight Always Off” and “Launcher Icon Launch Animation” to “None”.

Theming

Arc Unity/GTK3 theme

wget http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_15.04/Release.key
sudo apt-key add - < Release.key && rm -rf Release.key sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.10/ /' >> /etc/apt/sources.list.d/arc-theme.list"
sudo apt-get update
sudo apt-get install arc-theme

Emerald-dark icon theme

sudo add-apt-repository ppa:noobslab/icons 
sudo apt-get update
sudo apt-get install emerald-icons-theme

Source Code Pro font

cd ~/Downlods
wget "https://github.com/adobe-fonts/source-code-pro/archive/2.010R-ro/1.030R-it.zip"
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
unzip ~/Downloads/1.030R-it.zip
fc-cache -f

X11 cursor

Using Obsidian theme which is downloadable from gnome-look.org.

cd ~/Downloads
wget http://gnome-look.org/CONTENT/content-files/73135-Obsidian.tar.bz2
cd /usr/share/icons
sudo tar jxvf ~/Downlods/Obsidian.tar.bz2
sudo update-alternatives --install /usr/share/icons/default/index.theme x-cursor-theme /usr/share/icons/Obsidian/index.theme 20
sudo update-alternatvies --set x-cursor-theme /usr/share/icons/Obsidian/index.theme
gsettings set org.gnome.desktop.interface cursor-theme "Obsidian" 
sudo cat <<EOF >> /etc/X11/Xresources/x11-common
Xcursor.size: 24
Xcursor.theme: Obsidian
EOF

Miscellaneous

Disable the grid in lightdm

This disables the grid both at login and after locking the screen.

gsettings set com.canonical.unity-greeter draw-grid false
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false

Update a port to a newer version

So, you know a new version of a software has been released, but the port maintainer isn’t fast enough to satisfy your bleeding edge need; here’s how you’d do it:

  1. Update Makefile, variables like PORTVERSION and any other variables used to identify the package to download.
  2. Make sure that it is possible to download the new package and generate distinfo:
    make makesum
  3. Generate the pkg-plist file so that all the new files is correctly pointed out:
    make makeplist > pkg-plist
    awk '/etc\/rc.d\/plexmediaserver/,/^$/' pkg-plist > tmp && mv tmp pkg-plist
    
  4. Then it’s just a matter of re-installing the ports:
    make distclean && make && make reinstall clean

Courtesy of mikec_pt on the Plex Forums [plex.tv].