Added issue templates and fixed screenRecorder status symbol
ScreenRecorder: add proper checks for screenRecorder ISSUE_TEMPLATE: add bug_report and feature_request
This commit is contained in:
parent
ae0228dc25
commit
6f7528c87a
4 changed files with 129 additions and 13 deletions
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: Report a bug from noctalia-shell
|
||||||
|
title: "[Bug]: "
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
### Description
|
||||||
|
A clear and concise description of the bug.
|
||||||
|
|
||||||
|
### Steps to Reproduce
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '...'
|
||||||
|
3. See the error.
|
||||||
|
|
||||||
|
### Expected Behavior
|
||||||
|
Explain what you expected to happen.
|
||||||
|
|
||||||
|
### Screenshots
|
||||||
|
Add screenshots if applicable.
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
- Distro [e.g., CachyOS, NixOS, Arch, ...]
|
||||||
|
- Compositor [ e.g., Hyprland, Niri, ...]
|
||||||
|
- Version: [e.g., 1.0.0 or `main`]
|
||||||
|
|
||||||
|
### Additional Context
|
||||||
|
Add any other context about the problem here.
|
||||||
12
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
12
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
blank_issues_enabled: false
|
||||||
|
issue_templates:
|
||||||
|
- name: "Bug Report"
|
||||||
|
description: "Report a bug in the system."
|
||||||
|
title: "[Bug]: "
|
||||||
|
labels: ["bug"]
|
||||||
|
body: "./ISSUE_TEMPLATE/bug_report.md"
|
||||||
|
- name: "Feature Request"
|
||||||
|
description: "Propose a new feature or improvement."
|
||||||
|
title: "[Feature]: "
|
||||||
|
labels: ["enhancement"]
|
||||||
|
body: "./ISSUE_TEMPLATE/feature_request.md"
|
||||||
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
name: Feature Request
|
||||||
|
about: Suggest a new feature or improvement
|
||||||
|
title: "[Feature]: "
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
### Feature Description
|
||||||
|
What feature would you like to see?
|
||||||
|
|
||||||
|
### Why Is This Needed?
|
||||||
|
Explain the problem or need for this feature.
|
||||||
|
|
||||||
|
### Suggested Solutions
|
||||||
|
Describe how this feature could be implemented.
|
||||||
|
|
||||||
|
### Additional Context
|
||||||
|
Add any relevant screenshots, links, or resources.
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import qs.Commons
|
import qs.Commons
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
|
|
@ -10,19 +10,20 @@ Singleton {
|
||||||
|
|
||||||
readonly property var settings: Settings.data.screenRecorder
|
readonly property var settings: Settings.data.screenRecorder
|
||||||
property bool isRecording: false
|
property bool isRecording: false
|
||||||
|
property bool isPending: false
|
||||||
property string outputPath: ""
|
property string outputPath: ""
|
||||||
|
|
||||||
// Start or Stop recording
|
// Start or Stop recording
|
||||||
function toggleRecording() {
|
function toggleRecording() {
|
||||||
isRecording ? stopRecording() : startRecording()
|
(isRecording || isPending) ? stopRecording() : startRecording()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start screen recording using Quickshell.execDetached
|
// Start screen recording using Quickshell.execDetached
|
||||||
function startRecording() {
|
function startRecording() {
|
||||||
if (isRecording) {
|
if (isRecording || isPending) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
isRecording = true
|
isPending = true
|
||||||
|
|
||||||
var filename = Time.getFormattedTimestamp() + ".mp4"
|
var filename = Time.getFormattedTimestamp() + ".mp4"
|
||||||
var videoDir = settings.directory
|
var videoDir = settings.directory
|
||||||
|
|
@ -43,23 +44,78 @@ Singleton {
|
||||||
notify-send "gpu-screen-recorder not installed!" -u critical
|
notify-send "gpu-screen-recorder not installed!" -u critical
|
||||||
fi`
|
fi`
|
||||||
|
|
||||||
//Logger.log("ScreenRecorder", command)
|
// Use Process instead of execDetached so we can monitor it
|
||||||
Quickshell.execDetached(["sh", "-c", command])
|
recorderProcess.exec({
|
||||||
Logger.log("ScreenRecorder", "Started recording")
|
command: ["sh", "-c", command]
|
||||||
|
})
|
||||||
|
|
||||||
|
// Start monitoring - if process ends quickly, it was likely cancelled
|
||||||
|
pendingTimer.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop recording using Quickshell.execDetached
|
// Stop recording using Quickshell.execDetached
|
||||||
function stopRecording() {
|
function stopRecording() {
|
||||||
if (!isRecording) {
|
if (!isRecording && !isPending) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder'"])
|
Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder' || pkill -SIGINT -f 'com.dec05eba.gpu_screen_recorder'"])
|
||||||
Logger.log("ScreenRecorder", "Finished recording:", outputPath)
|
|
||||||
|
isRecording = false
|
||||||
|
isPending = false
|
||||||
|
pendingTimer.running = false
|
||||||
|
monitorTimer.running = false
|
||||||
|
|
||||||
// Just in case, force kill after 3 seconds
|
// Just in case, force kill after 3 seconds
|
||||||
killTimer.running = true
|
killTimer.running = true
|
||||||
isRecording = false
|
}
|
||||||
|
|
||||||
|
// Process to run and monitor gpu-screen-recorder
|
||||||
|
Process {
|
||||||
|
id: recorderProcess
|
||||||
|
onExited: function(exitCode, exitStatus) {
|
||||||
|
if (isPending) {
|
||||||
|
// Process ended while we were pending - likely cancelled or error
|
||||||
|
isPending = false
|
||||||
|
pendingTimer.running = false
|
||||||
|
} else if (isRecording) {
|
||||||
|
// Process ended normally while recording
|
||||||
|
isRecording = false
|
||||||
|
monitorTimer.running = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: pendingTimer
|
||||||
|
interval: 2000 // Wait 2 seconds to see if process stays alive
|
||||||
|
running: false
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
if (isPending && recorderProcess.running) {
|
||||||
|
// Process is still running after 2 seconds - assume recording started successfully
|
||||||
|
isPending = false
|
||||||
|
isRecording = true
|
||||||
|
monitorTimer.running = true
|
||||||
|
} else if (isPending) {
|
||||||
|
// Process not running anymore - was cancelled or failed
|
||||||
|
isPending = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Monitor timer to periodically check if we're still recording
|
||||||
|
Timer {
|
||||||
|
id: monitorTimer
|
||||||
|
interval: 2000
|
||||||
|
running: false
|
||||||
|
repeat: true
|
||||||
|
onTriggered: {
|
||||||
|
if (!recorderProcess.running && isRecording) {
|
||||||
|
isRecording = false
|
||||||
|
running = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
@ -68,7 +124,7 @@ Singleton {
|
||||||
running: false
|
running: false
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Quickshell.execDetached(["sh", "-c", "pkill -9 -f 'gpu-screen-recorder' 2>/dev/null || true"])
|
Quickshell.execDetached(["sh", "-c", "pkill -9 -f 'gpu-screen-recorder' 2>/dev/null || pkill -9 -f 'com.dec05eba.gpu_screen_recorder' 2>/dev/null || true"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue