forked from Shinonome/dots-hyprland
bar: add keybind to toggle (super+j)
This commit is contained in:
@@ -30,6 +30,7 @@ bindd = Super, Slash, Toggle cheatsheet, global, quickshell:cheatsheetToggle # T
|
|||||||
bindd = Super, K, Toggle on-screen keyboard, global, quickshell:oskToggle # Toggle on-screen keyboard
|
bindd = Super, K, Toggle on-screen keyboard, global, quickshell:oskToggle # Toggle on-screen keyboard
|
||||||
bindd = Super, M, Toggle media controls, global, quickshell:mediaControlsToggle # Toggle media controls
|
bindd = Super, M, Toggle media controls, global, quickshell:mediaControlsToggle # Toggle media controls
|
||||||
bindd = Ctrl+Alt, Delete, Toggle session menu, global, quickshell:sessionToggle # Toggle session menu
|
bindd = Ctrl+Alt, Delete, Toggle session menu, global, quickshell:sessionToggle # Toggle session menu
|
||||||
|
bindd = Super, J, Toggle bar, global, quickshell:barToggle # Toggle bar
|
||||||
bind = Ctrl+Alt, Delete, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill wlogout || wlogout -p layer-shell # [hidden] Session menu (fallback)
|
bind = Ctrl+Alt, Delete, exec, qs -c $qsConfig ipc call TEST_ALIVE || pkill wlogout || wlogout -p layer-shell # [hidden] Session menu (fallback)
|
||||||
bind = Shift+Super+Alt, Slash, exec, qs -p ~/.config/quickshell/$qsConfig/welcome.qml # [hidden] Launch welcome app
|
bind = Shift+Super+Alt, Slash, exec, qs -p ~/.config/quickshell/$qsConfig/welcome.qml # [hidden] Launch welcome app
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ pragma ComponentBehavior: Bound
|
|||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
property bool barOpen: true
|
||||||
property bool sidebarLeftOpen: false
|
property bool sidebarLeftOpen: false
|
||||||
property bool sidebarRightOpen: false
|
property bool sidebarRightOpen: false
|
||||||
property bool overviewOpen: false
|
property bool overviewOpen: false
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
@@ -36,13 +37,15 @@ Scope {
|
|||||||
return screens;
|
return screens;
|
||||||
return screens.filter(screen => list.includes(screen.name));
|
return screens.filter(screen => list.includes(screen.name));
|
||||||
}
|
}
|
||||||
|
Loader {
|
||||||
PanelWindow { // Bar window
|
id: barLoader
|
||||||
id: barRoot
|
active: GlobalStates.barOpen
|
||||||
required property ShellScreen modelData
|
required property ShellScreen modelData
|
||||||
screen: modelData
|
sourceComponent: PanelWindow { // Bar window
|
||||||
|
id: barRoot
|
||||||
|
screen: barLoader.modelData
|
||||||
|
|
||||||
property var brightnessMonitor: Brightness.getMonitorForScreen(modelData)
|
property var brightnessMonitor: Brightness.getMonitorForScreen(barLoader.modelData)
|
||||||
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0
|
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0
|
||||||
readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth
|
readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth
|
||||||
|
|
||||||
@@ -530,6 +533,7 @@ Scope {
|
|||||||
|
|
||||||
size: Appearance.rounding.screenRounding
|
size: Appearance.rounding.screenRounding
|
||||||
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
|
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
|
||||||
|
opacity: 1.0 - Appearance.transparency
|
||||||
|
|
||||||
corner: RoundCorner.CornerEnum.TopLeft
|
corner: RoundCorner.CornerEnum.TopLeft
|
||||||
states: State {
|
states: State {
|
||||||
@@ -549,6 +553,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
size: Appearance.rounding.screenRounding
|
size: Appearance.rounding.screenRounding
|
||||||
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
|
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
|
||||||
|
opacity: 1.0 - Appearance.transparency
|
||||||
|
|
||||||
corner: RoundCorner.CornerEnum.TopRight
|
corner: RoundCorner.CornerEnum.TopRight
|
||||||
states: State {
|
states: State {
|
||||||
@@ -564,3 +569,47 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IpcHandler {
|
||||||
|
target: "bar"
|
||||||
|
|
||||||
|
function toggle(): void {
|
||||||
|
GlobalStates.barOpen = !GlobalStates.barOpen
|
||||||
|
}
|
||||||
|
|
||||||
|
function close(): void {
|
||||||
|
GlobalStates.barOpen = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function open(): void {
|
||||||
|
GlobalStates.barOpen = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "barToggle"
|
||||||
|
description: qsTr("Toggles bar on press")
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
GlobalStates.barOpen = !GlobalStates.barOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "barOpen"
|
||||||
|
description: qsTr("Opens bar on press")
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
GlobalStates.barOpen = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
name: "barClose"
|
||||||
|
description: qsTr("Closes bar on press")
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
GlobalStates.barOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user