mirror of
https://github.com/bgrolleman/dotfiles.git
synced 2026-05-10 17:11:14 +02:00
Add my noctalia setup config
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Polkit
|
||||
import Quickshell.Wayland
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.UI
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property var pluginApi: null
|
||||
|
||||
PolkitAgent {
|
||||
id: agent
|
||||
|
||||
onIsActiveChanged: {
|
||||
if (isActive) {
|
||||
openWindow()
|
||||
} else {
|
||||
closeWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var window: null
|
||||
|
||||
function openWindow() {
|
||||
if (window === null) {
|
||||
window = Qt.createComponent("PolkitWindow.qml").createObject(root, {
|
||||
flow: agent.flow,
|
||||
pluginApi: Qt.binding(function() { return root.pluginApi })
|
||||
});
|
||||
window.visible = true;
|
||||
} else {
|
||||
window.flow = agent.flow
|
||||
window.pluginApi = root.pluginApi
|
||||
window.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
function closeWindow() {
|
||||
if (window !== null) {
|
||||
window.destroy();
|
||||
window = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Polkit
|
||||
import Quickshell.Wayland
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.UI
|
||||
|
||||
PanelWindow {
|
||||
id: polkitWindow
|
||||
|
||||
property AuthFlow flow
|
||||
property var pluginApi
|
||||
|
||||
Connections {
|
||||
target: flow
|
||||
function onFailedChanged() {
|
||||
if (flow && flow.failed) {
|
||||
ToastService.showError(
|
||||
pluginApi ? pluginApi.tr("error.failed.title") : "Authentication Failed",
|
||||
pluginApi ? pluginApi.tr("error.failed.message") : "The password you entered was incorrect."
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Layer above everything else (critical system prompt)
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||
|
||||
readonly property real shadowPadding: Style.shadowBlurMax + Style.marginL
|
||||
|
||||
// Explicit size - include shadowPadding so the shadow isn't clipped at window corners
|
||||
implicitWidth: 400 * Style.uiScaleRatio + shadowPadding * 2
|
||||
implicitHeight: contentLayout.implicitHeight + (Style.marginL * 2) + shadowPadding * 2
|
||||
|
||||
color: "transparent"
|
||||
|
||||
Item {
|
||||
id: contentContainer
|
||||
anchors.fill: parent
|
||||
anchors.margins: shadowPadding
|
||||
focus: true
|
||||
|
||||
Keys.onPressed: function(event) {
|
||||
if (!flow) return;
|
||||
|
||||
if (Keybinds.checkKey(event, "escape", Settings)) {
|
||||
flow.cancelAuthenticationRequest();
|
||||
event.accepted = true;
|
||||
} else if (Keybinds.checkKey(event, "enter", Settings)) {
|
||||
if (passwordInput.text !== "") {
|
||||
flow.submit(passwordInput.text);
|
||||
passwordInput.text = "";
|
||||
}
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
transform: Translate {
|
||||
id: shakeTranslate
|
||||
x: 0
|
||||
}
|
||||
|
||||
// Error animation
|
||||
SequentialAnimation {
|
||||
id: errorShake
|
||||
running: flow && flow.failed
|
||||
loops: 1
|
||||
|
||||
NumberAnimation { target: shakeTranslate; property: "x"; from: 0; to: -10; duration: 50; easing.type: Easing.InOutQuad }
|
||||
NumberAnimation { target: shakeTranslate; property: "x"; from: -10; to: 10; duration: 50; easing.type: Easing.InOutQuad }
|
||||
NumberAnimation { target: shakeTranslate; property: "x"; from: 10; to: -10; duration: 50; easing.type: Easing.InOutQuad }
|
||||
NumberAnimation { target: shakeTranslate; property: "x"; from: -10; to: 10; duration: 50; easing.type: Easing.InOutQuad }
|
||||
NumberAnimation { target: shakeTranslate; property: "x"; from: 10; to: 0; duration: 50; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
// Shadow effect (behind background)
|
||||
NDropShadow {
|
||||
anchors.fill: customBackground
|
||||
source: customBackground
|
||||
autoPaddingEnabled: true
|
||||
z: -1
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: customBackground
|
||||
anchors.fill: parent
|
||||
radius: Style.radiusL
|
||||
color: Qt.alpha(Color.mSurface, 0.95)
|
||||
border.color: (flow && (flow.failed || flow.supplementaryIsError)) ? Color.mError : Color.mOutline
|
||||
border.width: Style.borderS
|
||||
|
||||
Behavior on border.color {
|
||||
ColorAnimation { duration: Style.animationFast }
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: contentLayout
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - (Style.marginL * 2)
|
||||
spacing: Style.marginM
|
||||
|
||||
// Header with Icon
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginM
|
||||
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: Style.fontSizeXXL * 2
|
||||
Layout.preferredHeight: Style.fontSizeXXL * 2
|
||||
imagePath: (flow && flow.iconName) ? Quickshell.iconPath(flow.iconName) : ""
|
||||
fallbackIcon: "lock"
|
||||
borderWidth: 0
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginXS
|
||||
|
||||
NText {
|
||||
text: flow ? flow.message : (pluginApi ? pluginApi.tr("window.title") : "Authentication Required")
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NText {
|
||||
text: flow ? flow.actionId : ""
|
||||
pointSize: Style.fontSizeXS
|
||||
color: Color.mOnSurfaceVariant
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
visible: text !== ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Supplementary Message (Error or prompt)
|
||||
NText {
|
||||
visible: flow && flow.supplementaryMessage !== ""
|
||||
text: flow ? flow.supplementaryMessage : ""
|
||||
pointSize: Style.fontSizeS
|
||||
color: (flow && flow.supplementaryIsError) ? Color.mError : Color.mOnSurfaceVariant
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// Input Field
|
||||
NTextInput {
|
||||
id: passwordInput
|
||||
Layout.fillWidth: true
|
||||
placeholderText: flow ? flow.inputPrompt : (pluginApi ? pluginApi.tr("prompt.password") : "Password")
|
||||
label: (flow && flow.isResponseRequired) ? (pluginApi ? pluginApi.tr("prompt.password") : "Password") : ""
|
||||
inputItem.echoMode: (flow && !flow.responseVisible) ? TextInput.Password : TextInput.Normal
|
||||
visible: flow && flow.isResponseRequired
|
||||
|
||||
onAccepted: {
|
||||
if (flow) {
|
||||
flow.submit(passwordInput.text)
|
||||
passwordInput.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginS
|
||||
spacing: Style.marginM
|
||||
|
||||
Item { Layout.fillWidth: true } // Spacer
|
||||
|
||||
NButton {
|
||||
text: pluginApi ? pluginApi.tr("action.cancel") : "Cancel"
|
||||
backgroundColor: Color.mSurfaceVariant
|
||||
textColor: Color.mOnSurfaceVariant
|
||||
outlined: false
|
||||
onClicked: {
|
||||
if (flow) flow.cancelAuthenticationRequest()
|
||||
}
|
||||
}
|
||||
|
||||
NButton {
|
||||
text: pluginApi ? pluginApi.tr("action.authenticate") : "Authenticate"
|
||||
backgroundColor: Color.mPrimary
|
||||
textColor: Color.mOnPrimary
|
||||
enabled: flow && flow.isResponseRequired
|
||||
onClicked: {
|
||||
if (flow) {
|
||||
flow.submit(passwordInput.text)
|
||||
passwordInput.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Focus handling
|
||||
Component.onCompleted: {
|
||||
passwordInput.inputItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
# Polkit Agent
|
||||
|
||||
This plugin provides a Polkit authentication agent for Noctalia. It allows you to authenticate actions that require elevated privileges directly within the shell.
|
||||
|
||||

|
||||
|
||||
## Important
|
||||
|
||||
To use this plugin, you **must disable or uninstall your existing polkit authentication agent** (e.g., `polkit-gnome`, `polkit-kde-agent`, `lxpolkit`, etc).
|
||||
|
||||
Having multiple polkit agents running simultaneously will cause conflicts and prevent this plugin from working correctly.
|
||||
|
||||
> You may need to **restart your session or computer** after enabling this plugin for the changes to take effect and for the new agent to be registered properly.
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Authentifizierung erforderlich"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Passwort"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Abbrechen",
|
||||
"authenticate": "Authentifizieren"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Authentifizierung fehlgeschlagen",
|
||||
"message": "Das eingegebene Passwort war falsch."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Authentication Required"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Password"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Cancel",
|
||||
"authenticate": "Authenticate"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Authentication Failed",
|
||||
"message": "The password you entered was incorrect."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Autenticación requerida"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Contraseña"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Cancelar",
|
||||
"authenticate": "Autenticar"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Autenticación fallida",
|
||||
"message": "La contraseña introducida es incorrecta."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Authentification requise"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Mot de passe"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Annuler",
|
||||
"authenticate": "S'authentifier"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Authentification échouée",
|
||||
"message": "Le mot de passe saisi est incorrect."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Hitelesítés szükséges"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Jelszó"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Mégse",
|
||||
"authenticate": "Hitelesítés"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Hitelesítés sikertelen",
|
||||
"message": "A megadott jelszó helytelen volt."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "認証が必要です"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "パスワード"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "キャンセル",
|
||||
"authenticate": "認証"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "認証に失敗しました",
|
||||
"message": "入力されたパスワードが正しくありません。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "인증 필요"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "비밀번호"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "취소",
|
||||
"authenticate": "인증"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "인증 실패",
|
||||
"message": "입력한 비밀번호가 올바르지 않습니다."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Nasname pêwîst e"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Şîfre"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Betal bike",
|
||||
"authenticate": "Nasnameyê bipesend bike"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Nasname têk çû",
|
||||
"message": "Şîfreya ku hûn nivîsandin şaş e."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Authenticatie vereist"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Wachtwoord"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Annuleren",
|
||||
"authenticate": "Authenticeren"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Authenticatie mislukt",
|
||||
"message": "Het ingevoerde wachtwoord was onjuist."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Autentisering kreves"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Passord"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Avbryt",
|
||||
"authenticate": "Autentiser"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Autentisering mislyktes",
|
||||
"message": "Passordet du skrev inn var feil."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Autentisering krevst"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Passord"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Avbryt",
|
||||
"authenticate": "Autentiser"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Autentisering mislukkast",
|
||||
"message": "Passordet du skreiv inn var feil."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Wymagane uwierzytelnienie"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Hasło"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Anuluj",
|
||||
"authenticate": "Uwierzytelnij"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Uwierzytelnienie nie powiodło się",
|
||||
"message": "Wprowadzone hasło jest nieprawidłowe."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Autenticação Necessária"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Senha"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Cancelar",
|
||||
"authenticate": "Autenticar"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Autenticação Falhou",
|
||||
"message": "A senha introduzida está incorreta."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Требуется аутентификация"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Пароль"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Отмена",
|
||||
"authenticate": "Аутентифицировать"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Ошибка аутентификации",
|
||||
"message": "Введен неверный пароль."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Autentisering krävs"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Lösenord"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Avbryt",
|
||||
"authenticate": "Autentisera"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Autentisering misslyckades",
|
||||
"message": "Det angivna lösenordet var felaktigt."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Kimlik Doğrulaması Gerekli"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Parola"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "İptal",
|
||||
"authenticate": "Doğrula"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Kimlik Doğrulama Başarısız",
|
||||
"message": "Girdiğiniz parola yanlış."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Потрібна аутентифікація"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Пароль"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Скасувати",
|
||||
"authenticate": "Аутентифікувати"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Помилка аутентифікації",
|
||||
"message": "Введений пароль неправильний."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "Yêu cầu xác thực"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "Mật khẩu"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "Hủy",
|
||||
"authenticate": "Xác thực"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "Xác thực thất bại",
|
||||
"message": "Mật khẩu bạn nhập không đúng."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "需要身份验证"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "密码"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "取消",
|
||||
"authenticate": "验证"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "身份验证失败",
|
||||
"message": "您输入的密码不正确。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"window": {
|
||||
"title": "需要身份驗證"
|
||||
},
|
||||
"prompt": {
|
||||
"password": "密碼"
|
||||
},
|
||||
"action": {
|
||||
"cancel": "取消",
|
||||
"authenticate": "驗證"
|
||||
},
|
||||
"error": {
|
||||
"failed": {
|
||||
"title": "身份驗證失敗",
|
||||
"message": "您輸入的密碼不正確。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "polkit-agent",
|
||||
"name": "Polkit Agent",
|
||||
"version": "1.0.6",
|
||||
"minNoctaliaVersion": "4.4.3",
|
||||
"author": "Noctalia Team <team@noctalia.dev>",
|
||||
"official": true,
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/noctalia-dev/noctalia-plugins",
|
||||
"description": "Provides a Polkit authentication agent.",
|
||||
"tags": [
|
||||
"System",
|
||||
"Security"
|
||||
],
|
||||
"entryPoints": {
|
||||
"main": "Main.qml"
|
||||
},
|
||||
"dependencies": {
|
||||
"plugins": []
|
||||
},
|
||||
"metadata": {
|
||||
"defaultSettings": {}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Reference in New Issue
Block a user