Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active August 19, 2023 15:14
Show Gist options
  • Save naranyala/d485d6e0937e15dfde7166db3a368576 to your computer and use it in GitHub Desktop.
Save naranyala/d485d6e0937e15dfde7166db3a368576 to your computer and use it in GitHub Desktop.
linux package "screenkey" for visualizing keypress
#!/bin/bash
# Check if screenkey is running
if ! pgrep -x "screenkey" >/dev/null; then
# Check if screenkey package is installed
if ! command -v screenkey &>/dev/null; then
# If it's not installed, try to install it
echo "Screenkey is not installed. Installing..."
# Check the package manager and use the appropriate command
if [ -x "$(command -v apt-get)" ]; then
sudo apt-get install screenkey
elif [ -x "$(command -v yum)" ]; then
sudo yum install screenkey
else
echo "Error: Unsupported package manager. Please install screenkey manually."
exit 1
fi
# Check if the installation was successful
if [ $? -ne 0 ]; then
echo "Error: Failed to install screenkey."
exit 1
fi
echo "Screenkey installed successfully."
fi
# Start screenkey with your desired parameters
nohup screenkey -p fixed -g "1366x49+0+719" --persist --font-size small --opacity 0.55 --font Hack &
echo "Screenkey started at the very bottom."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment