Compare commits

..

7 Commits

5 changed files with 31 additions and 46 deletions

View File

@@ -36,8 +36,10 @@ PanelWindow {
} }
Pill { Pill {
id: volume
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: music.left anchors.right: parent.right
anchors.rightMargin: 10 anchors.rightMargin: 10
Volume {} Volume {}
} }
@@ -45,21 +47,10 @@ PanelWindow {
Pill { Pill {
id: music id: music
anchors.right: tray.left anchors.right: volume.left
anchors.rightMargin: 10 anchors.rightMargin: 10
Music { Music {
player: Mpris.players.values.find(e => e.identity == "Spotify") player: Mpris.players.values.find(e => e.identity == "Spotify")
} }
} }
// Pill {
// id: tray
//
// anchors.right: parent.right
// anchors.rightMargin: 10
//
// SystemTray {
//
// }
// }
} }

View File

@@ -5,6 +5,7 @@ import QtQuick.Controls
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Io import Quickshell.Io
import "root:/singeltons" import "root:/singeltons"
import "root:/utils"
PanelWindow { PanelWindow {
id: root id: root
@@ -20,10 +21,10 @@ PanelWindow {
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.layer: WlrLayer.Top WlrLayershell.layer: WlrLayer.Top
IpcHandler { CustomShortcut {
target: "launcher" name: "openLauncher"
description: "Open launcher"
function open(): void {root.show = true; } onPressed: {root.show = true; }
} }
// Main window // Main window
@@ -64,6 +65,7 @@ PanelWindow {
case (Qt.Key_Escape): case (Qt.Key_Escape):
root.show = false root.show = false
event.accepted = true event.accepted = true
searchInput.clear()
break break
case (Qt.Key_Return): case (Qt.Key_Return):
case (Qt.Key_Enter): case (Qt.Key_Enter):
@@ -73,6 +75,7 @@ PanelWindow {
} }
root.show = false root.show = false
event.accepted = true event.accepted = true
searchInput.clear()
break break
case (Qt.Key_Down): case (Qt.Key_Down):
case (Qt.Key_Tab): case (Qt.Key_Tab):

View File

@@ -5,6 +5,7 @@ import QtQuick.Controls
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Io import Quickshell.Io
import "root:/singeltons" import "root:/singeltons"
import "root:/utils"
PanelWindow { PanelWindow {
id: root id: root
@@ -23,43 +24,28 @@ PanelWindow {
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.layer: WlrLayer.Top WlrLayershell.layer: WlrLayer.Top
IpcHandler { CustomShortcut {
target: "powermenu" name: "openPowermenu"
description: "Open powermenu"
function open(): void { onPressed: {root.show = true; }
root.selectedIndex = 0
root.show = true
}
function close(): void {
root.show = false
}
} }
function executeButton(index){ function executeButton(index){
switch (index){ switch (index){
case 0: case 0:
console.log("0") Quickshell.execDetached(["systemctl", "poweroff"])
// systemctl poweroff
break break
case 1: case 1:
console.log("1") Quickshell.execDetached(["systemctl", "reboot"])
// systemctl reboot
break break
case 2: case 2:
console.log("2") Quickshell.execDetached(["loginctl", "lock-session"])
// loginctl lock-session
break break
case 3: case 3:
console.log("3") Quickshell.execDetached(["hyprctl", "dispatch", "exit"])
// if [[ "$XDG_CURRENT_DESKTOP" == 'Hyprland' ]]; then
// ${pkgs.hyprland}/bin/hyprctl dispatch exit
// fi
break break
case 4: case 4:
console.log("4") Quickshell.execDetached(["sh", "-c", "boot-windows && systemctl reboot"])
// boot-windows
// systemctl reboot
break break
} }
} }

View File

@@ -5,11 +5,11 @@ import "./bar"
import "./launcher/" import "./launcher/"
ShellRoot{ ShellRoot{
Variants{ // Variants{
model: Quickshell.screens // model: Quickshell.screens
//
ActivateLinux {} // ActivateLinux {}
} // }
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens

5
utils/CustomShortcut.qml Normal file
View File

@@ -0,0 +1,5 @@
import Quickshell.Hyprland
GlobalShortcut {
appid: "quickshell"
}