feat: update bar
This commit is contained in:
1 parent
d503ff7496
commit
b1fee11c33
3 files changed
+42
-13
No files matched your search
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
require("hyprland-gui")
|
require("hyprland-gui")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
--- MONITORS ---
|
--- MONITORS ---
|
||||||
----------------
|
----------------
|
||||||
@@ -28,7 +26,6 @@ local menu = "quickshell ipc call commandPalette toggle"
|
|||||||
local clipboard = "qs ipc call clipboardPicker open"
|
local clipboard = "qs ipc call clipboardPicker open"
|
||||||
local lock = "qs ipc call lockScreen lock"
|
local lock = "qs ipc call lockScreen lock"
|
||||||
|
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
--- AUTOSTART ---
|
--- AUTOSTART ---
|
||||||
-----------------
|
-----------------
|
||||||
@@ -197,13 +194,33 @@ hl.bind(mainMod .. " + W", hl.dsp.exec_cmd("qs ipc call wallpaperSwitcher open")
|
|||||||
hl.bind(mainMod .. " + SHIFT + W", hl.dsp.exec_cmd("qs ipc call wallpaperSwitcher random"))
|
hl.bind(mainMod .. " + SHIFT + W", hl.dsp.exec_cmd("qs ipc call wallpaperSwitcher random"))
|
||||||
|
|
||||||
-- Brightness
|
-- Brightness
|
||||||
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl set 10%+ && quickshell ipc call osd showBrightness"), { locked = true })
|
hl.bind(
|
||||||
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl set 10%- && quickshell ipc call osd showBrightness"), { locked = true })
|
"XF86MonBrightnessUp",
|
||||||
|
hl.dsp.exec_cmd("brightnessctl set 10%+ && quickshell ipc call osd showBrightness"),
|
||||||
|
{ locked = true }
|
||||||
|
)
|
||||||
|
hl.bind(
|
||||||
|
"XF86MonBrightnessDown",
|
||||||
|
hl.dsp.exec_cmd("brightnessctl set 10%- && quickshell ipc call osd showBrightness"),
|
||||||
|
{ locked = true }
|
||||||
|
)
|
||||||
|
|
||||||
-- Media
|
-- Media
|
||||||
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && quickshell ipc call osd showVolume"), { locked = true })
|
hl.bind(
|
||||||
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && quickshell ipc call osd showVolume"), { locked = true })
|
"XF86AudioRaiseVolume",
|
||||||
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && quickshell ipc call osd showVolume"), { locked = true })
|
hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && quickshell ipc call osd showVolume"),
|
||||||
|
{ locked = true }
|
||||||
|
)
|
||||||
|
hl.bind(
|
||||||
|
"XF86AudioLowerVolume",
|
||||||
|
hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && quickshell ipc call osd showVolume"),
|
||||||
|
{ locked = true }
|
||||||
|
)
|
||||||
|
hl.bind(
|
||||||
|
"XF86AudioMute",
|
||||||
|
hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && quickshell ipc call osd showVolume"),
|
||||||
|
{ locked = true }
|
||||||
|
)
|
||||||
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
|
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
|
||||||
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
|
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
|
||||||
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
|
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ PanelWindow {
|
|||||||
WlrLayershell.layer: WlrLayer.Top
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
WlrLayershell.namespace: "quickshell-bar"
|
WlrLayershell.namespace: "quickshell-bar"
|
||||||
|
|
||||||
|
// The clock and tray only make sense once, so they live on whichever
|
||||||
|
// monitor the mouse currently sits on (Hyprland's focused monitor
|
||||||
|
// follows the cursor), rather than being duplicated on every screen.
|
||||||
|
readonly property bool isFocusedMonitor: Hyprland.focusedMonitor && Hyprland.focusedMonitor.name === screen.name
|
||||||
|
|
||||||
// Left Pill (Workspaces) - tinted with the primary accent.
|
// Left Pill (Workspaces) - tinted with the primary accent.
|
||||||
Pill {
|
Pill {
|
||||||
id: leftPill
|
id: leftPill
|
||||||
@@ -56,7 +61,7 @@ PanelWindow {
|
|||||||
Row {
|
Row {
|
||||||
spacing: Theme.geometry.spacing
|
spacing: Theme.geometry.spacing
|
||||||
Repeater {
|
Repeater {
|
||||||
model: Hyprland.workspaces.values
|
model: Hyprland.workspaces.values.filter(ws => ws.monitor && ws.monitor.name === barWindow.screen.name)
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
width: 24
|
width: 24
|
||||||
@@ -88,6 +93,7 @@ PanelWindow {
|
|||||||
// Center Pill (Clock) - tinted with the secondary accent.
|
// Center Pill (Clock) - tinted with the secondary accent.
|
||||||
Pill {
|
Pill {
|
||||||
id: centerPill
|
id: centerPill
|
||||||
|
visible: barWindow.isFocusedMonitor
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
height: parent.height
|
height: parent.height
|
||||||
@@ -113,6 +119,7 @@ PanelWindow {
|
|||||||
// color so the pill reads as a set of distinct signals, not one blob.
|
// color so the pill reads as a set of distinct signals, not one blob.
|
||||||
Pill {
|
Pill {
|
||||||
id: rightPill
|
id: rightPill
|
||||||
|
visible: barWindow.isFocusedMonitor
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|||||||
@@ -90,10 +90,15 @@ ShellRoot {
|
|||||||
id: trayTooltip
|
id: trayTooltip
|
||||||
}
|
}
|
||||||
|
|
||||||
Bar {
|
Variants {
|
||||||
id: bar
|
model: Quickshell.screens
|
||||||
rootState: root
|
|
||||||
trayTooltip: trayTooltip
|
Bar {
|
||||||
|
required property var modelData
|
||||||
|
screen: modelData
|
||||||
|
rootState: root
|
||||||
|
trayTooltip: trayTooltip
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandPalette {
|
CommandPalette {
|
||||||
|
|||||||
Reference in new issue
Block a user