Skip to content

Commit c7cf669

Browse files
committed
feat(keepass): add settings UI and optimize sidebar mapping
1 parent 7ae1132 commit c7cf669

5 files changed

Lines changed: 36 additions & 18 deletions

File tree

docs/IPC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ bind "Mod+P" { spawn "inir" "keepass" "toggle"; }
515515
bind "Mod+Ctrl+P" { spawn "inir" "keepass" "add"; }
516516
```
517517

518-
Requires `keepassxc` (for `keepassxc-cli`) and a `.kdbx` vault. Set `keepass.vaultDir` in the shell config to point at the directory containing your vaults (defaults to `~/.local/share/keepassqs`); existing vaults are listed in the picker, and new ones can be created from the UI.
518+
Requires `keepassxc` (for `keepassxc-cli`), `libsecret` (for `secret-tool`) and a `.kdbx` vault. Set `keepass.vaultDir` in the shell config to point at the directory containing your vaults (defaults to `~/.local/share/keepassqs`); existing vaults are listed in the picker, and new ones can be created from the UI. Password caching is handled securely via the system keyring.
519519

520520
---
521521

docs/PACKAGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ Not installed by default, but useful. The shell handles their absence gracefully
197197
| Package | Purpose | Used by |
198198
|---------|---------|---------|
199199
| `keepassxc` | KeePass password manager (`keepassxc-cli`) | KeePass overlay panel |
200+
| `libsecret` | Secret Service CLI (`secret-tool`) | KeePass password caching |
200201
| `warp-cli` | Cloudflare WARP VPN toggle | Quick toggles panel |
201202
| `ollama` | Local LLM for AI chat | Sidebar AI assistant |
202203
| `cava` | Audio visualizer | Bar widget (optional) |

modules/settings/ServicesConfig.qml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,4 +1404,30 @@ ContentPage {
14041404
}
14051405
}
14061406

1407+
SettingsCardSection {
1408+
expanded: false
1409+
icon: "key"
1410+
title: Translation.tr("KeePass")
1411+
1412+
SettingsGroup {
1413+
StyledText {
1414+
Layout.fillWidth: true
1415+
text: Translation.tr("Integrate with KeePassXC-CLI to manage passwords directly from the shell.")
1416+
color: Appearance.colors.colOnSurfaceVariant
1417+
font.pixelSize: Appearance.font.pixelSize.small
1418+
wrapMode: Text.WordWrap
1419+
}
1420+
1421+
MaterialTextArea {
1422+
Layout.fillWidth: true
1423+
placeholderText: Translation.tr("Vault directory (where your .kdbx files are)")
1424+
text: Config.options?.keepass?.vaultDir ?? ""
1425+
wrapMode: TextEdit.Wrap
1426+
onTextChanged: Config.setNestedValue("keepass.vaultDir", text)
1427+
StyledToolTip {
1428+
text: Translation.tr("The directory containing your KeePass databases. If empty, the shell will look in common locations.")
1429+
}
1430+
}
1431+
}
1432+
}
14071433
}

modules/sidebarRight/SidebarRight.qml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,20 @@ Scope {
2222
id: sidebarRoot
2323

2424
Component.onCompleted: {
25-
visible = GlobalStates.sidebarRightOpen
2625
root._sidebarShown = GlobalStates.sidebarRightOpen
2726
}
2827

2928
Connections {
3029
target: GlobalStates
3130
function onSidebarRightOpenChanged() {
3231
if (GlobalStates.sidebarRightOpen) {
33-
_closeTimer.stop()
34-
sidebarRoot.visible = true
35-
// Let the surface map for one frame before sliding in
3632
Qt.callLater(() => { root._sidebarShown = true })
37-
} else if (root.instantOpen || !Appearance.animationsEnabled) {
38-
root._sidebarShown = false
39-
_closeTimer.stop()
40-
sidebarRoot.visible = false
4133
} else {
4234
root._sidebarShown = false
43-
_closeTimer.restart()
4435
}
4536
}
4637
}
4738

48-
Timer {
49-
id: _closeTimer
50-
interval: 300
51-
onTriggered: sidebarRoot.visible = false
52-
}
53-
5439
function hide() {
5540
GlobalStates.sidebarRightOpen = false
5641
}
@@ -60,6 +45,10 @@ Scope {
6045
WlrLayershell.namespace: "quickshell:sidebarRight"
6146
WlrLayershell.keyboardFocus: GlobalStates.sidebarRightOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
6247
color: "transparent"
48+
// Keep the surface always mapped to avoid Qt6 physicalDpiChanged infinite
49+
// recursion (stack overflow) triggered by Hyprland sending a Wayland scale
50+
// event on remap. Input is controlled via mask instead of visibility.
51+
mask: Region { item: GlobalStates.sidebarRightOpen ? backdropClickArea : noInputItem }
6352

6453
anchors {
6554
top: true
@@ -68,10 +57,12 @@ Scope {
6857
left: true
6958
}
7059

60+
Item { id: noInputItem; width: 0; height: 0 }
61+
7162
CompositorFocusGrab {
7263
id: grab
7364
windows: [ sidebarRoot ]
74-
active: CompositorService.isHyprland && sidebarRoot.visible
65+
active: CompositorService.isHyprland && GlobalStates.sidebarRightOpen
7566
onCleared: () => {
7667
if (!active) sidebarRoot.hide()
7768
}

services/KeePass.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Quickshell.Io
1212
Singleton {
1313
id: root
1414

15-
property string scriptPath: FileUtils.trimFileProtocol(`${Directories.config}/quickshell/inir/scripts/quickshell-keepass`)
15+
property string scriptPath: FileUtils.trimFileProtocol(`${Directories.scriptsPath}/quickshell-keepass`)
1616
readonly property string vaultDir: Config.options?.keepass?.vaultDir
1717
|| FileUtils.trimFileProtocol(`${Directories.home}/.local/share/keepassqs`)
1818
property string vaultPath: ""

0 commit comments

Comments
 (0)