extended_slk_color - Linux


Overview

The extended_slk_color command sets the color of the Soft Label Keys (SLKs) of a Linux console. SLKs are the programmable keys usually found at the bottom of the keyboard, labeled F1 through F12.

Syntax

extended_slk_color [options] <color>

Options/Flags

  • -a, –all: Set the color of all SLKs.
  • -b, –background: Set the background color.
  • -f, –foreground: Set the foreground color.
  • -g, –get: Get the current color of the SLKs.
  • -h, –help: Display this help message.
  • -r, –reset: Reset the color of the SLKs to default.
  • -s, –stream: Send the color value to stdin of the running script.

Examples

Set the foreground color of all SLKs to red:

extended_slk_color -a -f red

Get the current background color of the SLKs:

extended_slk_color -g -b

Common Issues

  • If the SLKs do not change color, ensure that your terminal emulator supports SLK coloring.
  • Some terminal emulators may not support setting individual colors for each SLK.

Integration

The extended_slk_color command can be used with other Linux commands to automate SLK coloring. For example, you can use it with a script to change the SLK colors dynamically based on the current application or task.

#!/bin/bash

while true; do
    color=$(case $(xprop -root WM_CLASS) in
        "*emacs*" ) "green" ;;
        "*terminal*" ) "blue" ;;
        "*firefox*" ) "red" ;;
        * ) "default" ;;
    esac)
    extended_slk_color -a -f $color
    sleep 1
done

Related Commands

  • setterm – Set the terminal settings, including SLK color.
  • slkmode – Enable or disable the SLKs.