toggleable sidebar

This commit is contained in:
end-4 2025-04-13 17:07:32 +02:00
parent 248ff831ab
commit a139c29a2b
3 changed files with 32 additions and 6 deletions

View file

@ -59,6 +59,7 @@ bind = Super, Down, movefocus, d # [hidden]
bind = Super, BracketLeft, movefocus, l # [hidden]
bind = Super, BracketRight, movefocus, r # [hidden]
bindm = Super, mouse:272, movewindow
bindm = Super, mouse:274, movewindow
bindm = Super, mouse:273, resizewindow
bind = Super, Q, killactive,
bind = Super+Shift+Alt, Q, exec, hyprctl kill # Pick and kill a window
@ -163,9 +164,9 @@ bindir = Super, Super_L, exec, agsv1 -t 'overview' # Toggle overview/launcher
bind = Super, Tab, exec, agsv1 -t 'overview' # [hidden]
bind = Super, Slash, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++)); do agsv1 -t "cheatsheet""$i"; done # Show cheatsheet
bind = Super, B, exec, agsv1 -t 'sideleft' # Toggle left sidebar
bind = Super, A, exec, agsv1 -t 'sideleft' # [hidden]
bind = Super, O, exec, agsv1 -t 'sideleft' # [hidden]
bind = Super, N, exec, agsv1 -t 'sideright' # Toggle right sidebar
bind = Super, A, exec, qs ipc call sidebarLeft toggle || agsv1 -t 'sideleft' # [hidden]
bind = Super, O, exec, qs ipc call sidebarLeft toggle || agsv1 -t 'sideleft' # [hidden]
bind = Super, N, exec, qs ipc call sidebarRight toggle || agsv1 -t 'sideright' # Toggle right sidebar
bind = Super, M, exec, agsv1 run-js 'openMusicControls.value = (!mpris.getPlayer() ? false : !openMusicControls.value);' # Toggle music controls
bind = Super, Comma, exec, agsv1 run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);' # View color scheme and options
bind = Super, K, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++)); do agsv1 -t "osk""$i"; done # Toggle on-screen keyboard

View file

@ -3,7 +3,9 @@ import "../common/widgets"
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import Quickshell
import Quickshell.Wayland
Scope {
id: bar
@ -14,13 +16,15 @@ Scope {
model: Quickshell.screens
PanelWindow {
id: barRoot
id: sidebarRoot
visible: false
property var modelData
screen: modelData
exclusiveZone: 0
width: sidebarWidth
WlrLayershell.namespace: "quickshell:sidebarRight"
color: "transparent"
anchors {
@ -32,6 +36,7 @@ Scope {
// Background
Rectangle {
id: sidebarRightBackground
anchors.centerIn: parent
width: parent.width - Appearance.sizes.hyprlandGapsOut * 2
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
@ -39,6 +44,25 @@ Scope {
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
}
// Shadow
// DropShadow {
// anchors.fill: sideRightBackground
// horizontalOffset: 0
// verticalOffset: 2
// radius: 3
// samples: 17
// color: Appearance.m3colors.m3shadow
// source: sideRightBackground
// }
IpcHandler {
target: "sidebarRight"
function toggle(): void {
sidebarRoot.visible = !sidebarRoot.visible
}
}
}
}

View file

@ -13,8 +13,9 @@ ShellRoot {
Bar {
}
// SidebarRight {
// }
SidebarRight {
}
ScreenCorners {
}
}