Compare commits
6 Commits
83f48b3403
...
160ae56e03
| Author | SHA1 | Date | |
|---|---|---|---|
| 160ae56e03 | |||
| d178e340b4 | |||
| e2ec5cae11 | |||
| d9261385de | |||
| b0c84b9b27 | |||
| d036eb2512 |
@@ -1,14 +0,0 @@
|
|||||||
{ config, lib, ... }: {
|
|
||||||
|
|
||||||
options.homeconfig.quickshell.enable = with lib; mkOption {
|
|
||||||
type = with types; bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.homeconfig.quickshell.enable {
|
|
||||||
|
|
||||||
programs.quickshell = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Services.UPower
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
width: 100; height: 30
|
||||||
|
color: "red"
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " " + Math.floor(UPower.displayDevice.percentage * 100) + "%"
|
||||||
|
font.pointSize: 12
|
||||||
|
implicitHeight: parent.height
|
||||||
|
//icon.color: "red"
|
||||||
|
//icon.source: "/nix/store/c4dcn4vl0v5njv4d587sazrad1xgyd9h-rose-pine-icon-theme-unstable-2022-09-01/share/icons/rose-pine/symbolic/devices/battery-symbolic.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
implicitWidth: 30; implicitHeight: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: ""
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: launcher
|
||||||
|
running: false
|
||||||
|
command: ["rofi", "-show", "drun"]
|
||||||
|
}
|
||||||
|
onClicked: launcher.running = true
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 250
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
anchors.fill: parent
|
||||||
|
Button {
|
||||||
|
text: Qt.formatDateTime(clock.date, "dddd HH:mm:ss MM/dd/yyyy")
|
||||||
|
font.pointSize: 11
|
||||||
|
|
||||||
|
SystemClock {
|
||||||
|
id: clock
|
||||||
|
precision: SystemClock.Seconds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
width: 30; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " "
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: launcher
|
||||||
|
running: false
|
||||||
|
command: ["rofi", "-show", "drun"]
|
||||||
|
}
|
||||||
|
onClicked: launcher.running = true
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Services.Mpris
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: media
|
||||||
|
width: 250 > 9 * button.text.length ? 250 : 9 * button.text.length
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
anchors.fill: parent
|
||||||
|
Button {
|
||||||
|
|
||||||
|
id: button
|
||||||
|
|
||||||
|
property real offset: 0
|
||||||
|
text: {
|
||||||
|
let s = ''
|
||||||
|
let players = []
|
||||||
|
|
||||||
|
Mpris.players.values.forEach((p) => {
|
||||||
|
if(p.isPlaying) players.push(p)
|
||||||
|
})
|
||||||
|
|
||||||
|
if(players[0]?.trackTitle) {
|
||||||
|
s += players[0].trackTitle
|
||||||
|
}
|
||||||
|
if(players[0]?.trackAlbum) {
|
||||||
|
s += ' - ' + players[0].trackAlbum
|
||||||
|
}
|
||||||
|
if(players[0]?.trackArtist) {
|
||||||
|
s += ' - ' + players[0].trackArtist
|
||||||
|
}
|
||||||
|
|
||||||
|
let a = offset % s.length
|
||||||
|
let b = (offset + s.length - 1) % s.length
|
||||||
|
|
||||||
|
if(s == '')
|
||||||
|
media.visible = false
|
||||||
|
else
|
||||||
|
media.visible = true
|
||||||
|
if(b < a) {
|
||||||
|
return s.substring(a, s.length) + ' ' + s.substring(0, b)
|
||||||
|
} else {
|
||||||
|
return s.substring(a, b) + ' '
|
||||||
|
}
|
||||||
|
//return s
|
||||||
|
}
|
||||||
|
font.pointSize: 11
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 225
|
||||||
|
|
||||||
|
running: true
|
||||||
|
|
||||||
|
repeat: true
|
||||||
|
|
||||||
|
onTriggered: button.offset = (button.offset + 1) % (2 * button.text.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
width: 30; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: ""
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: launcher
|
||||||
|
running: false
|
||||||
|
command: ["rofi", "-show", "drun"]
|
||||||
|
}
|
||||||
|
onClicked: launcher.running = true
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
width: 30; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " "
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: launcher
|
||||||
|
running: false
|
||||||
|
command: ["rofi", "-show", "drun"]
|
||||||
|
}
|
||||||
|
onClicked: launcher.running = true
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Services.SystemTray
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 10 + rep.count * (2 * lay.spacing + 20)
|
||||||
|
height: 30
|
||||||
|
visible: SystemTray.items.values.length != 0
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
anchors.fill: parent
|
||||||
|
RowLayout {
|
||||||
|
id: lay
|
||||||
|
spacing: 4
|
||||||
|
Repeater {
|
||||||
|
id: rep
|
||||||
|
|
||||||
|
model: SystemTray.items
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
radius: 10
|
||||||
|
implicitWidth: 20
|
||||||
|
implicitHeight: 20
|
||||||
|
AbstractButton {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: {
|
||||||
|
let icon = SystemTray.items.values[index].icon
|
||||||
|
if (icon.includes("?path=")) {
|
||||||
|
const [name, path] = icon.split("?path=");
|
||||||
|
icon = Qt.resolvedUrl(`${path}/${name.slice(name.lastIndexOf("/") + 1)}`);
|
||||||
|
}
|
||||||
|
return icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: console.log('clicked!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Services.Pipewire
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
width: 100; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " " + Math.floor(Pipewire.defaultAudioSink?.audio?.volume * 100) + "%"
|
||||||
|
font.pointSize: 12
|
||||||
|
implicitHeight: parent.height
|
||||||
|
|
||||||
|
PwObjectTracker {
|
||||||
|
objects: [ Pipewire.defaultAudioSink ]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
implicitWidth: 30
|
||||||
|
implicitHeight: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
anchors.fill: parent
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " "
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: launcher
|
||||||
|
running: false
|
||||||
|
command: ["rofi", "-show", "drun"]
|
||||||
|
}
|
||||||
|
onClicked: launcher.running = true
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 10 + rep.count * (2 * lay.spacing + 25)
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
anchors.fill: parent
|
||||||
|
RowLayout {
|
||||||
|
id: lay
|
||||||
|
Repeater {
|
||||||
|
id: rep
|
||||||
|
|
||||||
|
property var test: {
|
||||||
|
let arr = [];
|
||||||
|
Hyprland.workspaces.values.forEach((w) => { if(w.id > 0) arr.push(w) })
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
model: this.test
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
radius: 10
|
||||||
|
implicitWidth: 25
|
||||||
|
Button {
|
||||||
|
background: Rectangle {
|
||||||
|
color: Hyprland.focusedWorkspace.id == rep.test[index].id ? "#ffff00ff" : "#ff251555"
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
text: rep.test[index].id
|
||||||
|
onClicked: rep.test[index].activate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
78
home-manager/users/nathan/dotfiles/quickshell/shell.qml
Normal file
78
home-manager/users/nathan/dotfiles/quickshell/shell.qml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||||
|
//@ pragma Env QSG_RENDER_LOOP=threaded
|
||||||
|
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
|
||||||
|
|
||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import qs.modules
|
||||||
|
|
||||||
|
ShellRoot {
|
||||||
|
PanelWindow {
|
||||||
|
anchors {
|
||||||
|
top: true
|
||||||
|
//left: true
|
||||||
|
//right: true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
WlrLayershell.layer: WlrLayer.Background
|
||||||
|
|
||||||
|
color: "#a0706050"
|
||||||
|
|
||||||
|
|
||||||
|
implicitHeight: 40
|
||||||
|
implicitWidth: 1900
|
||||||
|
|
||||||
|
Flow {
|
||||||
|
x: 0
|
||||||
|
padding: 5
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Launcher { id: l }
|
||||||
|
|
||||||
|
Workspaces { id: ws }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
x: (parent.width - cl.width) / 2 + parent.x - cl.x
|
||||||
|
y: parent.y + (parent.height - height) / 2
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Volume { id: v }
|
||||||
|
|
||||||
|
Battery { id: bat }
|
||||||
|
|
||||||
|
Clock { id: cl }
|
||||||
|
|
||||||
|
Wifi { id: wifi }
|
||||||
|
|
||||||
|
Bluetooth { id: bt }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Flow {
|
||||||
|
x: parent.width + parent.x - width
|
||||||
|
padding: 5
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
|
||||||
|
Media { id: media }
|
||||||
|
|
||||||
|
Tray { id: tray }
|
||||||
|
|
||||||
|
Notifications { id: notif }
|
||||||
|
|
||||||
|
Power { id: power }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
xfce.thunar
|
xfce.thunar
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
blueberry
|
blueberry
|
||||||
lxqt.lxqt-policykit
|
pkgs-us.quickshell
|
||||||
] else []) ++ (if !config.homeconfig.minimal then [
|
] else []) ++ (if !config.homeconfig.minimal then [
|
||||||
cava
|
cava
|
||||||
android-tools
|
android-tools
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
home-manager.users.nathan.wayland.windowManager.hyprland.extraConfig = lib.mkIf (config.specialisation != {}) ''
|
home-manager.users.nathan.wayland.windowManager.hyprland.extraConfig = lib.mkIf (config.specialisation != {}) ''
|
||||||
monitor=eDP-1,1920x1080@60,0x0,1
|
monitor=eDP-1,1920x1080@60,0x0,1
|
||||||
|
monitor=eDP-1, addreserved, 40,0,0,0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
@@ -106,7 +107,6 @@
|
|||||||
firefox.enable = true;
|
firefox.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
nh.enable = true;
|
nh.enable = true;
|
||||||
quickshell.enable = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user