The installer asks for the language before the keyboard, and Setup > Language (omarchy language en|zh) switches it later. Under zh_CN the menu reads its labels from omarchy-menu.zh-cn.jsonc, the shell from I18nZh.js through I18n.tr, and notifications are worded by their sender through omarchy-text, which reads the same table. User text is never translated.
45 lines
983 B
QML
45 lines
983 B
QML
import QtQuick
|
|
import Quickshell.Io
|
|
import qs.Commons
|
|
import qs.Ui
|
|
|
|
BarIndicator {
|
|
id: root
|
|
|
|
property bool recording: false
|
|
|
|
active: recording
|
|
activeText: ""
|
|
inactiveText: ""
|
|
activeTooltipText: I18n.tr("Stop recording")
|
|
inactiveTooltipText: I18n.tr("Screen Recording")
|
|
|
|
function refresh() {
|
|
if (!root.bar || statusProc.running) return
|
|
statusProc.command = ["omarchy-capture-screenrecording", "--status"]
|
|
statusProc.running = true
|
|
}
|
|
|
|
onBarChanged: refresh()
|
|
Component.onCompleted: refresh()
|
|
|
|
Connections {
|
|
target: root.indicatorHost
|
|
ignoreUnknownSignals: true
|
|
function onRefreshRequested() { root.refresh() }
|
|
}
|
|
|
|
Process {
|
|
id: statusProc
|
|
onExited: function(exitCode) {
|
|
root.recording = exitCode === 0
|
|
}
|
|
}
|
|
|
|
onPressed: function() {
|
|
if (root.bar) {
|
|
root.bar.run(root.recording ? "omarchy-capture-screenrecording --stop-recording" : "omarchy-menu toggle trigger.capture.screenrecord")
|
|
}
|
|
}
|
|
}
|