Skip to content

Commit 0c08523

Browse files
committed
Feature Request: Add Shell button
Added button to open shell for selected contianer Added a new docker icon The added icon is installable when installing using 'local_install.sh'
1 parent d7ff737 commit 0c08523

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed

Diff for: docker.svg

+37
Loading

Diff for: install_local.sh

+7
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
DIR=$HOME/.local/share/icons/hicolor/scalable/apps
2+
if [[ ! -e DIR ]]; then
3+
mkdir -p $DIR
4+
fi
5+
6+
cp docker.svg $DIR
7+
18
kpackagetool5 -t Plasma/Applet --install org.kde.drydock

Diff for: org.kde.drydock/contents/ui/main.qml

+29
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ Item {
3535
ListModel {
3636
id: dockerServices
3737
}
38+
39+
PlasmaCore.DataSource {
40+
id: shell
41+
engine: "executable"
42+
connectedSources: []
43+
onNewData: {
44+
var exitCode = data["exit code"]
45+
var exitStatus = data["exit status"]
46+
var stdout = data["stdout"]
47+
var stderr = data["stderr"]
48+
exited(sourceName, exitCode, exitStatus, stdout, stderr)
49+
disconnectSource(sourceName) // cmd finished
50+
}
51+
52+
function runShell(containerId) {
53+
var cmd = 'konsole -e "docker exec -it -u 0 '+containerId+' bash"';
54+
connectSource(cmd);
55+
}
56+
57+
signal exited(string cmd, int exitCode, int exitStatus, string stdout, string stderr)
58+
}
3859

3960
PlasmaCore.DataSource {
4061
id: executable
@@ -127,6 +148,14 @@ Item {
127148
running: true
128149
visible: isBusy(model.Id)
129150
}
151+
152+
PlasmaComponents.Button{
153+
enabled: !(isBusy(model.Id) || (model.State == "exited"))
154+
iconSource: "bash-symbolic"
155+
onClicked: function(){
156+
shell.runShell(model.Id)
157+
}
158+
}
130159

131160
PlasmaComponents.Button {
132161
enabled: !isBusy(model.Id)

Diff for: org.kde.drydock/metadata.desktop

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Desktop Entry]
22
Comment=docker start/stop control widget
33
Encoding=UTF-8
4-
Icon=utilities-terminal
4+
Icon=docker
55
Name=Drydock
66
Type=Service
77
X-KDE-ParentApp=

0 commit comments

Comments
 (0)