changes from main n stuff

This commit is contained in:
end-4
2026-02-03 14:47:08 +01:00
parent 6ac1861e1e
commit 680d8e85c8
15 changed files with 219 additions and 55 deletions
@@ -3,7 +3,9 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import qs.modules.common.functions
import "functions"
import "config"
Singleton {
id: root
@@ -604,26 +606,8 @@ Singleton {
}
}
property JsonObject waffles: JsonObject {
// Some spots are kinda janky/awkward. Setting the following to
// false will make (some) stuff also be like that for accuracy.
// Example: the right-click menu of the Start button
property JsonObject tweaks: JsonObject {
property bool switchHandlePositionFix: true
property bool smootherMenuAnimations: true
property bool smootherSearchBar: true
}
property JsonObject bar: JsonObject {
property bool bottom: true
property bool leftAlignApps: false
}
property JsonObject actionCenter: JsonObject {
property list<string> toggles: [ "network", "bluetooth", "easyEffects", "powerProfile", "idleInhibitor", "nightLight", "darkMode", "antiFlashbang", "cloudflareWarp", "mic", "musicRecognition", "notifications", "onScreenKeyboard", "gameMode", "screenSnip", "colorPicker" ]
}
property JsonObject calendar: JsonObject {
property bool force2CharDayOfWeek: true
}
}
property JsonObject hefty: HeftyConfig {}
property JsonObject waffles: WaffleConfig {}
}
}
}
@@ -20,7 +20,8 @@ Singleton {
readonly property string music: StandardPaths.standardLocations(StandardPaths.MusicLocation)[0]
readonly property string videos: StandardPaths.standardLocations(StandardPaths.MoviesLocation)[0]
// Other dirs used by the shell, without "file://"
/////// Stuff below are without "file://" /////////
// General
property string assetsPath: Quickshell.shellPath("assets")
property string scriptPath: Quickshell.shellPath("scripts")
property string favicons: FileUtils.trimFileProtocol(`${Directories.cache}/media/favicons`)
@@ -30,9 +31,6 @@ Singleton {
property string booruDownloads: FileUtils.trimFileProtocol(Directories.pictures + "/homework")
property string booruDownloadsNsfw: FileUtils.trimFileProtocol(Directories.pictures + "/homework/🌶️")
property string latexOutput: FileUtils.trimFileProtocol(`${Directories.cache}/media/latex`)
property string shellConfig: FileUtils.trimFileProtocol(`${Directories.config}/illogical-impulse`)
property string shellConfigName: "config.json"
property string shellConfigPath: `${Directories.shellConfig}/${Directories.shellConfigName}`
property string todoPath: FileUtils.trimFileProtocol(`${Directories.state}/user/todo.json`)
property string notesPath: FileUtils.trimFileProtocol(`${Directories.state}/user/notes.txt`)
property string conflictCachePath: FileUtils.trimFileProtocol(`${Directories.cache}/conflict-killer`)
@@ -43,14 +41,21 @@ Singleton {
property string screenshotTemp: "/tmp/quickshell/media/screenshot"
property string wallpaperSwitchScriptPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/colors/switchwall.sh`)
property string defaultAiPrompts: Quickshell.shellPath("defaults/ai/prompts")
property string userAiPrompts: FileUtils.trimFileProtocol(`${Directories.shellConfig}/ai/prompts`)
property string userActions: FileUtils.trimFileProtocol(`${Directories.shellConfig}/actions`)
property string aiChats: FileUtils.trimFileProtocol(`${Directories.state}/user/ai/chats`)
property string aiTranslationScriptPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/ai/gemini-translate.sh`)
property string recordScriptPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/videos/record.sh`)
property string userAvatarPathAccountsService: FileUtils.trimFileProtocol(`/var/lib/AccountsService/icons/${SystemInfo.username}`)
property string userAvatarPathRicersAndWeirdSystems: FileUtils.trimFileProtocol(`${Directories.home}.face`)
property string userAvatarPathRicersAndWeirdSystems2: FileUtils.trimFileProtocol(`${Directories.home}.face.icon`)
// User
property string shellConfig: FileUtils.trimFileProtocol(`${Directories.config}/illogical-impulse`)
property string shellConfigName: "config.json"
property string shellConfigPath: `${Directories.shellConfig}/${Directories.shellConfigName}`
property string userAiPrompts: FileUtils.trimFileProtocol(`${Directories.shellConfig}/ai/prompts`)
property string userActions: FileUtils.trimFileProtocol(`${Directories.shellConfig}/actions`)
property string userComponents: FileUtils.trimFileProtocol(`${Directories.shellConfig}/components`)
// Cleanup on init
Component.onCompleted: {
Quickshell.execDetached(["mkdir", "-p", `${shellConfig}`])
@@ -0,0 +1,11 @@
import QtQuick
import Quickshell
import Quickshell.Io
JsonObject {
property JsonObject bar: JsonObject {
property list<var> leftWidgets: []
property list<var> centerWidgets: []
property list<var> rightWidgets: []
}
}
@@ -0,0 +1,24 @@
import QtQuick
import Quickshell
import Quickshell.Io
JsonObject {
// Some spots are kinda janky/awkward. Setting the following to
// false will make (some) stuff also be like that for accuracy.
// Example: the right-click menu of the Start button
property JsonObject tweaks: JsonObject {
property bool switchHandlePositionFix: true
property bool smootherMenuAnimations: true
property bool smootherSearchBar: true
}
property JsonObject bar: JsonObject {
property bool bottom: true
property bool leftAlignApps: false
}
property JsonObject actionCenter: JsonObject {
property list<string> toggles: [ "network", "bluetooth", "easyEffects", "powerProfile", "idleInhibitor", "nightLight", "darkMode", "antiFlashbang", "cloudflareWarp", "mic", "musicRecognition", "notifications", "onScreenKeyboard", "gameMode", "screenSnip", "colorPicker" ]
}
property JsonObject calendar: JsonObject {
property bool force2CharDayOfWeek: true
}
}
@@ -0,0 +1,14 @@
import QtQuick
import QtQuick.Effects
import qs.modules.common
MultiEffect {
property color sourceColor: "black"
colorization: 1
brightness: 1 - sourceColor.hslLightness
Behavior on colorizationColor {
animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)
}
}
@@ -0,0 +1,25 @@
import QtQuick
import Quickshell
import qs.modules.common
Item {
id: root
property alias load: loader.activeAsync
property bool shown: true // By default show immediately when loaded
property alias component: loader.component
property alias fade: opacityBehavior.enabled
property alias animation: opacityBehavior.animation
opacity: loader.active && shown ? 1 : 0
visible: opacity > 0
Behavior on opacity {
id: opacityBehavior
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
LazyLoader {
id: loader
}
}
@@ -0,0 +1,25 @@
import QtQuick
Loader {
id: root
property int fallbackIndex: 0
property list<url> fallbacks: []
property list<Component> fallbackComponents: []
onStatusChanged: {
if (status === Loader.Error && fallbackIndex < fallbacks.length) {
if (fallbacks[fallbackIndex]) {
source = fallbacks[fallbackIndex];
if (fallbackComponents[fallbackIndex]) {
console.warn("[FallbackLoader] Both fallbacks urls and components are set, using url fallback");
}
} else if (fallbackComponents[fallbackIndex]) {
sourceComponent = fallbackComponents[fallbackIndex];
} else {
console.error("[FallbackLoader] Out of fallbacks, tried all", fallbackIndex);
}
fallbackIndex += 1;
}
}
}
@@ -85,7 +85,7 @@ MouseArea { // Notification group area
automaticallyReset: false
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onPressed: {
onPressed: (mouse) => {
if (mouse.button === Qt.RightButton)
root.toggleExpanded();
}
@@ -102,6 +102,7 @@ MouseArea { // Notification group area
}
onDragDiffXChanged: () => {
if (!dragging) return;
root.qmlParent.dragDistance = dragDiffX;
}
@@ -18,9 +18,11 @@ Item {
property int screenWidth: QsWindow.window.width
property int screenHeight: QsWindow.window.height
// Signals
// Signals & loading
signal requestFocus()
signal dismissed()
property bool load: true
property bool shown: true
// Some info
property int reservedTop: 0
@@ -10,6 +10,8 @@ import "../../common/widgets/shapes/material-shapes.js" as MaterialShapes
import "../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
import "../../common/widgets/shapes/geometry/offset.js" as Offset
import "bar"
/**
* Fullscreen layer. Uses masking to not block clicks on windows n' stuff.
*/
@@ -35,15 +37,31 @@ PanelWindow {
///////////////// Content //////////////////
property alias roundedPolygon: backgroundShape.roundedPolygon
property bool finishedMorphing: true
onRoundedPolygonChanged: finishedMorphing = false
Connections {
target: backgroundShape
function onProgressChanged() {
// While it overshoots because of the spring animation, waiting for the bounce to finish entirely would be too slow
// ^ (totally not an excuse for my laziness)
if (backgroundShape.progress >= 1.0) {
root.finishedMorphing = true
}
}
}
S.ShapeCanvas {
id: backgroundShape
anchors.fill: parent
polygonIsNormalized: false
roundedPolygon: MaterialShapes.customPolygon([new MaterialShapes.PointNRound(new Offset.Offset(root.screen.width, 0), new CornerRounding.CornerRounding(9999)),])
animation: NumberAnimation {
duration: 500
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
// animation: NumberAnimation {
// duration: 500
// easing.type: Easing.BezierSpline
// easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
// }
animation: SpringAnimation {
spring: 3.5
damping: 0.35
}
color: Appearance.colors.colLayer0
borderWidth: (root.currentPanel === bar && Config.options.bar.cornerStyle !== 1) ? 0 : 1
@@ -60,7 +78,8 @@ PanelWindow {
color: "#44000000"
}
property HAbstractMorphedPanel currentPanel: bar
property HAbstractMorphedPanel currentPanel: null
Component.onCompleted: currentPanel = bar
roundedPolygon: currentPanel.backgroundPolygon
// Do we want to have reserved area always follow the bar or maybe differ per panel?
@@ -89,10 +108,14 @@ PanelWindow {
HBar {
id: bar
load: root.currentPanel === this
shown: root.finishedMorphing
}
HOverview {
id: overview
load: root.currentPanel === this
shown: root.finishedMorphing
onRequestFocus: root.currentPanel = overview;
onDismissed: root.dismiss();
}
@@ -1,8 +1,11 @@
pragma ComponentBehavior: Bound
import QtQuick
import qs.modules.common
import "../../common/widgets/shapes/material-shapes.js" as MaterialShapes
import "../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
import "../../common/widgets/shapes/geometry/offset.js" as Offset
import qs.modules.common.widgets
import "../../../common/widgets/shapes/material-shapes.js" as MaterialShapes
import "../../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
import "../../../common/widgets/shapes/geometry/offset.js" as Offset
import ".."
HAbstractMorphedPanel {
id: root
@@ -131,4 +134,15 @@ HAbstractMorphedPanel {
easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
}
}
FadeLazyLoader {
id: contentLoader
load: root.load
shown: root.shown
anchors.fill: parent
component: HBarContent {
parent: contentLoader
anchors.fill: parent
}
}
}
@@ -0,0 +1,39 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.services
import qs.modules.common.widgets
Item {
id: root
Side {
id: leftSide
anchors.left: parent.left
width: (parent.width - centerSide.width) / 2
}
Side {
id: centerSide
anchors.horizontalCenter: parent.horizontalCenter
FallbackLoader {
asynchronous: true
source: "/home/end/.config/quickshell/ii/modules/ii/bar/WrongModuleName"
fallbacks: ["/home/end/.config/quickshell/ii/modules/ii/bar/Workspaces.qml"]
}
}
Side {
id: rightSide
anchors.right: parent.right
width: (parent.width - centerSide.width) / 2
}
component Side: RowLayout {
anchors {
top: parent.top
bottom: parent.bottom
}
}
}
@@ -182,6 +182,7 @@ Item {
// Workspaces - numbers
Grid {
id: wsNumbers
z: 3
columns: root.vertical ? 1 : root.workspacesShown
@@ -210,6 +211,11 @@ Item {
property var biggestWindow: HyprlandData.biggestWindowForWorkspace(button.workspaceValue)
property var mainAppIconSource: Quickshell.iconPath(AppSearch.guessIcon(biggestWindow?.class), "image-missing")
property color numberColor: (monitor?.activeWorkspace?.id == button.workspaceValue) ?
Appearance.m3colors.m3onPrimary :
(workspaceOccupied[index] ? Appearance.m3colors.m3onSecondaryContainer :
Appearance.colors.colOnLayer1Inactive)
StyledText { // Workspace number text
opacity: root.showNumbers
|| ((Config.options?.bar.workspaces.alwaysShowNumbers && (!Config.options?.bar.workspaces.showAppIcons || !workspaceButtonBackground.biggestWindow || root.showNumbers))
@@ -226,10 +232,7 @@ Item {
}
text: Config.options?.bar.workspaces.numberMap[button.workspaceValue - 1] || button.workspaceValue
elide: Text.ElideRight
color: (root.effectiveActiveWorkspaceId == button.workspaceValue) ?
Appearance.m3colors.m3onPrimary :
(workspaceOccupied[index] ? Appearance.m3colors.m3onSecondaryContainer :
Appearance.colors.colOnLayer1Inactive)
color: workspaceButtonBackground.numberColor
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
@@ -246,10 +249,7 @@ Item {
width: workspaceButtonWidth * 0.18
height: width
radius: width / 2
color: (root.effectiveActiveWorkspaceId == button.workspaceValue) ?
Appearance.m3colors.m3onPrimary :
(workspaceOccupied[index] ? Appearance.m3colors.m3onSecondaryContainer :
Appearance.colors.colOnLayer1Inactive)
color: workspaceButtonBackground.numberColor
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
@@ -309,12 +309,8 @@ Item {
}
}
}
}
}
}
}
@@ -53,6 +53,7 @@ Scope {
margins: Appearance.sizes.hyprlandGapsOut
leftMargin: Appearance.sizes.elevationMargin
}
asynchronous: true
width: sidebarWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
@@ -43,9 +43,9 @@ Singleton {
const actionName = fileName.replace(/\.[^/.]+$/, ""); // strip extension
actions.push({
action: actionName,
execute: ((path) => (args) => {
Quickshell.execDetached([path, ...(args ? args.split(" ") : [])]);
})(FileUtils.trimFileProtocol(filePath.toString()))
execute: (path => args => {
Quickshell.execDetached([path, ...(args ? args.split(" ") : [])]);
})(FileUtils.trimFileProtocol(filePath.toString()))
});
}
}
@@ -250,8 +250,8 @@ Singleton {
if (!entry.runInTerminal)
entry.execute();
else {
// Probably needs more proper escaping, but this will do for now
Quickshell.execDetached(["bash", '-c', `${Config.options.apps.terminal} -e '${StringUtils.shellSingleQuoteEscape(entry.command.join(' '))}'`]);
print([...Config.options.apps.terminal, "-e", ...entry.command])
Quickshell.execDetached([...Config.options.apps.terminal, "-e", ...entry.command]);
}
},
comment: entry.comment,
@@ -267,7 +267,7 @@ Singleton {
if (!action.runInTerminal)
action.execute();
else {
Quickshell.execDetached(["bash", '-c', `${Config.options.apps.terminal} -e '${StringUtils.shellSingleQuoteEscape(action.command.join(' '))}'`]);
Quickshell.execDetached([...Config.options.apps.terminal, "-e", ...action.command]);
}
}
});