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")
|
||||
|
||||
|
||||
|
||||
----------------
|
||||
--- MONITORS ---
|
||||
----------------
|
||||
@@ -28,7 +26,6 @@ local menu = "quickshell ipc call commandPalette toggle"
|
||||
local clipboard = "qs ipc call clipboardPicker open"
|
||||
local lock = "qs ipc call lockScreen lock"
|
||||
|
||||
|
||||
-----------------
|
||||
--- 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"))
|
||||
|
||||
-- Brightness
|
||||
hl.bind("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 })
|
||||
hl.bind(
|
||||
"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
|
||||
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("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(
|
||||
"XF86AudioRaiseVolume",
|
||||
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("XF86AudioPlay", 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.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.
|
||||
Pill {
|
||||
id: leftPill
|
||||
@@ -56,7 +61,7 @@ PanelWindow {
|
||||
Row {
|
||||
spacing: Theme.geometry.spacing
|
||||
Repeater {
|
||||
model: Hyprland.workspaces.values
|
||||
model: Hyprland.workspaces.values.filter(ws => ws.monitor && ws.monitor.name === barWindow.screen.name)
|
||||
|
||||
delegate: Rectangle {
|
||||
width: 24
|
||||
@@ -88,6 +93,7 @@ PanelWindow {
|
||||
// Center Pill (Clock) - tinted with the secondary accent.
|
||||
Pill {
|
||||
id: centerPill
|
||||
visible: barWindow.isFocusedMonitor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: parent.height
|
||||
@@ -113,6 +119,7 @@ PanelWindow {
|
||||
// color so the pill reads as a set of distinct signals, not one blob.
|
||||
Pill {
|
||||
id: rightPill
|
||||
visible: barWindow.isFocusedMonitor
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: parent.height
|
||||
|
||||
@@ -90,10 +90,15 @@ ShellRoot {
|
||||
id: trayTooltip
|
||||
}
|
||||
|
||||
Bar {
|
||||
id: bar
|
||||
rootState: root
|
||||
trayTooltip: trayTooltip
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
Bar {
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
rootState: root
|
||||
trayTooltip: trayTooltip
|
||||
}
|
||||
}
|
||||
|
||||
CommandPalette {
|
||||
|
||||
Reference in new issue
Block a user