Added sxibp

master
Steven Saus 4 years ago
parent 06abc4334b
commit 868129a6f4
  1. 5
      README.md
  2. 32
      set-xwindow-icon-by-pid.sh

@ -5,6 +5,11 @@ This is often a repository when I work on small ideas until they're big enough
to deserve thier own repo and README. This readme may very well be outdated
or inaccurate!
## set-xwindow-icon-by-pid.sh
Does exactly what it says on the tin. $1 is the string to search, $2 is the path to the icon file
## sr.sh
A transparent wrapper for surfraw that utilizes fzf

@ -0,0 +1,32 @@
#!/bin/bash
##############################################################################
# set-xwindow-icon-by-pid
# (c) Steven Saus 2020
# Licensed under the MIT license
#
##############################################################################
ProgramToSearchFor=${1}
IconToUse=$(realpath ${2})
# Icon themes in ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini
if [ $# -lt 2 ]; then
echo "You must specify a process and FULL PATH to an icon"
exit 1
else
if [ -f ${IconToUse} ];then
psx=$(ps aux | grep $1)
num=$(echo "$psx"|grep --color=auto -c -v -e grep -e $0)
if [ $num -gt 0 ];then
MyPID=$(echo "$psx" | awk '{print $2}')
MyWindowID=$(xdotool search --pid "${MyPID}")
xseticon -id ${MyWindowID} ${IconToUse}
fi
else
echo "There was no icon present!"
exit 1
fi
fi
Loading…
Cancel
Save