initial commit
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.services
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// ---- Panel placement -------------------------------------------------
|
||||
|
||||
// Bottom of the screen, on the Top layer so the panel sits above normal
|
||||
// windows but below fullscreen overlays and lockscreens.
|
||||
readonly property int layer: WlrLayer.Top
|
||||
|
||||
// Layershell namespace. Compositors can target the panel with this, e.g.
|
||||
// sway: `layer_effects "att_menu" blur enable`
|
||||
readonly property string namespace: "att_menu"
|
||||
|
||||
// Reserve space so maximised windows do not sit under the panel.
|
||||
readonly property bool reserveSpace: true
|
||||
|
||||
// ---- Window list -----------------------------------------------------
|
||||
|
||||
// Show only windows present on the panel's own screen. Set false to mirror
|
||||
// every window onto every panel.
|
||||
readonly property bool windowsPerScreen: true
|
||||
|
||||
readonly property int windowButtonMinWidth: 40
|
||||
readonly property int windowButtonMaxWidth: 220
|
||||
|
||||
// ---- Launcher --------------------------------------------------------
|
||||
|
||||
readonly property int launcherWidth: 460
|
||||
readonly property int launcherHeight: 520
|
||||
|
||||
// argv prefix used to run desktop entries with `Terminal=true`.
|
||||
// $TERMINAL is honoured if set; otherwise change the fallback to your
|
||||
// terminal of choice.
|
||||
readonly property var terminal: {
|
||||
const env = Quickshell.env("TERMINAL");
|
||||
if (!env)
|
||||
return ["foot"];
|
||||
|
||||
// Terminals that need an explicit flag before the command to run.
|
||||
const needsExecFlag = ["alacritty", "ghostty", "xterm", "urxvt", "st", "konsole"];
|
||||
return needsExecFlag.includes(env.split("/").pop()) ? [env, "-e"] : [env];
|
||||
}
|
||||
|
||||
// ---- Wifi ------------------------------------------------------------
|
||||
|
||||
// Set false to drop the wifi button. It also hides itself where there is no
|
||||
// wifi adapter, or no NetworkManager to talk to.
|
||||
readonly property bool showWifi: true
|
||||
|
||||
// Cap on the SSID shown next to the panel icon, so a long name cannot
|
||||
// squeeze the window list.
|
||||
readonly property int wifiLabelMaxWidth: 110
|
||||
|
||||
readonly property int wifiMenuWidth: 300
|
||||
readonly property int wifiMenuHeight: 400
|
||||
|
||||
// ---- Bluetooth -------------------------------------------------------
|
||||
|
||||
// Set false to drop the bluetooth button. It also hides itself on machines
|
||||
// with no bluetooth adapter, so leaving this on costs nothing there.
|
||||
readonly property bool showBluetooth: true
|
||||
|
||||
readonly property int bluetoothMenuWidth: 300
|
||||
readonly property int bluetoothMenuHeight: 400
|
||||
|
||||
// ---- Power actions ---------------------------------------------------
|
||||
|
||||
// Ask before running the actions marked `dangerous` below.
|
||||
readonly property bool confirmDangerous: true
|
||||
|
||||
readonly property int powerMenuWidth: 190
|
||||
|
||||
// `command` is argv, run detached. Reorder or trim this list to change
|
||||
// which rows appear in the session menu.
|
||||
readonly property var powerActions: [
|
||||
{
|
||||
id: "logout",
|
||||
label: "Log out",
|
||||
icon: "system-log-out",
|
||||
glyph: "⏻",
|
||||
command: root.sessionQuitCommand,
|
||||
dangerous: true
|
||||
},
|
||||
{
|
||||
id: "suspend",
|
||||
label: "Suspend",
|
||||
icon: "system-suspend",
|
||||
glyph: "☽",
|
||||
command: ["systemctl", "suspend"],
|
||||
dangerous: false
|
||||
},
|
||||
{
|
||||
id: "reboot",
|
||||
label: "Restart",
|
||||
icon: "system-reboot",
|
||||
glyph: "↻",
|
||||
command: ["systemctl", "reboot"],
|
||||
dangerous: true
|
||||
},
|
||||
{
|
||||
id: "shutdown",
|
||||
label: "Shut down",
|
||||
icon: "system-shutdown",
|
||||
glyph: "⏼",
|
||||
command: ["systemctl", "poweroff"],
|
||||
dangerous: true
|
||||
}
|
||||
]
|
||||
|
||||
// Logging out is compositor specific, so detect the running one. Falls back
|
||||
// to asking logind to end the session, which works anywhere.
|
||||
readonly property var sessionQuitCommand: {
|
||||
const desktop = (Quickshell.env("XDG_CURRENT_DESKTOP") || "").toLowerCase();
|
||||
|
||||
if (Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE"))
|
||||
return ["hyprctl", "dispatch", "exit"];
|
||||
if (Quickshell.env("SWAYSOCK") || desktop.includes("sway"))
|
||||
return ["swaymsg", "exit"];
|
||||
if (Quickshell.env("NIRI_SOCKET") || desktop.includes("niri"))
|
||||
return ["niri", "msg", "action", "quit", "--skip-confirmation"];
|
||||
// river 0.4 has no riverctl: the external window manager owns session
|
||||
// exit, and attwm offers it over its socket. Only river-classic (0.3.x)
|
||||
// is the riverctl one.
|
||||
if (desktop.includes("river"))
|
||||
return Attwm.available ? ["attwmctl", "exit-session"] : ["riverctl", "exit"];
|
||||
|
||||
const session = Quickshell.env("XDG_SESSION_ID");
|
||||
return session ? ["loginctl", "terminate-session", session] : ["loginctl", "terminate-session", "self"];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
// Sizing
|
||||
readonly property int barHeight: 40
|
||||
readonly property int radius: 6
|
||||
readonly property int spacing: 4
|
||||
readonly property int padding: 6
|
||||
readonly property int iconSize: 22
|
||||
readonly property int borderWidth: 1
|
||||
|
||||
// Palette
|
||||
readonly property color background: "#14161b"
|
||||
readonly property color surface: "#1c1f26"
|
||||
readonly property color surfaceHover: "#272b34"
|
||||
readonly property color surfaceActive: "#323845"
|
||||
readonly property color border: "#2c313c"
|
||||
readonly property color text: "#d6dae2"
|
||||
readonly property color textDim: "#8b93a3"
|
||||
readonly property color accent: "#6ea8fe"
|
||||
readonly property color danger: "#e4677a"
|
||||
|
||||
// Type
|
||||
readonly property string fontFamily: "sans-serif"
|
||||
readonly property int fontSize: 12
|
||||
readonly property int fontSizeSmall: 10
|
||||
|
||||
// Motion
|
||||
readonly property int animDuration: 110
|
||||
readonly property int animEasing: Easing.OutQuad
|
||||
}
|
||||
Reference in New Issue
Block a user