Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Booloki
gnome-shell-extension-dsp-indicator
Commits
4ae8e090
Commit
4ae8e090
authored
Nov 14, 2021
by
Booloki
Browse files
Add first version
parent
649b9c71
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
4ae8e090
# dsp-i
ndicator
DSP I
ndicator
- Gnome Shell extension
DSP Indicator - Gnome extension
Display Server Protocol Indicator (X11, Wayland,…)
\ No newline at end of file
Display Server Protocol Indicator (X11, Wayland,…)
extension.js
0 → 100644
View file @
4ae8e090
// vim: set sw=4 sts=4 et:
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const
Clutter
=
imports
.
gi
.
Clutter
;
const
GObject
=
imports
.
gi
.
GObject
;
const
Shell
=
imports
.
gi
.
Shell
;
const
St
=
imports
.
gi
.
St
;
const
Main
=
imports
.
ui
.
main
;
const
PanelMenu
=
imports
.
ui
.
panelMenu
;
const
ByteArray
=
imports
.
byteArray
;
const
GLib
=
imports
.
gi
.
GLib
;
function
getDSP
()
{
let
dsp
=
null
;
let
[
ok
,
content
,
err
,
exit
]
=
GLib
.
spawn_command_line_sync
(
'
/bin/bash -c "loginctl show-session $(awk
\'
/tty/ {print $1}
\'
<(loginctl)) -p Type | awk -F=
\'
{print $2}
\'
"
'
);
if
(
content
.
length
>
0
)
{
dsp
=
ByteArray
.
toString
(
content
);
}
return
dsp
;
}
let
DSPButton
=
GObject
.
registerClass
(
class
DSPButton
extends
PanelMenu
.
Button
{
_init
()
{
super
.
_init
(
0.0
,
'
DSP Indicator
'
);
let
dsp
=
getDSP
();
if
(
dsp
==
null
)
{
dsp
=
'
N/A
'
;
}
let
label
=
new
St
.
Label
({
text
:
dsp
,
y_expand
:
true
});
this
.
add_actor
(
label
);
}
});
let
DSPIndicatorButton
;
function
enable
()
{
DSPIndicatorButton
=
new
DSPButton
();
Main
.
panel
.
addToStatusArea
(
'
dsp-indicator
'
,
DSPIndicatorButton
);
}
function
disable
()
{
DSPIndicatorButton
.
destroy
();
}
metadata.json
0 → 100644
View file @
4ae8e090
{
"name"
:
"DSP Indicator"
,
"description"
:
"Display Server Protocol Indicator (X11, Wayland,…)"
,
"version"
:
1
,
"uuid"
:
"dspindicator@booloki.lokizone.net"
,
"shell-version"
:
[
"3.36"
,
"3.38"
,
"40"
,
"41"
],
"url"
:
"https://git.lokizone.net/booloki/gnome-shell-extension-dsp-indicator"
}
stylesheet.css
0 → 100644
View file @
4ae8e090
/* Add your custom extension styling here */
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