feat: init repo & follow documentation

Following the Quickshell documentation to get started

https://quickshell.outfoxxed.me/docs
This commit is contained in:
Nydragon 2024-08-22 00:10:53 +02:00
commit 423c2ba668
Signed by: nydragon
SSH key fingerprint: SHA256:iQnIC12spf4QjWSbarmkD2No1cLMlu6TWoV7K6cYF5g
11 changed files with 200 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake;

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv/

3
.qmlformat.ini Normal file
View file

@ -0,0 +1,3 @@
[General]
IndentWidth=4
NewlineType=native

82
flake.lock generated Normal file
View file

@ -0,0 +1,82 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1723991338,
"narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a3354191c0d7144db9756a74755672387b702ba",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"quickshell": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724197264,
"narHash": "sha256-kw8zZyskszCECn8Di6z7WSquBiP7UGCb3SNN5EAF6BE=",
"ref": "refs/heads/master",
"rev": "f95e7dbaf61b9868acc912896e65126bb1ee048c",
"revCount": 304,
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
},
"original": {
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"quickshell": "quickshell",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

39
flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
utils.url = "github:numtide/flake-utils";
quickshell = {
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
utils,
quickshell,
...
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = [
quickshell.packages.${system}.default
pkgs.kdePackages.qtdeclarative
];
};
defaultPackage = import ./nix/package.nix {
inherit (pkgs) stdenv;
quickshell = quickshell.packages.${system}.default;
};
}
);
}

19
nix/package.nix Normal file
View file

@ -0,0 +1,19 @@
{ stdenv, quickshell, ... }:
stdenv.mkDerivation rec {
name = "nysh";
unpackPhase = ":";
buildPhase = ''
cat > ${name} <<EOF
#! $SHELL
${quickshell}/bin/quickshell -p ${../src}
EOF
chmod +x ${name}
'';
installPhase = ''
mkdir -p $out/bin
cp ${name} $out/bin/
'';
}

3
src/.qmlformat.ini Normal file
View file

@ -0,0 +1,3 @@
[General]
IndentWidth=4
NewlineType=native

25
src/Bar.qml Normal file
View file

@ -0,0 +1,25 @@
import Quickshell // for ShellRoot and PanelWindow
import QtQuick // for Text
import Quickshell.Io // for process
Scope {
Variants {
model : Quickshell.screens
// the screen from the screens list will be injected into this property
PanelWindow {
property var modelData
screen: modelData
anchors {
top : true
left : true
bottom : true
}
width : 20
// the ClockWidget type we just created
ClockWidget {
anchors.centerIn: parent
}
}
}
}

5
src/ClockWidget.qml Normal file
View file

@ -0,0 +1,5 @@
import QtQuick
Text {
text: Time.time
}

17
src/Time.qml Normal file
View file

@ -0,0 +1,17 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
property var date: new Date()
property string time: date.toLocaleString(Qt.locale())
Timer {
interval: 1000
running: true
repeat: true
onTriggered: date = new Date()
}
}

5
src/shell.qml Normal file
View file

@ -0,0 +1,5 @@
import Quickshell // for ShellRoot and PanelWindow
ShellRoot {
Bar {}
}