Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
dotfiles
Commits
8a35f901
Commit
8a35f901
authored
4 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add (currently unused) qbar block scripts
parent
00310076
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
home-profiles/desktop/.config/qbar/blocks/disk
+6
-0
6 additions, 0 deletions
home-profiles/desktop/.config/qbar/blocks/disk
home-profiles/desktop/.config/qbar/blocks/mumble
+34
-0
34 additions, 0 deletions
home-profiles/desktop/.config/qbar/blocks/mumble
with
40 additions
and
0 deletions
home-profiles/desktop/.config/qbar/blocks/disk
0 → 100755
+
6
−
0
View file @
8a35f901
#!/usr/bin/env zsh
dir
=
"/"
df
-h
-P
-l
"
$dir
"
|
awk
'/\// { print $4 }'
This diff is collapsed.
Click to expand it.
home-profiles/desktop/.config/qbar/blocks/mumble
0 → 100755
+
34
−
0
View file @
8a35f901
#!/usr/bin/env python
# SPDX-License-Identifier: GPL-3.0-or-later
# usage: $ block-mumble mumble.example.com:64738 mumble.example.org
# depends: python
from
struct
import
pack
,
unpack
import
socket
,
sys
,
time
,
datetime
servers
=
[(
*
x
.
split
(
'
:
'
),
64738
)[:
2
]
for
x
in
sys
.
argv
[
1
:]]
servers
=
[(
host
,
int
(
port
))
for
(
host
,
port
)
in
servers
]
if
not
servers
:
exit
(
1
)
msg
=
'
🎧︎
'
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
as
s
:
s
.
settimeout
(
1
)
for
host
,
port
in
servers
:
msg
+=
f
'
{
host
}
:
'
if
len
(
servers
)
>
1
else
'
'
try
:
# https://wiki.mumble.info/wiki/Protocol
buf
=
pack
(
'
>iQ
'
,
0
,
0
)
s
.
sendto
(
buf
,
(
host
,
port
))
data
,
_
=
s
.
recvfrom
(
1024
)
data
=
unpack
(
"
>bbbbQiii
"
,
data
)
msg
+=
f
'
{
data
[
5
]
}
/
{
data
[
6
]
}
'
except
socket
.
gaierror
:
msg
+=
'
<error>unknown<error>
'
except
socket
.
timeout
:
msg
+=
'
<warning>?/?<warning>
'
print
(
msg
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment