Rebase to flake parts #8
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginComponent {
|
||||
id: root
|
||||
|
||||
property bool vaultUnlocked: false
|
||||
|
||||
function refreshLockState() {
|
||||
if (!statusProcess.running)
|
||||
statusProcess.exec(["rbw", "unlocked"]);
|
||||
}
|
||||
|
||||
function toggleLock() {
|
||||
if (root.vaultUnlocked) {
|
||||
Quickshell.execDetached(["rbw", "lock"]);
|
||||
} else {
|
||||
Quickshell.execDetached(["rbw", "unlock"]);
|
||||
}
|
||||
}
|
||||
|
||||
pillClickAction: () => root.toggleLock()
|
||||
|
||||
Component.onCompleted: refreshLockState()
|
||||
|
||||
Timer {
|
||||
interval: 2500
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: root.refreshLockState()
|
||||
}
|
||||
|
||||
Process {
|
||||
id: statusProcess
|
||||
command: ["rbw", "unlocked"]
|
||||
onExited: (exitCode, _exitStatus) => {
|
||||
root.vaultUnlocked = exitCode === 0;
|
||||
}
|
||||
}
|
||||
|
||||
horizontalBarPill: Component {
|
||||
MouseArea {
|
||||
implicitWidth: iconH.implicitWidth
|
||||
implicitHeight: iconH.implicitHeight
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.toggleLock()
|
||||
|
||||
DankIcon {
|
||||
id: iconH
|
||||
name: root.vaultUnlocked ? "lock_open_right" : "lock"
|
||||
size: root.iconSize
|
||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verticalBarPill: Component {
|
||||
MouseArea {
|
||||
implicitWidth: iconV.implicitWidth
|
||||
implicitHeight: iconV.implicitHeight
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.toggleLock()
|
||||
|
||||
DankIcon {
|
||||
id: iconV
|
||||
name: root.vaultUnlocked ? "lock_open_right" : "lock"
|
||||
size: root.iconSize
|
||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginSettings {
|
||||
id: root
|
||||
pluginId: "rbwLockToggle"
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: "Shows rbw vault state with a closed lock (locked) or open lock (unlocked). Click to run `rbw unlock` (pinentry) or `rbw lock`. Requires `rbw` on PATH in the DMS session and a working pinentry."
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"id": "rbwLockToggle",
|
||||
"name": "Bitwarden (rbw) lock",
|
||||
"description": "Bar control for rbw vault: locked/unlocked padlock; click to unlock or lock",
|
||||
"version": "1.0.0",
|
||||
"author": "NixOS-V2",
|
||||
"type": "widget",
|
||||
"capabilities": ["dankbar-widget"],
|
||||
"component": "./RbwLockToggle.qml",
|
||||
"settings": "./RbwLockToggleSettings.qml",
|
||||
"icon": "lock_open",
|
||||
"permissions": ["settings_read"]
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginComponent {
|
||||
id: root
|
||||
|
||||
function toggleKeyboard() {
|
||||
Quickshell.execDetached(["sh", "-c", "pkill -SIGRTMIN -x wvkbd-mobintl"]);
|
||||
}
|
||||
|
||||
pillClickAction: () => root.toggleKeyboard()
|
||||
|
||||
horizontalBarPill: Component {
|
||||
MouseArea {
|
||||
implicitWidth: icon.implicitWidth
|
||||
implicitHeight: icon.implicitHeight
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.toggleKeyboard()
|
||||
|
||||
DankIcon {
|
||||
id: icon
|
||||
name: "keyboard"
|
||||
size: Theme.iconSize
|
||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verticalBarPill: Component {
|
||||
MouseArea {
|
||||
implicitWidth: iconV.implicitWidth
|
||||
implicitHeight: iconV.implicitHeight
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.toggleKeyboard()
|
||||
|
||||
DankIcon {
|
||||
id: iconV
|
||||
name: "keyboard"
|
||||
size: Theme.iconSize
|
||||
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginSettings {
|
||||
id: root
|
||||
pluginId: "wvkbdToggle"
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: "Click the keyboard icon in the bar to show or hide the on-screen keyboard (wvkbd)."
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"id": "wvkbdToggle",
|
||||
"name": "Virtual Keyboard Toggle",
|
||||
"description": "Bar button to show/hide the wvkbd on-screen keyboard (for touch/tablet)",
|
||||
"version": "1.0.0",
|
||||
"author": "NixOS-V2",
|
||||
"type": "widget",
|
||||
"capabilities": ["dankbar-widget"],
|
||||
"component": "./WvkbdToggle.qml",
|
||||
"settings": "./WvkbdToggleSettings.qml",
|
||||
"icon": "keyboard",
|
||||
"permissions": ["settings_read"]
|
||||
}
|
||||
Reference in New Issue
Block a user