Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Konversation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Network
Konversation
Commits
ca6b67df
Commit
ca6b67df
authored
Oct 28, 2020
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shell scripts to also find qdbus-qt5
parent
eb63cf30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
data/scripts/gauge
data/scripts/gauge
+15
-5
data/scripts/tinyurl
data/scripts/tinyurl
+14
-4
No files found.
data/scripts/gauge
View file @
ca6b67df
...
...
@@ -8,25 +8,35 @@ shift
PERCENTAGE
=
$1
# special handling for qdbus variants
_qdbus
=
qdbus-qt5
if
!
[
"
$(
which
$_qdbus
2> /dev/null
)
"
]
;
then
_qdbus
=
qdbus
if
!
[
"
$(
which
$_qdbus
2> /dev/null
)
"
]
;
then
echo
"Error: The qdbus (or qdbus-qt5) utility is missing."
exit
1
fi
fi
if
[
!
$TARGET
]
then
qdbus org.kde.konversation /irc error
"Can't write into status view."
$_
qdbus
org.kde.konversation /irc error
"Can't write into status view."
else
if
[
!
$PERCENTAGE
]
then
qdbus org.kde.konversation /irc error
"USAGE:
$0
<percentage>"
$_
qdbus
org.kde.konversation /irc error
"USAGE:
$0
<percentage>"
else
PERCENTAGE
=
`
echo
$PERCENTAGE
|
sed
's/^0\+//'
`
LEFT
=
$((
$PERCENTAGE
/
5
))
RIGHT
=
$((
20
-
$LEFT
))
if
[[
$PERCENTAGE
-lt
0
]]
;
then
qdbus org.kde.konversation /irc error
"Percentage has to be bigger than 0"
$_
qdbus
org.kde.konversation /irc error
"Percentage has to be bigger than 0"
exit
fi
if
[[
$PERCENTAGE
-gt
100
]]
;
then
qdbus org.kde.konversation /irc error
"Percentage has to be smaller than 100"
$_
qdbus
org.kde.konversation /irc error
"Percentage has to be smaller than 100"
exit
fi
...
...
@@ -64,6 +74,6 @@ else
OUTPUT
=
"
$OUTPUT
*ding*"
fi
qdbus org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"Beer load
$OUTPUT
"
$_
qdbus
org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"Beer load
$OUTPUT
"
fi
fi
data/scripts/tinyurl
View file @
ca6b67df
...
...
@@ -11,22 +11,32 @@ TARGET=$2
export
URL
=
"
$3
"
NICK
=
"
$4
"
# special handling for qdbus variants
_qdbus
=
qdbus-qt5
if
!
[
"
$(
which
$_qdbus
2> /dev/null
)
"
]
;
then
_qdbus
=
qdbus
if
!
[
"
$(
which
$_qdbus
2> /dev/null
)
"
]
;
then
echo
"Error: The qdbus (or qdbus-qt5) utility is missing."
exit
1
fi
fi
if
test
!
-z
$URL
;
then
if
test
$(
which curl
)
;
then
TINYURL
=
"
$(
curl
-s
-i
https://tinyurl.com/api-create.php?url
=
$URL
|tail
-1
)
"
else
TINYURL
=
"
$(
wget
-T10
-t2
-qO-
https://tinyurl.com/api-create.php?url
=
$URL
|tail
-1
)
"
fi
else
qdbus org.kde.konversation /irc error
"No url given: usage is
\"
/tinyurl URL [NickName]
\"
"
else
$_
qdbus
org.kde.konversation /irc error
"No url given: usage is
\"
/tinyurl URL [NickName]
\"
"
exit
1
fi
if
test
-z
$TINYURL
;
then
qdbus org.kde.konversation /irc error
"Unable run tinyurl script, please make sure you have curl or wget installed"
$_
qdbus
org.kde.konversation /irc error
"Unable run tinyurl script, please make sure you have curl or wget installed"
else
if
test
!
-z
$NICK
;
then
qdbus org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"
${
NICK
}
:
$TINYURL
"
$_
qdbus
org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"
${
NICK
}
:
$TINYURL
"
else
qdbus org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"
$TINYURL
"
$_
qdbus
org.kde.konversation /irc say
$SERVER
"
$TARGET
"
"
$TINYURL
"
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment