From 1537f9d48b08f4c27d33b5c9a2b5416d00866ba7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 12 Aug 2020 10:02:53 +0000 Subject: kwin.sh: fixed dash support (#1058) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9467 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Ui/skinned/scripts/kwin.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins/Ui/skinned') diff --git a/src/plugins/Ui/skinned/scripts/kwin.sh b/src/plugins/Ui/skinned/scripts/kwin.sh index 5f18badf8..0d64c90d0 100644 --- a/src/plugins/Ui/skinned/scripts/kwin.sh +++ b/src/plugins/Ui/skinned/scripts/kwin.sh @@ -2,30 +2,36 @@ #This script adds kwin rules for qmmp windows -if ! type kreadconfig5 &> /dev/null; then +if ! type kreadconfig5 > /dev/null; then exit 1 fi -if ! type kwriteconfig5 &> /dev/null; then +if ! type kwriteconfig5 > /dev/null; then exit 1 fi # get count of rules count=`kreadconfig5 --file kwinrulesrc --group General --key count` i=1 -found=0; +found=0 + +if [ -z $count ]; then + count=0 +fi while [ $i -le $count ]; do # find qmmp window rule in KWin match=`kreadconfig5 --file kwinrulesrc --group $i --key wmclass` - if [[ "${match,,}" = *"qmmp"* ]]; then + if [ "${match}" = "qmmp" ]; then found=$i break fi i=$((i+1)) done +echo $found + qmmp_create_rule(){ id=$1 -- cgit v1.2.3-13-gbd6f