chore: drop unused softwares

This commit is contained in:
2025-07-26 12:21:41 +08:00
parent a39b966a91
commit 17ef457181
23 changed files with 14 additions and 583 deletions

View File

@@ -16,7 +16,6 @@ lib.my.makeSwitch {
terminal.all.enable = true;
wm.all.enable = true;
style.enable = true;
quickshell.enable = true;
wine.enable = true;
};
};

View File

@@ -10,7 +10,6 @@ lib.my.makeSwitch {
config' = {
my.desktop.browser = {
firefox.enable = true;
librewolf.enable = true;
chromium.enable = true;
zen.enable = true;
};

View File

@@ -1,15 +0,0 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "librewolf";
optionPath = [
"desktop"
"browser"
"librewolf"
];
extraConfig = {
my.persist.homeDirs = [
".librewolf"
];
};
}

View File

@@ -1,48 +0,0 @@
import Quickshell
import Quickshell.Services.UPower
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami
Rectangle {
id: bat
Layout.preferredWidth: batIcon.width
Layout.fillHeight: true
color: 'transparent'
readonly property var battery: UPower.displayDevice
readonly property int percentage: Math.round(battery.percentage * 100)
property var size: height * 0.4
visible: battery.isLaptopBattery
Icon {
id: batIcon
anchors.centerIn: parent
implicitHeight: bat.size
implicitWidth: bat.size
// This recolors the entire svg, instead of only classless components.
// Hopefully in the future classes can be selected for recoloring.
isMask: true
color: 'white'
source: {
const nearestTen = Math.round(bat.percentage / 10) * 10;
const number = nearestTen.toString().padStart(2, "0");
let charging;
if (bat.battery.state == UPowerDeviceState.Charging) {
charging = "-charging";
} else if (bat.battery.state.toString() == UPowerDeviceState.FullyCharged) {
charging = "-charged";
} else {
charging = "";
}
return Quickshell.iconPath(`battery-level-${number}${charging}-symbolic`);
}
}
}

View File

@@ -1,16 +0,0 @@
import QtQuick
import QtQuick.Layouts
import "../../utils"
Rectangle {
Layout.fillHeight: true
color: "transparent"
implicitWidth: clockText.width
Text {
id: clockText
text: Time.time
color: Colors.fg
anchors.centerIn: parent
}
}

View File

@@ -1,14 +0,0 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
Layout.fillHeight: true
color: "salmon"
implicitWidth: mprisText.width
Text {
id: mprisText
text: "Mpris"
anchors.centerIn: parent
}
}

View File

@@ -1,54 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "../../utils"
Rectangle {
id: resources
Layout.fillHeight: true
color: "transparent"
implicitWidth: rowLayout.width
property int valueSize: 8
property int textSize: 6
property string valueColor: "white"
property string textColor: "lightgray"
RowLayout {
id: rowLayout
anchors.centerIn: parent
ColumnLayout {
id: cpuColumn
Label {
color: textColor
font.pointSize: textSize
text: "CPU"
Layout.alignment: Qt.AlignCenter
}
Label {
color: valueColor
font.pointSize: valueSize
text: Resources.cpu_percent + "%"
Layout.alignment: Qt.AlignCenter
}
}
ColumnLayout {
Label {
color: textColor
font.pointSize: textSize
text: "MEM"
Layout.alignment: Qt.AlignCenter
}
Label {
color: valueColor
font.pointSize: valueSize
text: Resources.mem_percent + "%"
Layout.alignment: Qt.AlignCenter
}
}
}
}

View File

@@ -1,5 +0,0 @@
import QtQuick
Text {
renderType: Text.NativeRendering
}

View File

@@ -1,14 +0,0 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
Layout.fillHeight: true
color: "lightblue"
implicitWidth: trayText.width
Text {
id: trayText
text: "Tray"
anchors.centerIn: parent
}
}

View File

@@ -1,26 +0,0 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
id: ws
property bool hovered: false
Layout.preferredWidth: parent.height * 0.4
Layout.preferredHeight: parent.height * 0.4
Layout.alignment: Qt.AlignHCenter
radius: height / 2
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: () => {
ws.hovered = true;
}
onExited: () => {
ws.hovered = false;
}
onClicked: () => console.log(`workspace ?`)
}
}

View File

@@ -1,55 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import "../../../utils"
import Quickshell.Hyprland
Rectangle {
id: workspaces
color: 'transparent'
width: workspacesRow.implicitWidth
Layout.fillHeight: true
RowLayout {
id: workspacesRow
height: parent.height
implicitWidth: (parent.height * 0.5 + spacing) * 2 - spacing
anchors.centerIn: parent
spacing: height / 7
Repeater {
id: repeater
model: HyprlandUtils.maxWorkspace
Workspace {
id: ws
required property int index
property HyprlandWorkspace currWorkspace: Hyprland.workspaces.values.find(e => e.id == index + 1) || null
property bool nonexistent: currWorkspace === null
property bool focused: index + 1 === Hyprland.focusedMonitor.activeWorkspace.id
Layout.preferredWidth: {
if (focused) {
return parent.height * 0.8;
} else {
return parent.height * 0.4;
}
}
color: {
if (nonexistent) {
return Colors.bgBlur;
} else {
return Colors.monitorColors[Hyprland.monitors.values.indexOf(Hyprland.workspaces.values.find(e => e.id === index + 1).monitor)];
}
}
}
}
}
}

View File

@@ -1,6 +0,0 @@
import "./windows"
import Quickshell // for ShellRoot and PanelWindow
ShellRoot {
Bar {}
}

View File

@@ -1,9 +0,0 @@
import Quickshell
pragma Singleton
Singleton {
property var bgBar: Qt.rgba(0, 0, 0, 0.21)
property var bgBlur: Qt.rgba(0, 0, 0, 0.3)
property var fg: "white"
property list<var> monitorColors: ["#e06c75", "#e5c07b", "#98c379", "#61afef"]
}

View File

@@ -1,67 +0,0 @@
pragma Singleton
import Quickshell
import Quickshell.Hyprland
import QtQuick
Singleton {
id: hyprland
property list<HyprlandWorkspace> workspaces: sortWorkspaces(Hyprland.workspaces.values)
property HyprlandWorkspace focusedWorkspace: Hyprland.focusedMonitor?.activeWorkspace
property int maxWorkspace: findMaxId()
function sortWorkspaces(ws) {
return [...ws].sort((a, b) => a?.id - b?.id);
}
function switchWorkspace(w: int): void {
console.log(`workspace: focus ${focusedWorkspace.id} -> ${w}`);
Hyprland.dispatch(`workspace ${w}`);
}
function findMaxId(): int {
let num = hyprland.workspaces.length;
return hyprland.workspaces[num - 1]?.id;
}
Connections {
target: Hyprland
function onRawEvent(event) {
// console.log("EVENT NAME", event.name);
// consow.wg("EVENT DATA", event.data);
let eventName = event.name;
switch (eventName) {
// Both of these are required in order to detect workspace changes
// even when switching monitors.
// case "workspacev2":
// {
// // hyprland.focusedWorkspace = Hyprland.focusedMonitor?.activeWorkspace;
// console.log(`workspace: ${hyprland.focusedWorkspace.id}`);
// console.log(`num workspaces ${hyprland.workspaces.length}`)
// console.log(`num workspaces (real) ${Hyprland.workspaces.values.length}`)
// break;
// }
// case "focusedmonv2":
// {
// // hyprland.focusedWorkspace = Hyprland.focusedMonitor?.activeWorkspace;
// console.log(`workspace: ${hyprland.focusedWorkspace.id}`);
// console.log(`num workspaces ${hyprland.workspaces.length}`)
// console.log(`num workspaces (real) ${Hyprland.workspaces.values.length}`)
// break;
// }
case "createworkspacev2":
{
hyprland.workspaces = hyprland.sortWorkspaces(Hyprland.workspaces.values);
hyprland.maxWorkspace = findMaxId();
}
case "destroyworkspacev2":
{
hyprland.workspaces = hyprland.sortWorkspaces(Hyprland.workspaces.values);
hyprland.maxWorkspace = findMaxId();
}
}
}
}
}

View File

@@ -1,67 +0,0 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
property int cpu_percent
property string cpu_freq
property int mem_percent
property string mem_used
Process {
id: process_cpu_percent
running: true
command: ["sh", "-c", "top -bn1 | rg '%Cpu' | awk '{print 100-$8}'"]
stdout: SplitParser {
onRead: data => cpu_percent = Math.round(data)
}
}
Process {
id: process_cpu_freq
running: true
command: ["sh", "-c", "lscpu --parse=MHZ"]
stdout: SplitParser {
onRead: data => {
// delete the first 4 lines (comments)
const mhz = data.split("\n").slice(4);
// compute mean frequency
const freq = mhz.reduce((acc, e) => acc + Number(e), 0) / mhz.length;
cpu_freq = Math.round(freq) + " MHz";
}
}
}
Process {
id: process_mem_percent
running: true
command: ["sh", "-c", "free | awk 'NR==2{print $3/$2*100}'"]
stdout: SplitParser {
onRead: data => mem_percent = Math.round(data)
}
}
Process {
id: process_mem_used
running: true
command: ["sh", "-c", "free --si -h | awk 'NR==2{print $3}'"]
stdout: SplitParser {
onRead: data => mem_used = data
}
}
Timer {
interval: 2000
running: true
repeat: true
onTriggered: () => {
process_cpu_percent.running = true
process_cpu_freq.running = true
process_mem_percent.running = true
process_mem_used.running = true
}
}
}

View File

@@ -1,29 +0,0 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
property var locale: Qt.locale()
function createDate(): string {
let date = new Date();
let hh = date.getHours().toString().padStart(2, 0);
let mm = date.getMinutes().toString().padStart(2, 0)
let weekday = locale.dayName(date.getDay(), Locale.ShortFormat)
let month = locale.monthName(date.getMonth(), Locale.ShortFormat)
let day = date.getDate()
return `${weekday} ${month} ${day} ${hh}:${mm}`
}
property var time: createDate()
Timer {
interval: 1000
running: true
repeat: true
onTriggered: time = createDate()
}
}

View File

@@ -1,79 +0,0 @@
//@ pragma NativeTextRendering
import Quickshell
import QtQuick
import QtQuick.Layouts
import "../utils"
import "../components/bar"
import "../components/bar/workspaces"
Scope {
PanelWindow {
id: barWindow
screen: Quickshell.screens[0]
anchors {
top: true
left: true
right: true
}
height: 32
color: "transparent"
Rectangle {
id: bar
anchors.fill: parent
color: Colors.bgBlur
// left
// RowLayout {
// id: barLeft
//
// anchors.bottom: parent.bottom
// anchors.left: parent.left
// anchors.top: parent.top
//
// anchors.leftMargin: height / 4
// anchors.rightMargin: height / 4
// spacing: height / 4
//
// Workspaces {}
// }
// middle
RowLayout {
id: barMiddle
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.leftMargin: height / 4
anchors.rightMargin: height / 4
spacing: height / 4
Mpris {}
}
// right
RowLayout {
id: barRight
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.top: parent.top
anchors.leftMargin: height / 4
anchors.rightMargin: height / 4
spacing: height / 4
Tray {}
Resources {}
Battery {}
Clock {}
}
}
}
}

View File

@@ -1,29 +0,0 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
default = false;
optionName = "quickshell";
optionPath = [
"desktop"
"quickshell"
];
config' = {
my.home = {
home.packages = [ pkgs.quickshell ];
home.sessionVariables.QML2_IMPORT_PATH = lib.concatStringsSep ":" [
"${pkgs.quickshell}/lib/qt-6/qml"
"${pkgs.kdePackages.qtdeclarative}/lib/qt-6/qml"
"${pkgs.kdePackages.kirigami.unwrapped}/lib/qt-6/qml"
];
xdg.configFile."quickshell" = {
source = ./config;
recursive = true;
};
};
};
}