Compare commits

..

No commits in common. "c48aca3d0c014bd3868ab7db6815cf6700480b2c" and "62ed66e60af658e9f47d1d6539d095909f097c05" have entirely different histories.

6 changed files with 29 additions and 73 deletions

View file

@ -47,13 +47,12 @@ Variants {
Workspaces {
screen: root.screen
Layout.fillHeight: true
Layout.preferredWidth: height
}
// ActiveWindow {
// id: activeWindow
// Layout.preferredWidth: 400
// }
ActiveWindow {
id: activeWindow
Layout.preferredWidth: 400
}
}
// PowerMenu {
@ -95,7 +94,6 @@ Variants {
Clock {
id: clock
color: ShellSettings.colors.active
Layout.leftMargin: 5
}
}
}

View file

@ -6,7 +6,7 @@ import qs
RowLayout {
spacing: 6
visible: Hyprland.workspaces.values.some(ws => ws.monitor === Hyprland.monitorFor(screen))
visible: Hyprland.monitors.values.length != 0
required property var screen

View file

@ -5,7 +5,6 @@ import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import qs
Singleton {
id: root
@ -54,30 +53,10 @@ Singleton {
const height = Math.floor(selection.height);
let position = `${x},${y} ${width}x${height}`;
// i hate javascript
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth();
let day = date.getDay();
let dateString = `${year}-${month}-${day}`;
let hour = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
let timeString = `${hour}:${minutes}:${seconds}`;
let fileName = `screenshot-${dateString}-${timeString}.png`
const path = `${ShellSettings.settings.screenshotPath}/${fileName}`;
console.log(`Screenshot saved to ${path}`);
// take a screenshot with grim, probably a better way to get this path...
let scriptUrl = Qt.resolvedUrl("root:scripts/screenshot.sh").toLocaleString();
let scriptPath = scriptUrl.replace(/^(file:\/{2})/, "");
let path = "/home/koss/Pictures/screenshot.png";
Quickshell.execDetached({
command: ["sh", scriptPath, position, path]
command: ["grim", "-g", position, path]
});
root.windowOpen = false;

View file

@ -9,17 +9,10 @@ Item {
property color overlayColor: "#80000000"
property rect selectionRect: Qt.rect(0, 0, 0, 0)
property point startPosition: Qt.point(0, 0)
property real borderSize: 2
signal areaSelected(rect selection)
// only send signal when selection rectangle has finished
onVisibleChanged: {
if (!visible)
selectionRect.width -= borderSize;
selectionRect.height -= borderSize;
areaSelected(selectionRect);
}
onVisibleChanged: areaSelected(selectionRect)
MouseArea {
id: selectionArea
@ -101,7 +94,7 @@ Item {
id: rectangle
color: "transparent"
border.color: ShellSettings.colors.active_translucent
border.width: root.borderSize
border.width: 2
x: 0
y: 0
width: 0

View file

@ -1,17 +0,0 @@
#!/usr/bin/env sh
# Very basic script for taking a screenshot and then
# copying it the clipboard
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <geometry> <path>"
exit 1
fi
# create directory if doesn't already exist
mkdir -p ~/Pictures
# 1 - Geometry
# 2 - Path
grim -g "$1" $2
wl-copy <$2

View file

@ -6,8 +6,7 @@ import Qt5Compat.GraphicalEffects
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Pipewire
import qs
import qs.widgets
import ".."
Scope {
id: root
@ -21,7 +20,6 @@ Scope {
target: Pipewire.defaultAudioSink?.audio
function onVolumeChanged() {
console.log("Volume Changed, showing OSD.");
root.shouldShowOsd = true;
hideTimer.restart();
}
@ -38,19 +36,21 @@ Scope {
LazyLoader {
active: root.shouldShowOsd
PanelWindow {
implicitWidth: 250
implicitHeight: 50
PopupWindow {
implicitWidth: 50
implicitHeight: 275
color: "transparent"
exclusiveZone: 0
visible: true
mask: Region {}
anchors.bottom: true
margins.bottom: screen.height / 10
StyledRectangle {
// An empty click mask prevents the window from blocking mouse events.
mask: Region {}
Rectangle {
anchors.fill: parent
// radius: 8
radius: 8
color: {
let color = ShellSettings.colors["surface"];
return Qt.rgba(color.r, color.g, color.b, 0.8);
}
RowLayout {
anchors {
@ -69,7 +69,10 @@ Scope {
Layout.fillWidth: true
implicitHeight: 10
radius: 20
color: ShellSettings.colors.inactive
color: {
let color = ShellSettings.colors["inverse_surface"];
return Qt.rgba(color.r, color.g, color.b, 0.5);
}
layer.enabled: true
layer.effect: OpacityMask {
@ -82,7 +85,7 @@ Scope {
}
Rectangle {
color: ShellSettings.colors.active
color: ShellSettings.colors["primary"]
anchors {
left: parent.left
top: parent.top