qs: should have been fixed...
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png"
|
screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png"
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
render-drm-device "/dev/dri/renderD128"
|
render-drm-device "/dev/dri/renderD129"
|
||||||
}
|
}
|
||||||
|
|
||||||
// gestures {
|
// gestures {
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
|
environment {
|
||||||
|
__NV_PRIME_RENDER_OFFLOAD "1"
|
||||||
|
__VK_LAYER_NV_optimus "NVIDIA_only"
|
||||||
|
__GLX_VENDOR_LIBRARY_NAME "nvidia"
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import QtQuick
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import qs.Constants
|
import qs.Constants
|
||||||
|
import qs.Services
|
||||||
import qs.Utils
|
import qs.Utils
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
@@ -75,20 +76,37 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setColor(name, value) {
|
function setColor(name, value) {
|
||||||
if (!adapter.colors)
|
let state = ShellState.colorState;
|
||||||
adapter.colors = {
|
state[name] = value;
|
||||||
};
|
ShellState.colorState = state;
|
||||||
|
|
||||||
adapter.colors[name] = value;
|
|
||||||
colorFile.writeAdapter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsetColor(name) {
|
function unsetColor(name) {
|
||||||
if (!adapter.colors || !(name in adapter.colors))
|
let state = ShellState.colorState;
|
||||||
return ;
|
delete state[name];
|
||||||
|
ShellState.colorState = state;
|
||||||
|
}
|
||||||
|
|
||||||
delete adapter.colors[name];
|
Component.onCompleted: {
|
||||||
colorFile.writeAdapter();
|
reloadColors(ShellState.colorState);
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: ShellState
|
||||||
|
onColorStateChanged: {
|
||||||
|
reloadTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: reloadTimer
|
||||||
|
|
||||||
|
interval: 500
|
||||||
|
running: false
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
reloadColors(ShellState.colorState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
@@ -118,38 +136,4 @@ Singleton {
|
|||||||
readonly property color mLavender: "#b4befe"
|
readonly property color mLavender: "#b4befe"
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
|
||||||
id: colorFile
|
|
||||||
|
|
||||||
path: Paths.configDir + "colors.json"
|
|
||||||
printErrors: false
|
|
||||||
watchChanges: true
|
|
||||||
onFileChanged: reload()
|
|
||||||
|
|
||||||
JsonAdapter {
|
|
||||||
id: adapter
|
|
||||||
|
|
||||||
property var colors: ({
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onColorsChanged() {
|
|
||||||
colorReloadTimer.restart();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: adapter
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: colorReloadTimer
|
|
||||||
|
|
||||||
interval: 50
|
|
||||||
running: true
|
|
||||||
repeat: false
|
|
||||||
onTriggered: reloadColors(adapter.colors)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ Singleton {
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
previewPath = ""; // clear preview path
|
previewPath = ""; // clear preview path
|
||||||
|
cachedPath = ""; // clear cached path
|
||||||
ImageCacheService.checkFileExists(path, function(exists) {
|
ImageCacheService.checkFileExists(path, function(exists) {
|
||||||
if (!exists)
|
if (!exists)
|
||||||
return ;
|
return ;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ Singleton {
|
|||||||
property alias leftSiderbarTab: adapter.leftSiderbarTab
|
property alias leftSiderbarTab: adapter.leftSiderbarTab
|
||||||
property alias rightSiderbarTab: adapter.rightSiderbarTab
|
property alias rightSiderbarTab: adapter.rightSiderbarTab
|
||||||
property alias wifiEnabled: adapter.wifiEnabled
|
property alias wifiEnabled: adapter.wifiEnabled
|
||||||
|
property alias colorState: adapter.colorState
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
saveTimer.restart();
|
saveTimer.restart();
|
||||||
@@ -27,6 +28,7 @@ Singleton {
|
|||||||
onLeftSiderbarTabChanged: save()
|
onLeftSiderbarTabChanged: save()
|
||||||
onRightSiderbarTabChanged: save()
|
onRightSiderbarTabChanged: save()
|
||||||
onWifiEnabledChanged: save()
|
onWifiEnabledChanged: save()
|
||||||
|
onColorStateChanged: save()
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
stateFileView.path = stateFile;
|
stateFileView.path = stateFile;
|
||||||
}
|
}
|
||||||
@@ -58,6 +60,8 @@ Singleton {
|
|||||||
property string leftSiderbarTab: "bluetooth"
|
property string leftSiderbarTab: "bluetooth"
|
||||||
property string rightSiderbarTab: "notes"
|
property string rightSiderbarTab: "notes"
|
||||||
property bool wifiEnabled: true
|
property bool wifiEnabled: true
|
||||||
|
property var colorState: ({
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: checkStart()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onIsEnabledChanged() {
|
function onIsEnabledChanged() {
|
||||||
if (root.isEnabled)
|
if (root.isEnabled)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
niri_config_file="$HOME/.config/niri/config/misc.kdl"
|
niri_config_file="$HOME/.config/niri/config/misc.kdl"
|
||||||
prefer_order=(intel nvidia)
|
prefer_order=(nvidia intel)
|
||||||
|
|
||||||
# Get vendor and path of each GPU
|
# Get vendor and path of each GPU
|
||||||
default_card_path="$(find /dev/dri/card* 2>/dev/null | head -n 1)"
|
default_card_path="$(find /dev/dri/card* 2>/dev/null | head -n 1)"
|
||||||
|
|||||||
Reference in New Issue
Block a user