Cool Stuff you can do
This section covers random cool things you can do relating to hardware devices which you may not have thought of. These may just help you further appreciate the value of open source in terms of removing limits of what your PC can really do.
Stream audio to any DLNA device
sudo apt install pulseaudio-dlna\
pulseaudio-dlna
DLNA devices detected on the network will show up as additional audio sinks. Select the DLNA device you want to stream to as a sink from Pulseaudio Volume Control.
Show battery percentage of bluetooth headset
For some reason this might not work out of the box. You can check if you find your device power status in Gnome by going to Settings > Power > Devices, or run upower -d
.
To get it to work, try:
- Edit the file for bluetooth service (could be different on your system)
sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service
- Edit the command that starts the service, and append
--experimental
option
...
ExecStart=/usr/lib/bluetooth/bluetoothd --experimental
...
- Restart bluetooth service:
systemctl daemon-reload
systemctl restart bluetooth
- Run
upower -d
to check if your device now shows up, or check under Settings > Power > Devices in Gnome.
Logitech Unifying Receiver
The Logitech website claims their Unifying Software does not work on Linux, which is true, but what they don't tell you is that there is a well maintained open source project called Solaar which is superior to their own software, that does work on Linux. sudo apt install solaar
Logitech and Steelseries Mouse (button remap and RGB)
https://github.com/libratbag/piper
Corsair Keyboard driver
Similarly, there is an open source RGB keyboard driver for Corsair. https://github.com/ckb-next/ckb-next/
Software Control of NUC8i7 Hades Canyon LEDs
https://github.com/nomego/intel_nuc_led
Software Control of Mipow Playbulb Candle (BLE)
https://github.com/Heckie75/Mipow-Playbulb-BTL201
Software Control of monitor OSD hardware brightness/settings (via DDC)
https://github.com/ddccontrol/debian-ddccontrol OR for a simple Notification icon (recommended): https://extensions.gnome.org/extension/2645/brightness-control-using-ddcutil/
You need to first install ddcutil AND enable i2c user group (https://lexruee.ch/setting-i2c-permissions-for-non-root-users.html). Also the last instruction in that link says to use su
command to access root... doesn't work for Ubuntu so use sudo -s
instead
Run something when a hardware device is inserted or removed
For example when a specific USB device with a vendor/hardware ID is plugged or unplugged, or when power is plugged or unplugged.
I use it to set my GPU on max speed when plugged in or min speed when on battery.
In the /etc/udev/rules.d/
directory you can create your own rules files such as 60-intel_gpu_frequency.rules
:
# Rule for when switching to battery (default GPU)
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="/usr/bin/intel_gpu_frequency -d"
# Rule for when switching to powersupply (max GPU)
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="/usr/bin/intel_gpu_frequency -m"
You can also monitor udev for changes, to help you decide what variable or subsystem to use as a trigger:
udevadm monitor --environment
Format a drive/SD, modify partitions or backup whole drive image
Easiest way to change partitions or format is to use the GUI utility built into Ubuntu called Disks (or KDE Partition Manager in Kubuntu).
For advanced functionality use GParted or for terminal use fdisk.
Get Special Keyboard keys to work
Test the key but running acpi_listen
and press the key and check whether anything is output.
https://www.suyogjadhav.com/misc/2021/06/15/How-to-get-the-Asus-mic-key-working-in-Linux-on-Zephyrus-G14-(2021)/
Use your smartphone as a wired or wireless webcam
- Install the DroidCam mobile app from Google Playstore or Apple store (or the paid version DroidCamX for more features).
- Install droidcam software on your PC.
- Run Wireless (PC and phone must be on same LAN or hotspot):
- Run
droidcam
on PC and start DroidCam app on phone - Connect droidcam on PC to app using IP address, now you can use the webcam within any PC app.
- Run
- OR Run Wired (USB cable)
- Make sure USB debugging is enabled on phone (Settings > About > Version info, Tap build number until developer mode is enabled, then go to Settings > Developer and enable USB debugging)
- Add yourself to group:
sudo usermod -aG plugdev $LOGNAME
- Add permissions for adb (avoid requiring sudo adb):
sudo nano /etc/udev/rules.d/51-android.rules
- Add
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="username"
where username is your user name and runlsusb | grep -i samsung
for your phone brand (mine being samsung) to find correct values fromID idVendor:idProduct
- Save an re-login
- Now plug in phone to USB, run
adb devices
and you should see your device show up (should not say "unknown" or a blank list). - Run
droidcam
on PC and start DroidCam app on phone, and connect using USB option - Optionally change to 720p resolution as per instructions on DroidCam site for Linux (run command in Bash, or change single quote to brackets in Fish)