Compare commits

...

84 Commits

Author SHA1 Message Date
0edd66d61a Giving claude access diving in balls first 2026-01-15 16:48:40 +00:00
2f7ae02b36 flake.lock: Update
Flake lock file updates:

• Updated input 'caelestia-cli':
    'github:caelestia-dots/cli/55590bd9e4c24189c44c1ad1ec7b3b54538fcefb?narHash=sha256-sD6q%2BLrM6vd2i2BrQoowhGARa43zWeR8oPTjzlxq3RU%3D' (2026-01-04)
  → 'github:caelestia-dots/cli/55d75a117540e37263ac450ed7c40cc2212b5e3c?narHash=sha256-9aevqBizkmywn0buASzLCNOwY/Wm6tq9FpaPrRgZ/KQ%3D' (2026-01-07)
• Updated input 'caelestia-cli/nixpkgs':
    'github:nixos/nixpkgs/fb7944c166a3b630f177938e478f0378e64ce108?narHash=sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf%2BOkucw%3D' (2026-01-02)
  → 'github:nixos/nixpkgs/9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5?narHash=sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i%2BbwD6XxMb8A%3D' (2026-01-05)
• Updated input 'dms':
    'github:AvengeMedia/DankMaterialShell/ab071e12aaf0c42b6e0921b94f96553c4a10bcbf?narHash=sha256-njG0q58Xnx69/V0KCTwBsI514sO/Eq1yF74%2B8hLDU1A%3D' (2026-01-05)
  → 'github:AvengeMedia/DankMaterialShell/3dd21382bad5d43604850e257cfd1b8d35e16fb9?narHash=sha256-4tLYqLiLZqI7xmhNBi5zyGkaAXZJNUtGuxWzA7NJf8A%3D' (2026-01-07)
• Updated input 'home-manager':
    'github:nix-community/home-manager/a65c04965c841eb01ba401f5162f12bc8d52014f?narHash=sha256-N0kK1JqxIjFl7hPAfhkW6C9AO7feYJUWLPyqJO2VuQQ%3D' (2026-01-05)
  → 'github:nix-community/home-manager/c068188a8e5c277f7bc8671557a7568864b57515?narHash=sha256-QICeGwbXfqtaOZmgh6BrSBB72drPuHO3pjuyh%2Bx8eIY%3D' (2026-01-07)
• Updated input 'hyprland':
    'github:hyprwm/Hyprland/9817553c664b0b7f6776671383a6368c74ee8dee?narHash=sha256-M5WVoXwlZpYcEKS23sEQKMzzdqItY/iEWoj3reIBfiE%3D' (2026-01-05)
  → 'github:hyprwm/Hyprland/918e2bb9be0e1d233f9394f1d569137788c43c01?narHash=sha256-BHBiQhlNl%2BLxvp/bBOOTWhxbXYMoVG4xiyv9DE/nuZ4%3D' (2026-01-07)
• Updated input 'hyprland-hyprsplit':
    'github:Duckonaut/split-monitor-workspaces/7b179721fcd272154d2917e9c4a7f9659c6104a2?narHash=sha256-FtitmvggxcZqCEKhYIN66td6JONenoTsuOFVS9pYi5E%3D' (2026-01-04)
  → 'github:Duckonaut/split-monitor-workspaces/764548c3aa22c9f4cb436ec7243d21795eb6ebec?narHash=sha256-yTuyde8TpBR3NhNnOcK4uOGukvMCwrH3otP8E04e9X0%3D' (2026-01-06)
• Updated input 'hyprland-plugins':
    'github:hyprwm/hyprland-plugins/0b356053fa4e6a6f5e857529654ff45eba2859d8?narHash=sha256-502sjmbTK/W8x6DUbJAyiBOABwV1q5Wb5caCMwd6BuI%3D' (2026-01-05)
  → 'github:hyprwm/hyprland-plugins/fef398ed5e4faf59bc43b915e46a75cfe8b16697?narHash=sha256-jObY8O7OI%2B91hoE137APsDxm0235/Yx%2BHhFIip187zM%3D' (2026-01-06)
• Updated input 'jovian':
    'github:Jovian-Experiments/Jovian-NixOS/efd4b22e6fdc6d7fb4e186ae333a4b74e03da440?narHash=sha256-2tL1mRb9uFJThUNfuDm/ehrnPvImL/QDtCxfn71IEz4%3D' (2025-12-30)
  → 'github:Jovian-Experiments/Jovian-NixOS/a81fad3f4a70fdaa779e74b7da2063fa2e358028?narHash=sha256-jXb2kBU6lO6Q6S9zoR/bhVLMjg2hM9EW8gWIwsmkj64%3D' (2026-01-07)
• Updated input 'nixcord':
    'github:kaylorben/nixcord/9748d874957aef2a3f44de2c3fdfe412c62a9063?narHash=sha256-pnfuAPzku7uqNt7Bc0zILNrvmeHd%2B1/iEN5caWJb8x4%3D' (2026-01-05)
  → 'github:kaylorben/nixcord/d9f83906a12678900b2b36c3bdf7329e8efaa0c0?narHash=sha256-uW5BgnDOn41rlKn1JxdN7CU4bbOgZf%2BaxEw8pBVP6RU%3D' (2026-01-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/3bd884a63dc53ecb0bf43422f4aa4f51d87a04e9?narHash=sha256-bGKKceW7Sr5HsuyDrdUCdx3/NkyvASdst86yx955CCE%3D' (2025-12-24)
  → 'github:nixos/nixpkgs/5912c1772a44e31bf1c63c0390b90501e5026886?narHash=sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4%3D' (2026-01-07)
• Updated input 'quickshell':
    'git+https://git.outfoxxed.me/outfoxxed/quickshell?ref=refs/heads/master&rev=41828c4180fb921df7992a5405f5ff05d2ac2fff' (2025-12-26)
  → 'git+https://git.outfoxxed.me/outfoxxed/quickshell?ref=refs/heads/master&rev=6742148cf4a8415a9c51fdeb11d8c3ea716c2e14' (2026-01-06)
• Updated input 'vicinae':
    'github:vicinaehq/vicinae/b79669006c4e49e32f2ae889c1294cd62c8071d5?narHash=sha256-L0A4daBtEuponvKr5YM4wn8btDku0Cs2Eu5b%2BEtTgSk%3D' (2026-01-05)
  → 'github:vicinaehq/vicinae/aab965dcf29529c5fab67b9c2fb5f8168f76fa1b?narHash=sha256-OPBgcM2ZzbVEUS6lwRpJo2JBfiRK8TmYVSmZImEW2gA%3D' (2026-01-07)
• Updated input 'zen-browser':
    'github:0xc000022070/zen-browser-flake/350c729b261e6f5529460140a5f0943dd4c5e156?narHash=sha256-6s8hL3YX9zAq2T7qvcwwzaEVwc9MEYbW%2BC2LcAAQfbk%3D' (2026-01-04)
  → 'github:0xc000022070/zen-browser-flake/8b2302d8c10369c9135552cc892da75cff5ddb03?narHash=sha256-5ysv8EuVAgDoYmNuXEUNf7vBzdeRaFxeIlIndv5HMvs%3D' (2026-01-07)
2026-01-07 19:53:11 +00:00
f7e26a9793 pain and suffering 2026-01-06 19:56:41 +00:00
47cd19b701 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/93d0f90099f5f3b9295aae90ccbce4e2d14e1160?narHash=sha256-eDrvOyIt/2GRUyZtKd7pJOLAOdQh8IaSzEdEzsSxYSU%3D' (2025-12-31)
  → 'github:nixos/nixpkgs/fb7944c166a3b630f177938e478f0378e64ce108?narHash=sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf%2BOkucw%3D' (2026-01-02)
2026-01-04 16:05:55 +00:00
f0c2a38366 dickplays 2025-12-17 22:42:37 +00:00
b2b4e434fd temu fix 2025-12-17 21:37:02 +00:00
a442183047 shfjdshf 2025-12-17 20:46:37 +00:00
eb6019b131 better shell integration 2025-12-17 17:10:25 +00:00
423e136895 theme stuff 2025-12-17 13:00:21 +00:00
zastian-dev
fe40f11559 testing sone shite 2025-12-15 18:06:05 +00:00
c45ec8d9cd cad my dude 2025-12-15 13:53:40 +00:00
zastian-dev
f073bda700 Fuck minor spelling mistake 2025-12-12 12:39:45 +00:00
zastian-dev
af5ca69e02 clean up the house a bit 2025-12-12 12:21:22 +00:00
c22a16c4ea can you now stop making noice nix please stop complaining 2025-12-12 01:38:45 +00:00
92d70ee2fc gay ming it works soooo goood but looks are bad will make clean 2025-12-12 01:38:06 +00:00
zastian-dev
ebe65dc108 stuff IDK 2025-12-11 14:48:22 +00:00
4a8274bd59 setting up the cumsole 2025-12-11 12:14:43 +00:00
zastian-dev
e7275b4c37 reee 2025-12-10 16:37:00 +00:00
zastian-dev
088c99e2cb wgnord shit 2025-12-10 13:52:34 +00:00
ec9f987c14 sheeet the second 2025-12-10 13:51:17 +00:00
854bf14796 shhheeeet 2025-12-10 13:48:15 +00:00
zastian-dev
381d6c2795 confugerations 2025-11-30 17:47:07 +00:00
zastian@mrthoddata.com
29a540706c balls 2025-11-12 16:04:32 +00:00
68dcfeef3d reee stuff 2025-11-12 15:56:28 +00:00
af0d2db342 new runner once again 2025-11-04 11:00:51 +00:00
zastian@mrthoddata.com
914212ce30 pain 2025-11-01 14:44:29 +00:00
d33d191613 this is conna have conflicts its so over 2025-10-31 10:12:34 +00:00
zastian@mrthoddata.com
c48cce4a4a cum puter the second cumming 2025-10-22 20:51:39 +01:00
e55659e082 cum puter the first cumming 2025-10-21 11:50:18 +01:00
zastian@mrthoddata.com
4ffc8d20b6 stuff 2025-10-19 15:41:42 +01:00
cfa793c41a hipblaslt fuck you 2025-10-14 12:03:45 +01:00
Zastian Pretorius
9337ee3385 gg 2 2025-10-13 16:59:57 +01:00
mrfluffy-dev
d197e054dd gg 2025-10-13 16:59:11 +01:00
mrfluffy-dev
d04259ac3d reee 2025-10-09 11:41:01 +01:00
mrfluffy-dev
b9fb4b9515 we will never know what all the changes are in this commit 2025-10-02 12:51:22 +01:00
cfa57e9a3f balls 2025-09-19 13:56:53 +01:00
zastian@mrthoddata.com
f5c7879447 hyper cuck 2025-09-15 16:48:19 +01:00
zastian@mrthoddata.com
935257bc4b gg 2025-09-15 13:04:52 +01:00
cdb912796e hureland refactor 2025-09-08 12:35:41 +01:00
Zastian Pretorius
3839a0e292 clean the shit 2025-09-07 14:47:56 +01:00
Zastian Pretorius
59cb67267c HDR frfr this time 2025-09-07 12:16:17 +01:00
zastian@mrthoddata.com
e73179e113 hdr baby 2025-09-05 16:03:57 +01:00
zastian@mrthoddata.com
dbf42a7482 kdjka 2025-09-05 12:15:28 +01:00
zastian@mrthoddata.com
1736701831 fix the screen share wompwomp 2025-09-03 11:32:09 +01:00
Zastian Pretorius
6d10cd93a9 ummmmm 2025-09-02 11:05:15 +01:00
Zastian Pretorius
1ceccb3993 correction stupid jellyfin media player 2025-08-30 16:25:45 +01:00
Zastian Pretorius
0c57087584 stupid qt5 web sit 2025-08-30 15:39:07 +01:00
zastian@mrthoddata.com
b1384a3898 network sheet 2025-08-29 12:38:57 +01:00
zastian@mrthoddata.com
9738b3a61e ipv6 v2 final form 2025-08-27 15:50:25 +01:00
zastian@mrthoddata.com
388d5f63cc ipv6 v1 test try hope 2025-08-27 15:11:03 +01:00
Zastian Pretorius
8414845ce5 jedgnb 2025-08-27 15:10:11 +01:00
zastian@mrthoddata.com
5d1691811a huperland 2025-08-23 11:32:21 +01:00
zastian@mrthoddata.com
62e143d3a1 dbusssssssssssssssssssssssssss 2025-08-21 14:04:00 +01:00
mrfluffy-dev
0208d78969 upgrades people upgrades 2025-08-20 20:39:14 +01:00
zastian@mrthoddata.com
cfd848d610 sweatty balls 2025-08-20 12:00:11 +01:00
Zastian Pretorius
14e37841c1 fkdsah 2025-08-19 12:39:12 +01:00
zastian@mrthoddata.com
a7b80b43a9 eabhdsfgvij 2025-08-14 16:46:31 +01:00
mrfluffy-dev
59482884c5 laptop stuff 2.0 2025-08-14 16:00:33 +01:00
mrfluffy-dev
9645a29026 laptop stuff 2025-08-13 00:28:39 +01:00
Zastian Pretorius
e888dc33e8 what did the one commit say to the other.. git good 2025-08-12 22:21:16 +01:00
Zastian Pretorius
d4397e5298 what the hell was \ 2025-08-11 16:19:50 +01:00
zastian@mrthoddata.com
8df64cd43c reeeeeeeeeeeeee 2025-08-11 10:37:37 +01:00
Zastian Pretorius
010864f906 reeeee 2025-08-06 10:46:42 +01:00
zastian@mrthoddata.com
d81ba65c92 cock and ball 2025-08-05 18:01:02 +01:00
zastian@mrthoddata.com
4418e3bb2b beep boop 2025-08-05 16:18:13 +01:00
Zastian Pretorius
00a79a16fc balls to the wall 2025-08-05 12:07:12 +01:00
Zastian Pretorius
3d61db9737 balls and cock 2025-08-04 21:18:10 +01:00
Zastian Pretorius
96bc1b1894 weeeeeeeeeeeeeeeeeee 2025-07-16 15:33:05 +01:00
Zastian Pretorius
8eb707c900 fuck if I know what I did 2025-07-03 21:28:39 +01:00
zastian@mrthoddata.com
69c5638e49 fuck you rocm you cunt 2025-07-03 21:25:18 +01:00
zastian@mrthoddata.com
d611c6224d stuff 2025-07-01 15:21:14 +01:00
Zastian Pretorius
f006323bd0 stuff 2025-07-01 14:40:29 +01:00
mrfluffy-dev
211c361c9b feat: moved to alt and added startup programs 2025-06-25 12:56:09 +01:00
zastian@mrthoddata.com
0a7d1bb875 once again niri 2025-06-25 11:01:32 +01:00
zastian@mrthoddata.com
1632857b50 to lazy for good messages 2025-06-25 10:44:42 +01:00
mrfluffy-dev
3e2f2935d3 niri 2025-06-25 10:35:27 +01:00
mrfluffy-dev
fdd5da38e1 faliur of a guesture experement 2025-06-25 10:34:33 +01:00
mrfluffy-dev
11366052f9 feat: hyperland scrolling layout 2025-06-25 10:33:58 +01:00
Zastian Pretorius
1ccf439c72 chore: updated lock 2025-06-24 08:57:31 +01:00
Zastian Pretorius
76ac63613c feat: fonts fuck them 2025-06-24 08:57:16 +01:00
Zastian Pretorius
e8cb83742d chore: removed libreswan 2025-06-24 08:56:44 +01:00
Zastian Pretorius
1c2ec1ae1d feat: moved over to zen kernel 2025-06-24 08:56:22 +01:00
mrfluffy-dev
c570768344 feat: enabled upower service 2025-06-23 20:28:48 +01:00
mrfluffy-dev
3f1f6eaa74 feat: made quickshell systemd service 2025-06-23 20:28:25 +01:00
171 changed files with 4012 additions and 15041 deletions

0
dots/doom/lisp/test.el → .gitmodules vendored Executable file → Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 704 KiB

BIN
assets/Wallpapers/142.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@@ -1,6 +1,5 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
# your system. Help is available in configuration.nix(5) and via `nixos-help`.
{
config,
@@ -12,100 +11,48 @@
...
}:
let
oreo = pkgs.callPackage ./personalPKGS/oreo.nix { };
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./system/hardware.nix
./system/boot.nix
./system/network.nix
./system/inputMethods.nix
./system/services.nix
./system/hardware.nix
./system/fonts.nix
./system/nixOSPkgs.nix
inputs.home-manager.nixosModules.home-manager
inputs.niri.nixosModules.niri
inputs.jovian.nixosModules.default
#inputs.niri.nixosModules.niri
];
# niri settings
nix = {
settings = {
##############################################################################
# Nix settings
##############################################################################
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
build-dir = "/var/tmp";
build-dir = "/nix/var/nix/builds";
auto-optimise-store = true;
};
};
# Set your time zone.
#time.timeZone = "Europe/Dublin";
#programs.river.enable = true;
#programs.niri.enable = true;
#programs.niri.package = pkgs.niri-stable;
#nixpkgs.overlays = [ inputs.niri.overlays.niri ];
#programs.hyprland.enable = true;
programs.river.enable = window_manager == "river" || window_manager == "all";
qt.enable = true;
#qt.style = "gtk2";
qt.platformTheme = "qt5ct";
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
programs.niri = {
enable = window_manager == "niri" || window_manager == "all";
package = pkgs.niri-stable; # Only needed if not provided by the overlay
};
programs.hyprland.enable = window_manager == "hyprland" || window_manager == "all";
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "ie";
variant = "";
};
enable = true;
#displayManager.lightdm = {
# enable = true;
# greeters.gtk = {
# enable = true;
# theme.package = pkgs.amarena-theme;
# theme.name = "amarena";
# cursorTheme.package = oreo.override { colors = [ "oreo_spark_pink_cursors" ]; };
# cursorTheme.name = "oreo_spark_pink_cursors";
# extraConfig = "background=${./assets/Wallpapers/138.png}";
# };
#};
};
services.greetd = {
enable = true;
restart = true;
settings = {
default_session = {
command = "${lib.getExe pkgs.greetd.tuigreet} --window-padding 1 --time --time-format '%R - %F' --remember --remember-session --asterisks";
user = "greeter";
##############################################################################
# Users
##############################################################################
programs.zsh.enable = true;
users = {
users = {
root = {
openssh = {
authorizedKeys = {
keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwjTCq2GXRuqVXf1CeyntkOIFYNu0+tW1lurW8PNtK1 zastian00@gmail.com"
];
};
};
};
security.rtkit.enable = true;
environment.sessionVariables = {
ZDOTDIR = "$HOME/.config/zsh";
};
environment.pathsToLink = [ "/share/zsh" ];
environment.variables = {
# VAAPI and VDPAU config for accelerated video.
# See https://wiki.archlinux.org/index.php/Hardware_video_acceleration
VDPAU_DRIVER = "radeonsi";
LIBVA_DRIVER_NAME = "radeonsi";
#XDG_CURRENT_DESKTOP = "hyprland";
#QT_QPA_PLATFORMTHEME = "qt6ct";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.mrfluffy = {
mrfluffy = {
isNormalUser = true;
shell = pkgs.zsh;
createHome = true;
@@ -116,12 +63,14 @@ in
"render"
"docker"
"libvirt"
]; # Enable sudo for the user.
packages = with pkgs; [
"input"
"seat"
"dialout"
];
packages = with pkgs; [ ];
};
users.users.work = {
work = {
isNormalUser = true;
shell = pkgs.zsh;
createHome = true;
@@ -132,71 +81,125 @@ in
"render"
"docker"
"libvirt"
]; # Enable sudo for the user.
packages = with pkgs; [
"input"
"seat"
"dialout"
];
packages = with pkgs; [ ];
};
users.groups.libvirtd.members = [
game = {
isNormalUser = true;
description = "Dedicated gaming user (auto-login in Steam specialisation)";
shell = pkgs.bash;
createHome = true;
password = ""; # no password
extraGroups = [
"wheel"
"video"
"render"
"input"
"seat"
"networkmanager"
"dialout"
];
home = "/home/game";
};
};
groups.libvirtd.members = [
"mrfluffy"
"work"
];
};
##############################################################################
# Home-Manager
##############################################################################
home-manager = {
# also pass inputs to home-manager modules
extraSpecialArgs = {
inherit inputs window_manager systemName;
};
extraSpecialArgs = { inherit inputs window_manager systemName; };
users = {
"mrfluffy" = import ./home/mrfluffy.nix;
"work" = import ./home/work.nix;
mrfluffy = import ./home/mrfluffy.nix;
work = import ./home/work.nix;
game = import ./home/game.nix;
};
};
virtualisation.docker = {
enable = true;
storageDriver = lib.mkIf (systemName == "pc") "btrfs";
##############################################################################
# Environment
##############################################################################
environment = {
sessionVariables = {
ZDOTDIR = "$HOME/.config/zsh";
};
pathsToLink = [ "/share/zsh" ];
variables = {
# VAAPI and VDPAU config for accelerated video.
# See https://wiki.archlinux.org/index.php/Hardware_video_acceleration
VDPAU_DRIVER = "radeonsi";
LIBVA_DRIVER_NAME = "radeonsi";
# AMD_VULKAN_ICD = "RADV";
# VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json";
# XDG_CURRENT_DESKTOP = "hyprland";
#QT_QPA_PLATFORMTHEME = "gtk3";
#QT_QPA_PLATFORMTHEME_QT6 = "gtk3";
};
virtualisation.libvirtd.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
security.pam.services.swaylock = { };
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
systemPackages = with pkgs; [
vim
wget
neovim
];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
##############################################################################
# Nixpkgs policy
##############################################################################
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [ ];
};
# List services that you want to enable:
##############################################################################
# decky
##############################################################################
nixpkgs.overlays = [
inputs.jovian.overlays.default
];
jovian.decky-loader = {
enable = true;
user = "game"; # Run as your gaming user
stateDir = "/home/game/.local/share/decky"; # Store plugins/data in user's home (adjust if preferred)
# Optional: Add extra packages if needed for specific plugins
# extraPackages = with pkgs; [ some-package ];
# extraPythonPackages = ps: with ps; [ some-python-package ];
};
# Enable the OpenSSH daemon.
#services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
##############################################################################
# State version
##############################################################################
system.stateVersion = "24.11"; # Did you read the comment?
specialisation = {
"01-steam" = {
configuration = {
imports = [
./system/specialisation/steam.nix
];
};
};
"00-main-system" = {
configuration = {
#boot.loader.systemd-boot.sortKey = lib.mkDefault "00000000000-main";
##############################################################################
# Imports
##############################################################################
imports = [
./system/services.nix
./system/nixOSPkgs.nix
./system/specialisation/main-system.nix
#inputs.niri.nixosModules.niri
];
};
};
};
}

392
dots/caelestia.nix Normal file
View File

@@ -0,0 +1,392 @@
{ config,
lib,
pkgs,
inputs,
...
}:
{
programs = {
caelestia = {
enable = false;
systemd = {
enable = true; # if you prefer starting from your compositor
target = "graphical-session.target";
environment = [];
};
settings = {
appearance = {
anim = {
durations = {
scale = 1;
};
};
font = {
family = {
material = "Material Symbols Rounded";
mono = "CaskaydiaCove NF";
sans = "Rubik";
};
size = {
scale = 1;
};
};
padding = {
scale = 1;
};
rounding = {
scale = 1;
};
spacing = {
scale = 1;
};
transparency = {
enabled = false;
base = 0.85;
layers = 0.4;
};
};
general = {
apps = {
terminal = [ "foot" ];
audio = [ "pavucontrol" ];
};
battery = {
warnLevels = [
{
level = 20;
title = "Low battery";
message = "You might want to plug in a charger";
icon = "battery_android_frame_2";
}
{
level = 10;
title = "Did you see the previous message?";
message = "You should probably plug in a charger <b>now</b>";
icon = "battery_android_frame_1";
}
{
level = 5;
title = "Critical battery level";
message = "PLUG THE CHARGER RIGHT NOW!!";
icon = "battery_android_alert";
critical = true;
}
];
criticalLevel = 3;
};
idle = {
inhibitWhenAudio = true;
timeouts = [
{
timeout = 600;
idleAction = "lock";
}
{
timeout = 700;
idleAction = "dpms off";
returnAction = "dpms on";
}
{
timeout = 800;
idleAction = [ "systemctl" "suspend-then-hibernate" ];
}
];
};
};
background = {
desktopClock = {
enabled = false;
};
enabled = true;
visualiser = {
enabled = false;
autoHide = true;
rounding = 1;
spacing = 1;
};
};
bar = {
clock = {
showIcon = true;
};
dragThreshold = 20;
entries = [
{
id = "logo";
enabled = true;
}
{
id = "workspaces";
enabled = true;
}
{
id = "spacer";
enabled = true;
}
{
id = "activeWindow";
enabled = true;
}
{
id = "spacer";
enabled = true;
}
{
id = "tray";
enabled = true;
}
{
id = "clock";
enabled = true;
}
{
id = "statusIcons";
enabled = true;
}
{
id = "power";
enabled = true;
}
];
persistent = true;
scrollActions = {
brightness = true;
workspaces = true;
volume = true;
};
showOnHover = true;
status = {
showAudio = false;
showBattery = true;
showBluetooth = true;
showKbLayout = false;
showMicrophone = false;
showNetwork = true;
showLockStatus = true;
};
tray = {
background = false;
iconSubs = [];
recolour = false;
};
workspaces = {
activeIndicator = true;
activeLabel = "󰮯";
activeTrail = false;
label = " ";
occupiedBg = false;
occupiedLabel = "󰮯";
perMonitorWorkspaces = true;
showWindows = true;
shown = 5;
};
};
border = {
rounding = 25;
thickness = 10;
};
dashboard = {
enabled = true;
dragThreshold = 50;
mediaUpdateInterval = 500;
showOnHover = true;
};
launcher = {
actionPrefix = ">";
actions = [
{
name = "Calculator";
icon = "calculate";
description = "Do simple math equations (powered by Qalc)";
command = [ "autocomplete" "calc" ];
enabled = true;
dangerous = false;
}
{
name = "Scheme";
icon = "palette";
description = "Change the current colour scheme";
command = [ "autocomplete" "scheme" ];
enabled = true;
dangerous = false;
}
{
name = "Wallpaper";
icon = "image";
description = "Change the current wallpaper";
command = [ "autocomplete" "wallpaper" ];
enabled = true;
dangerous = false;
}
{
name = "Variant";
icon = "colors";
description = "Change the current scheme variant";
command = [ "autocomplete" "variant" ];
enabled = true;
dangerous = false;
}
{
name = "Transparency";
icon = "opacity";
description = "Change shell transparency";
command = [ "autocomplete" "transparency" ];
enabled = false;
dangerous = false;
}
{
name = "Random";
icon = "casino";
description = "Switch to a random wallpaper";
command = [ "caelestia" "wallpaper" "-r" ];
enabled = true;
dangerous = false;
}
{
name = "Light";
icon = "light_mode";
description = "Change the scheme to light mode";
command = [ "setMode" "light" ];
enabled = true;
dangerous = false;
}
{
name = "Dark";
icon = "dark_mode";
description = "Change the scheme to dark mode";
command = [ "setMode" "dark" ];
enabled = true;
dangerous = false;
}
{
name = "Shutdown";
icon = "power_settings_new";
description = "Shutdown the system";
command = [ "systemctl" "poweroff" ];
enabled = true;
dangerous = true;
}
{
name = "Reboot";
icon = "cached";
description = "Reboot the system";
command = [ "systemctl" "reboot" ];
enabled = true;
dangerous = true;
}
{
name = "Logout";
icon = "exit_to_app";
description = "Log out of the current session";
command = [ "loginctl" "terminate-user" "" ];
enabled = true;
dangerous = true;
}
{
name = "Lock";
icon = "lock";
description = "Lock the current session";
command = [ "caelestia" "shell" "lock" "lock" ];
enabled = true;
dangerous = false;
}
{
name = "Sleep";
icon = "bedtime";
description = "Suspend then hibernate";
command = [ "systemctl" "suspend-then-hibernate" ];
enabled = true;
dangerous = false;
}
];
dragThreshold = 50;
vimKeybinds = false;
enableDangerousActions = false;
maxShown = 7;
maxWallpapers = 9;
specialPrefix = "@";
useFuzzy = {
apps = false;
actions = false;
schemes = false;
variants = false;
wallpapers = false;
};
showOnHover = false;
hiddenApps = [];
};
lock = {
recolourLogo = false;
};
notifs = {
actionOnClick = false;
clearThreshold = 0.3;
defaultExpireTimeout = 5000;
expandThreshold = 20;
expire = true;
};
osd = {
enabled = true;
enableBrightness = true;
enableMicrophone = false;
hideDelay = 2000;
};
paths = {
mediaGif = "root:/assets/bongocat.gif";
sessionGif = "root:/assets/kurukuru.gif";
wallpaperDir = "~/Pictures/Wallpapers";
};
services = {
audioIncrement = 0.1;
defaultPlayer = "Spotify";
playerAliases = [
{ from = "com.github.th_ch.youtube_music"; to = "YT Music"; }
];
gpuType = "";
weatherLocation = "";
useFahrenheit = false;
useTwelveHourClock = true;
smartScheme = true;
visualiserBars = 45;
};
session = {
dragThreshold = 30;
enabled = true;
vimKeybinds = false;
commands = {
logout = [ "loginctl" "terminate-user" "" ];
shutdown = [ "systemctl" "poweroff" ];
hibernate = [ "systemctl" "hibernate" ];
reboot = [ "systemctl" "reboot" ];
};
};
sidebar = {
dragThreshold = 80;
enabled = true;
};
utilities = {
enabled = true;
maxToasts = 4;
toasts = {
audioInputChanged = true;
audioOutputChanged = true;
capsLockChanged = true;
chargingChanged = true;
configLoaded = true;
dndChanged = true;
gameModeChanged = true;
numLockChanged = true;
};
};
};
cli = {
enable = true; # Also add caelestia-cli to path
settings = {
theme.enableGtk = false;
};
};
};
};
}

View File

@@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
imports = [
inputs.dms.homeModules.dank-material-shell
];
programs.dank-material-shell = {
enable = true;
systemd = {
enable = true; # if you prefer starting from your compositor
};
#settings = {
# theme = "dark";
# dynamicTheming = true;
# # Add any other settings here
#};
};
}

View File

@@ -1,153 +0,0 @@
#+title: :completion corfu
#+subtitle: Complete with cap(f), cape and a flying feather
#+created: September 9, 2022
#+since: 3.0.0 (#7002)
* Description :unfold:
This module provides code completion, powered by [[https://github.com/minad/corfu][corfu]].
It is recommended to enable either this or [[doom-module:][:completion company]], in case you
desire pre-configured auto-completion. Corfu is much lighter weight and focused,
plus it's built on native Emacs functionality, whereas company is heavy and
highly non-native, but has some extra features and more maturity.
** Maintainers
- [[doom-user:][@LuigiPiucco]]
[[doom-contrib-maintainer:][Become a maintainer?]]
** Module flags
- +icons ::
Display icons beside completion suggestions.
- +tng ::
Invoke completion on [[kbd:][TAB]]. When corfu is active, [[kbd:][TAB]] and [[kbd:][S-TAB]] will navigate
the completion candidates. Arrow keys and evil-style movement are still
supported.
** Packages
- [[doom-package:][corfu]]
- [[doom-package:][cape]]
- [[doom-package:][kind-icon]] if [[doom-module:][:completion corfu +icons]]
- [[doom-package:][corfu-terminal]] if [[doom-module:][:os tty]]
** Hacks
/No hacks documented for this module./
** TODO Changelog
# This section will be machine generated. Don't edit it by hand.
/This module does not have a changelog yet./
* Installation
Enable this module in your ~doom!~ block.
This module has no direct requirements, but some languages may have their own
requirements to fulfill before you get code completion in them (and some
languages may lack code completion support altogether). Run ~$ doom doctor~ to
find out if you're missing any dependencies. Note that corfu may have support
for completions in languages that have no development intelligence, since it
supports generic, context insensitive candidates such as file names or recurring
words.
* TODO Usage
#+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
** Code completion
By default, completion gets triggered after typing 2 non-space consecutive
characters, or by means of the [[kbd:][C-SPC]] keybinding at any moment. While the popup
is visible, the following relevant keys are available:
| Keybind | Description |
|----------+------------------------------------------------------|
| [[kbd:][<down>]] | Go to next candidate |
| [[kbd:][<up>]] | Go to previous candidate |
| [[kbd:][C-n]] | Go to next candidate |
| [[kbd:][C-p]] | Go to previous candidate |
| [[kbd:][C-j]] | (evil) Go to next candidate |
| [[kbd:][C-k]] | (evil) Go to previous candidate |
| [[kbd:][C-<down>]] | Go to next doc line |
| [[kbd:][C-<up>]] | Go to previous doc line |
| [[kbd:][C-S-n]] | Go to next doc line |
| [[kbd:][C-S-p]] | Go to previous doc line |
| [[kbd:][C-S-j]] | (evil) Go to next doc line |
| [[kbd:][C-S-k]] | (evil) Go to previous doc line |
| [[kbd:][C-h]] | Toggle documentation (if available) |
| [[kbd:][s-<down>]] | Export to minibuffer (if [[doom-module:][:completion vertico]]) |
| [[kbd:][s-j]] | (evil) Export to minibuffer (if [[doom-module:][:completion vertico]]) |
| [[kbd:][RET]] | Insert candidate |
| [[kbd:][C-SPC]] | (when completing) Insert separator (see below) |
| [[kbd:][C-SPC]] | Complete (unless [[doom-module:][:completion corfu +tng]]) |
If you prefer a [[kbd:][TAB]]-centric completion style, enable the [[doom-module:][:completion corfu +tng]]
flag so that, instead, you trigger completion with [[kbd:][TAB]], getting the following
additional binds:
| Keybind | Description |
|---------+--------------------------------------------|
| [[kbd:][TAB]] | Complete |
| [[kbd:][TAB]] | (when completing) Go to next candidate |
| [[kbd:][S-TAB]] | (when completing) Go to previous candidate |
** Searching with multiple keywords
If the [[doom-module:][:completion vertico]] module is enabled, users can perform code completion
with multiple search keywords by use of space as separator. More information can
be found [[https://github.com/oantolin/orderless#company][here]]. Pressing [[kdb:][C-SPC]] again while completing inserts a space as
separator. This allows searching with space-separated terms; each piece will
match individually and in any order, with smart casing. Pressing just [[kbd:][SPC]] acts
as normal and restarts completion, so that when typing sentences it doesn't try
to complete the whole sentence instead of just the word.
Without [[doom-module:][:completion vertico]], it still works, just not as intelligently, due to
the lack of orderless.
** Exporting to the minibuffer (requires [[doom-module:][:completion vertico]])
When using the [[doom-module:][:completion vertico]] module, which pulls in the [[doom-package:][consult]] package,
the entries shown in the completion popup can be exported to a consult
minibuffer, giving access to all the manipulations the vertico suite allows. For
instance, one could use this to export with [[doom-package:][embark]] via [[kbd:][C-c C-l]] and get a buffer
with all candidates.
** Ispell completion
Ispell completion is supported, so long as you point to the right ~.dic~ file in
~ispell-alternate-dictionary~. For selected text modes (see the configuration
section) it completes everywhere, for programming modes it can complete in
comments and strings.
* Configuration
A few variables may be set to change behavior of this module:
- +corfu-auto-delay ::
Number of seconds till completion occurs automatically. Defaults to 0.1.
- +corfu-auto-prefix ::
Number of characters till auto-completion starts to happen. Defaults to 2.
- +corfu-want-multi-component ::
Sets whether orderless-style matching should be supported with space as a
separator.
- +corfu-ispell-completion-modes ::
Lists modes in which to add ~cape-ispell~ as a capf. These show be majorly
text modes, else you will get lots of bad suggestions, since when this matches
it interrupts the flow of candidate selection.
- +corfu-ispell-in-comments-and-strings ::
Whether we should complete when point is inside a string or comment. If
non-nil, works as in a text mode, else gives programming completions just like
in the rest of the buffer.
Additionally, if you prefer to never stop completion on [[kbd:][SPC]], add the following
to your ~config.el~:
#+begin_src emacs-lisp
(map! :map corfu-map
:desc "insert separator" "C-SPC" #'corfu-insert-separator)
#+end_src
* Troubleshooting
[[doom-report:][Report an issue?]]
* Frequently asked questions
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
* TODO Appendix
#+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote

View File

@@ -1,188 +0,0 @@
;;; completion/corfu/config.el -*- lexical-binding: t; -*-
(defvar +corfu-auto-delay 0.1
"How long after point stands still will completion be called automatically,
in seconds.
Setting `corfu-auto-delay' directly may not work, as it needs to be set *before*
enabling `corfu-mode'.")
(defvar +corfu-auto-prefix 2
"How many characters should be typed before auto-complete starts to kick in.
Setting `corfu-auto-prefix' directly may not work, as it needs to be set
*before* enabling `corfu-mode'.")
(defvar +corfu-want-multi-component t
"Enables multiple component search, with pieces separated by spaces.
This allows search of non-contiguous unordered bits, for instance by typing
\"tear rip\" to match \"rip-and-tear\". Notice the space, it does not break
completion in this case.")
(defvar +corfu-icon-height 0.9
"The height applied to the icons (it is passed to both svg-lib and kind-icon).
It may need tweaking for the completions to not become cropped at the end.
Note that changes are applied only after a cache reset, via
`kind-icon-reset-cache'.")
(defvar +corfu-ispell-completion-modes '(org-mode markdown-mode text-mode)
"Modes to enable ispell completion in.
For completion in comments, see `+corfu-ispell-in-comments-and-strings'.")
(defvar +corfu-ispell-in-comments-and-strings t
"Enable completion with ispell inside comments when in a `prog-mode'
derivative.")
;;
;;; Packages
(use-package! corfu
:hook (doom-first-buffer . global-corfu-mode)
:init
;; Auto-completion settings, must be set before calling `global-corfu-mode'.
(setq corfu-auto t
corfu-auto-delay +corfu-auto-delay
corfu-auto-prefix +corfu-auto-prefix
corfu-excluded-modes '(erc-mode
circe-mode
help-mode
gud-mode
vterm-mode))
:config
(when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot)))
(add-hook 'lsp-mode-hook (defun doom--add-lsp-capf ()
(add-to-list 'completion-at-point-functions (cape-capf-buster #'lsp-completion-at-point)))
;; Below is so that context specific completions in cape come first.
:depth 1))
(add-to-list 'completion-styles 'partial-completion t)
(add-to-list 'completion-styles 'initials t)
(setq corfu-cycle t
corfu-separator (when +corfu-want-multi-component ?\s)
corfu-preselect t
corfu-count 16
corfu-max-width 120
corfu-preview-current 'insert
corfu-quit-at-boundary (if +corfu-want-multi-component 'separator t)
corfu-quit-no-match (if +corfu-want-multi-component 'separator t)
;; In the case of +tng, TAB should be smart regarding completion;
;; However, it should otherwise behave like normal, whatever normal was.
tab-always-indent (if (modulep! +tng) 'complete tab-always-indent))
;; Only done with :tools vertico active due to orderless. Alternatively, we
;; could set it up here if it's not there.
(when (and +corfu-want-multi-component (modulep! :completion vertico))
(cond ((modulep! :tools lsp +eglot) (add-to-list 'completion-category-overrides '(eglot (styles orderless))))
((modulep! :tools lsp) (add-hook 'lsp-completion-mode-hook
(defun doom--use-orderless-lsp-capf ()
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
'(orderless)))))))
(map! (:unless (modulep! +tng)
:desc "complete" "C-SPC" #'completion-at-point)
(:map 'corfu-map
(:when +corfu-want-multi-component
:desc "insert separator" "C-SPC" #'corfu-insert-separator)
(:when (modulep! :completion vertico)
:desc "move to minibuffer" "s-<down>" #'corfu-move-to-minibuffer
(:when (modulep! :editor evil)
:desc "move to minibuffer" "s-j" #'corfu-move-to-minibuffer))
(:when (modulep! +tng)
:desc "next" [tab] #'corfu-next
:desc "previous" [backtab] #'corfu-previous
:desc "next" "TAB" #'corfu-next
:desc "previous" "S-TAB" #'corfu-previous))))
;; Taken from corfu's README.
;; TODO: extend this to other completion front-ends, mainly helm and ido, since
;; ivy is being considered for removal.
(when (modulep! :completion vertico)
(defun corfu-move-to-minibuffer ()
(interactive)
(let ((completion-extra-properties corfu--extra)
completion-cycle-threshold completion-cycling)
(apply #'consult-completion-in-region completion-in-region--data))))
(use-package! cape
:after corfu
:commands (cape-dabbrev
cape-file
cape-history
cape-keyword
cape-tex
cape-sgml
cape-rfc1345
cape-abbrev
cape-ispell
cape-dict
cape-symbol
cape-line)
:init
(add-to-list 'completion-at-point-functions #'cape-file)
(when +corfu-ispell-in-comments-and-strings
(defalias 'corfu--ispell-in-comments-and-strings
(cape-super-capf (cape-capf-inside-comment #'cape-ispell)
(cape-capf-inside-string #'cape-ispell)))
(add-hook 'prog-mode-hook
(lambda ()
(add-to-list 'completion-at-point-functions #'corfu--ispell-in-comments-and-strings))))
(dolist (sym +corfu-ispell-completion-modes)
(add-hook (intern (concat (symbol-name sym) "-hook"))
(lambda ()
(add-to-list 'completion-at-point-functions #'cape-ispell))))
(add-hook! '(TeX-mode-hook LaTeX-mode-hook org-mode-hook)
(lambda ()
(add-to-list 'completion-at-point-functions #'cape-tex t))
:depth 2)
(add-hook! '(html-mode-hook +web-react-mode-hook typescript-tsx-mode-hook org-mode-hook markdown-mode-hook)
(lambda ()
(add-to-list 'completion-at-point-functions #'cape-sgml t))
:depth 2)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-keyword)
:config
;; Enhances speed on large projects, for which many buffers may be open.
(setq cape-dabbrev-check-other-buffers nil))
(use-package! kind-icon
:when (modulep! +icons)
:commands kind-icon-margin-formatter
:init
(add-hook 'corfu-margin-formatters #'kind-icon-margin-formatter)
:config
(setq kind-icon-default-face 'corfu-default
kind-icon-blend-background t
kind-icon-blend-frac 0.2)
(plist-put kind-icon-default-style :height +corfu-icon-height)
(plist-put svg-lib-style-default :height +corfu-icon-height))
(use-package! corfu-terminal
:when (and (modulep! :os tty) (not (display-graphic-p)))
:hook (corfu-mode . corfu-terminal-mode))
(use-package! dabbrev
:config
(setq dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'")))
(setq read-extended-command-predicate
#'command-completion-default-include-p)
;;
;;; Extensions
(use-package! corfu-history
:after savehist
:hook (corfu-mode . corfu-history-mode)
:config
(add-to-list 'savehist-additional-variables 'corfu-history))
(use-package! corfu-popupinfo
:hook (corfu-mode . corfu-popupinfo-mode)
:config
(setq corfu-popupinfo-delay '(0.5 . 1.0))
(map! (:map 'corfu-map
:desc "scroll info up" "C-<up>" #'corfu-popupinfo-scroll-down
:desc "scroll info down" "C-<down>" #'corfu-popupinfo-scroll-up
:desc "scroll info up" "C-S-p" #'corfu-popupinfo-scroll-down
:desc "scroll info down" "C-S-n" #'corfu-popupinfo-scroll-up
:desc "toggle info" "C-h" #'corfu-popupinfo-toggle)
(:map 'corfu-popupinfo-map
:when (modulep! :editor evil)
;; Reversed because popupinfo assumes opposite of what feels intuitive
;; with evil.
:desc "scroll info up" "C-S-k" #'corfu-popupinfo-scroll-down
:desc "scroll info down" "C-S-j" #'corfu-popupinfo-scroll-up)))

View File

@@ -1,10 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; completion/corfu/packages.el
(package! corfu :recipe (:files ("*.el" "extensions/*.el")))
(package! cape)
(package! dabbrev)
(when (modulep! +icons)
(package! kind-icon))
(when (modulep! :os tty)
(package! corfu-terminal))

View File

@@ -1,57 +0,0 @@
;;; tools/lsp/+eglot.el -*- lexical-binding: t; -*-
(use-package! eglot
:commands eglot eglot-ensure
:hook (eglot-managed-mode . +lsp-optimization-mode)
:init
(setq eglot-sync-connect 1
eglot-connect-timeout 10
eglot-autoshutdown t
eglot-send-changes-idle-time 0.5
;; NOTE We disable eglot-auto-display-help-buffer because :select t in
;; its popup rule causes eglot to steal focus too often.
eglot-auto-display-help-buffer nil)
(when (modulep! :checkers syntax)
(setq eglot-stay-out-of '(flymake)))
:config
(set-popup-rule! "^\\*eglot-help" :size 0.15 :quit t :select t)
(set-lookup-handlers! 'eglot--managed-mode
:definition #'xref-find-definitions
:references #'xref-find-references
:implementations #'eglot-find-implementation
:type-definition #'eglot-find-typeDefinition
:documentation #'+eglot-lookup-documentation)
(add-to-list 'doom-debug-variables '(eglot-events-buffer-size . 0))
(when (modulep! :checkers syntax)
(after! flycheck
(load! "autoload/flycheck-eglot")))
(defadvice! +lsp--defer-server-shutdown-a (fn &optional server)
"Defer server shutdown for a few seconds.
This gives the user a chance to open other project files before the server is
auto-killed (which is a potentially expensive process). It also prevents the
server getting expensively restarted when reverting buffers."
:around #'eglot--managed-mode
(letf! (defun eglot-shutdown (server)
(if (or (null +lsp-defer-shutdown)
(eq +lsp-defer-shutdown 0))
(prog1 (funcall eglot-shutdown server)
(+lsp-optimization-mode -1))
(run-at-time
(if (numberp +lsp-defer-shutdown) +lsp-defer-shutdown 3)
nil (lambda (server)
(unless (eglot--managed-buffers server)
(prog1 (funcall eglot-shutdown server)
(+lsp-optimization-mode -1))))
server)))
(funcall fn server))))
(use-package! consult-eglot
:defer t
:when (modulep! :completion vertico)
:init
(map! :map eglot-mode-map [remap xref-find-apropos] #'consult-eglot-symbols))

View File

@@ -1,193 +0,0 @@
;;; tools/lsp/+lsp.el -*- lexical-binding: t; -*-
(defvar +lsp-company-backends
(if (modulep! :editor snippets)
'(:separate company-capf company-yasnippet)
'company-capf)
"The backends to prepend to `company-backends' in `lsp-mode' buffers.
Can be a list of backends; accepts any value `company-backends' accepts.")
;;
;;; Packages
(use-package! lsp-mode
:commands lsp-install-server
:init
;; Don't touch ~/.emacs.d, which could be purged without warning
(setq lsp-session-file (concat doom-cache-dir "lsp-session")
lsp-server-install-dir (concat doom-data-dir "lsp"))
;; Don't auto-kill LSP server after last workspace buffer is killed, because I
;; will do it for you, after `+lsp-defer-shutdown' seconds.
(setq lsp-keep-workspace-alive nil)
;; NOTE I tweak LSP's defaults in order to make its more expensive or imposing
;; features opt-in. Some servers implement these poorly and, in most
;; cases, it's safer to rely on Emacs' native mechanisms (eldoc vs
;; lsp-ui-doc, open in popup vs sideline, etc).
;; Disable features that have great potential to be slow.
(setq lsp-enable-folding nil
lsp-enable-text-document-color nil)
;; Reduce unexpected modifications to code
(setq lsp-enable-on-type-formatting nil)
;; Make breadcrumbs opt-in; they're redundant with the modeline and imenu
(setq lsp-headerline-breadcrumb-enable nil)
;; Let doom bind the lsp keymap.
(when (modulep! :config default +bindings)
(setq lsp-keymap-prefix nil))
:config
(add-to-list 'doom-debug-variables 'lsp-log-io)
(setq lsp-intelephense-storage-path (concat doom-data-dir "lsp-intelephense/")
lsp-vetur-global-snippets-dir
(expand-file-name
"vetur" (or (bound-and-true-p +snippets-dir)
(concat doom-user-dir "snippets/")))
lsp-xml-jar-file (expand-file-name "org.eclipse.lsp4xml-0.3.0-uber.jar" lsp-server-install-dir)
lsp-groovy-server-file (expand-file-name "groovy-language-server-all.jar" lsp-server-install-dir))
;; REVIEW Remove this once this is fixed upstream.
(add-to-list 'lsp-client-packages 'lsp-racket)
(add-hook! 'doom-escape-hook
(defun +lsp-signature-stop-maybe-h ()
"Close the displayed `lsp-signature'."
(when lsp-signature-mode
(lsp-signature-stop)
t)))
(set-popup-rule! "^\\*lsp-\\(help\\|install\\)" :size 0.35 :quit t :select t)
(set-lookup-handlers! 'lsp-mode
:definition #'+lsp-lookup-definition-handler
:references #'+lsp-lookup-references-handler
:documentation '(lsp-describe-thing-at-point :async t)
:implementations '(lsp-find-implementation :async t)
:type-definition #'lsp-find-type-definition)
(defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args)
"Ensure user-defined `flycheck-checker' isn't overwritten by `lsp'."
:around #'lsp-diagnostics-flycheck-enable
(if flycheck-checker
(let ((old-checker flycheck-checker))
(apply fn args)
(setq-local flycheck-checker old-checker))
(apply fn args)))
(add-hook! 'lsp-mode-hook #'+lsp-optimization-mode)
(when (modulep! :completion company)
(add-hook! 'lsp-completion-mode-hook
(defun +lsp-init-company-backends-h ()
(when lsp-completion-mode
(set (make-local-variable 'company-backends)
(cons +lsp-company-backends
(remove +lsp-company-backends
(remq 'company-capf company-backends))))))))
(defvar +lsp--deferred-shutdown-timer nil)
(defadvice! +lsp-defer-server-shutdown-a (fn &optional restart)
"Defer server shutdown for a few seconds.
This gives the user a chance to open other project files before the server is
auto-killed (which is a potentially expensive process). It also prevents the
server getting expensively restarted when reverting buffers."
:around #'lsp--shutdown-workspace
(if (or lsp-keep-workspace-alive
restart
(null +lsp-defer-shutdown)
(= +lsp-defer-shutdown 0))
(prog1 (funcall fn restart)
(+lsp-optimization-mode -1))
(when (timerp +lsp--deferred-shutdown-timer)
(cancel-timer +lsp--deferred-shutdown-timer))
(setq +lsp--deferred-shutdown-timer
(run-at-time
(if (numberp +lsp-defer-shutdown) +lsp-defer-shutdown 3)
nil (lambda (workspace)
(with-lsp-workspace workspace
(unless (lsp--workspace-buffers workspace)
(let ((lsp-restart 'ignore))
(funcall fn))
(+lsp-optimization-mode -1))))
lsp--cur-workspace))))
(when (modulep! :ui modeline +light)
(defvar-local lsp-modeline-icon nil)
(add-hook! '(lsp-before-initialize-hook
lsp-after-initialize-hook
lsp-after-uninitialized-functions
lsp-before-open-hook
lsp-after-open-hook)
(defun +lsp-update-modeline (&rest _)
"Update modeline with lsp state."
(let* ((workspaces (lsp-workspaces))
(face (if workspaces 'success 'warning))
(label (if workspaces "LSP Connected" "LSP Disconnected")))
(setq lsp-modeline-icon (concat
" "
(+modeline-format-icon 'faicon "rocket" "" face label -0.0575)
" "))
(add-to-list 'global-mode-string
'(t (:eval lsp-modeline-icon)))))))
(when (modulep! :completion corfu)
(setq lsp-completion-provider :none)
(add-hook 'lsp-mode-hook #'lsp-completion-mode)))
(use-package! lsp-ui
:hook (lsp-mode . lsp-ui-mode)
:init
(defadvice! +lsp--use-hook-instead-a (fn &rest args)
"Change `lsp--auto-configure' to not force `lsp-ui-mode' on us. Using a hook
instead is more sensible."
:around #'lsp--auto-configure
(letf! ((#'lsp-ui-mode #'ignore))
(apply fn args)))
:config
(when (modulep! +peek)
(set-lookup-handlers! 'lsp-ui-mode
:definition 'lsp-ui-peek-find-definitions
:implementations 'lsp-ui-peek-find-implementation
:references 'lsp-ui-peek-find-references
:async t))
(setq lsp-ui-peek-enable (modulep! +peek)
lsp-ui-doc-max-height 8
lsp-ui-doc-max-width 72 ; 150 (default) is too wide
lsp-ui-doc-delay 0.75 ; 0.2 (default) is too naggy
lsp-ui-doc-show-with-mouse nil ; don't disappear on mouseover
lsp-ui-doc-position 'at-point
lsp-ui-sideline-ignore-duplicate t
;; Don't show symbol definitions in the sideline. They are pretty noisy,
;; and there is a bug preventing Flycheck errors from being shown (the
;; errors flash briefly and then disappear).
lsp-ui-sideline-show-hover nil
;; Re-enable icon scaling (it's disabled by default upstream for Emacs
;; 26.x compatibility; see emacs-lsp/lsp-ui#573)
lsp-ui-sideline-actions-icon lsp-ui-sideline-actions-icon-default)
(map! :map lsp-ui-peek-mode-map
"j" #'lsp-ui-peek--select-next
"k" #'lsp-ui-peek--select-prev
"C-k" #'lsp-ui-peek--select-prev-file
"C-j" #'lsp-ui-peek--select-next-file))
(use-package! helm-lsp
:when (modulep! :completion helm)
:commands helm-lsp-workspace-symbol helm-lsp-global-workspace-symbol)
(use-package! lsp-ivy
:when (modulep! :completion ivy)
:commands lsp-ivy-workspace-symbol lsp-ivy-global-workspace-symbol)
(use-package! consult-lsp
:defer t
:when (modulep! :completion vertico)
:init
(map! :map lsp-mode-map [remap xref-find-apropos] #'consult-lsp-symbols))

View File

@@ -1,155 +0,0 @@
#+title: :tools lsp
#+subtitle: M-x vscode
#+created: March 05, 2019
#+since: 21.12.0
* Description :unfold:
This module integrates [[https://langserver.org/][language servers]] into Doom Emacs. They provide features
you'd expect from IDEs, like code completion, realtime linting, language-aware
[[doom-package:imenu]]/[[doom-package:xref]] integration, jump-to-definition/references support, and more.
As of this writing, this is the state of LSP support in Doom Emacs:
| Module | Major modes | Default language server |
|------------------+---------------------------------------------------------+---------------------------------------------------------------|
| [[doom-module::lang cc]] | c-mode, c++-mode, objc-mode | ccls, clangd |
| [[doom-module::lang clojure]] | clojure-mode | clojure-lsp |
| [[doom-module::lang csharp]] | csharp-mode | omnisharp |
| [[doom-module::lang elixir]] | elixir-mode | elixir-ls |
| [[doom-module::lang fsharp]] | fsharp-mode | Mono, .NET core |
| [[doom-module::lang go]] | go-mode | go-langserver |
| [[doom-module::lang haskell]] | haskell-mode | haskell-language-server |
| [[doom-module::lang java]] | java-mode | lsp-java |
| [[doom-module::lang javascript]] | js2-mode, rjsx-mode, typescript-mode | ts-ls, deno-ls |
| [[doom-module::lang julia]] | julia-mode | LanguageServer.jl |
| [[doom-module::lang ocaml]] | tuareg-mode | ocaml-language-server |
| [[doom-module::lang php]] | php-mode | php-language-server |
| [[doom-module::lang purescript]] | purescript-mode | purescript-language-server |
| [[doom-module::lang python]] | python-mode | lsp-python-ms |
| [[doom-module::lang ruby]] | ruby-mode | solargraph |
| [[doom-module::lang rust]] | rust-mode | rls |
| [[doom-module::lang scala]] | scala-mode | metals |
| [[doom-module::lang sh]] | sh-mode | bash-language-server |
| [[doom-module::lang swift]] | swift-mode | sourcekit |
| [[doom-module::lang web]] | web-mode, css-mode, scss-mode, sass-mode, less-css-mode | vscode-css-languageserver-bin, vscode-html-languageserver-bin |
| [[doom-module::lang zig]] | zig-mode | zls |
** Maintainers
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
** Module flags
- +eglot ::
Use [[https://elpa.gnu.org/packages/eglot.html][Eglot]] instead of [[https://github.com/emacs-lsp/lsp-mode][LSP-mode]] to implement the LSP client in Emacs.
- +peek ::
Use ~lsp-ui-peek~ when looking up definitions and references with
functionality from the [[doom-module::tools lookup]] module.
** Packages
- [[doom-package:lsp-mode]]
- [[doom-package:lsp-ui]]
- [[doom-package:lsp-ivy]] ([[doom-module::completion ivy]])
- [[doom-package:helm-lsp]] ([[doom-module::completion helm]])
- [[doom-package:consult-lsp]] ([[doom-module::completion vertico]])
- [[doom-package:eglot]]
** Hacks
/No hacks documented for this module./
** TODO Changelog
# This section will be machine generated. Don't edit it by hand.
/This module does not have a changelog yet./
* Installation
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
To get LSP working, you'll need to do three things:
1. Enable this module,
2. Install a language server appropriate for your targeted language(s).
3. Enable the [[doom-module:+lsp]] flag on the [[doom-module::lang]] modules you want to enable LSP support for.
Different languages will need different language servers, some of which [[doom-package:lsp-mode]]
will prompt you to auto-install, but [[doom-package:eglot]] will not.
A table that lists available language servers and how to install them can be
found [[https://emacs-lsp.github.io/lsp-mode/page/languages/][on the lsp-mode project README]]. The documentation of the module for your
targeted language will contain brief instructions as well.
For eglot users, a list of [[https://github.com/joaotavora/eglot/blob/master/README.md#connecting-to-a-server][default servers supported is on Eglot's README]],
including instructions to register your own.
* TODO Usage
#+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
** LSP-powered project search
Without the [[doom-module:+eglot]] flag, and when [[doom-module::completion ivy]], [[doom-module::completion helm]] or
[[doom-module::completion vertico]] is active, LSP is used to search a symbol indexed by the LSP
server:
| Keybind | Description |
|---------+-------------------------------------|
| [[kbd:][SPC c j]] | Jump to symbol in current workspace |
| [[kbd:][SPC c J]] | Jump to symbol in any workspace |
** Differences between eglot and lsp-mode
The two projects are large and actively developed, so without writing a novel,
it can only be compared in (very) broad strokes:
- [[doom-package:lsp-mode]] tends to be more featureful, beginner-friendly (e.g. offers to
install servers for you and has more [[https://emacs-lsp.github.io/lsp-mode][helpful documentation]]), and has a user
experience that feels familiar to modern editors/IDEs, but at the cost of
performance (at baseline) and complexity (it has more moving parts and
reinvents a number of wheels to achieve a slicker UI, like ~lsp-ui-peek~,
~lsp-ui-sideline~, etc).
- [[doom-package:eglot]] has fewer bells and whistles: it relies on built-in Emacs functionality
more (eldoc, xref, capf, project.el, etc), offers less pre-configuration for
you, and is more performant than lsp-mode (again, at baseline). It also works
with TRAMP out-of-the-box (lsp-mode needs some extra configuration).
#+begin_quote
💬 I recommend beginners use lsp-mode. More experienced users may also opt to
disable many of [[https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/][its inessential features]] to gain back some ground on
performance and complexity costs.
#+end_quote
All that said, it's easy to switch between the two implementations by swapping
in/out the [[doom-module:+lsp]] or [[doom-module:+eglot]] flag when [[id:01cffea4-3329-45e2-a892-95a384ab2338][enabling this module]].
* TODO Configuration
#+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
** Turn off lsp-mode's intrusive features
Many users may not like how many UI elements that lsp-mode adds. They have [[https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/][some
excellent documentation]] outlining what these features are called and how to turn
them off.
* Troubleshooting
[[doom-report:][Report an issue?]]
** My language server is not found
Check the entry in the [[../../../docs/faq.org][FAQ]] about "Doom can't find my executables/doesn't inherit
the correct ~PATH~"
** LSP/Eglot is not started automatically in my buffer
Make sure that you have enabled the [[doom-module:+lsp]] flag on the appropriate module(s) (in
your ~doom!~ block in =$DOOMDIR/init.el=):
#+begin_src diff
:lang
-python
+(python +lsp)
#+end_src
** LSP is slow
Follow [[https://emacs-lsp.github.io/lsp-mode/page/performance/#tuning][lsp-tuning-guide]] to further fine-tune LSP mode performance.
* Frequently asked questions
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
* TODO Appendix
#+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote

View File

@@ -1,10 +0,0 @@
;;; tools/lsp/autoload/common.el -*- lexical-binding: t; -*-
;;;###autodef (fset 'lsp! #'ignore)
(defun lsp! ()
"Dispatch to call the currently used lsp client entrypoint"
(interactive)
(if (modulep! +eglot)
(eglot-ensure)
(unless (bound-and-true-p lsp-mode)
(lsp-deferred))))

View File

@@ -1,39 +0,0 @@
;;; tools/lsp/autoload/eglot.el -*- lexical-binding: t; -*-
;;;###if (modulep! +eglot)
;;;###autodef
(defun set-eglot-client! (mode server-call)
"Add SERVER-CALL list as a possible lsp server for given major MODE.
Example : (set-eglot-client! 'python-mode `(,(concat doom-data-dir \"lsp/mspyls/Microsoft.Python.LanguageServer\")))"
(after! eglot
(add-to-list 'eglot-server-programs `(,mode . ,server-call))))
;; HACK Eglot removed `eglot-help-at-point' in joaotavora/eglot@a044dec for a
;; more problematic approach of deferred to eldoc. Here, I've restored it.
;; Doom's lookup handlers try to open documentation in a separate window
;; (so they can be copied or kept open), but doing so with an eldoc buffer
;; is difficult because a) its contents are generated asynchronously,
;; making them tough to scrape, and b) their contents change frequently
;; (every time you move your cursor).
(defvar +eglot--help-buffer nil)
;;;###autoload
(defun +eglot-lookup-documentation (_identifier)
"Request documentation for the thing at point."
(eglot--dbind ((Hover) contents range)
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
(eglot--TextDocumentPositionParams))
(let ((blurb (and (not (seq-empty-p contents))
(eglot--hover-info contents range)))
(hint (thing-at-point 'symbol)))
(if blurb
(with-current-buffer
(or (and (buffer-live-p +eglot--help-buffer)
+eglot--help-buffer)
(setq +eglot--help-buffer (generate-new-buffer "*eglot-help*")))
(with-help-window (current-buffer)
(rename-buffer (format "*eglot-help for %s*" hint))
(with-current-buffer standard-output (insert blurb))
(setq-local nobreak-char-display nil)))
(display-local-help))))
'deferred)

View File

@@ -1,76 +0,0 @@
;;; flycheck-eglot --- Hacky eglot support in flycheck -*- lexical-binding: t; -*-
;;; Commentary:
;; This file sets up flycheck so that, when eglot receives a publishDiagnostics method
;; from the server, flycheck updates the reports.
;;
;; Thanks to:
;; - joaotavora for adding a handle to plug flycheck, and
;; - purcell for finding out the initial stub and the current implementation
;;
;; It works by creating a bridge function which can be used as the argument of
;; `eglot-flymake-backend', which both consumes diagnostics and queue a call to
;; 'flycheck-buffer'
;;
;;; Code:
(defvar-local +lsp--flycheck-eglot--current-errors nil)
(defun +lsp--flycheck-eglot-init (checker callback)
"CHECKER is the checker (eglot).
CALLBACK is the function that we need to call when we are done, on all the errors."
(eglot-flymake-backend #'+lsp--flycheck-eglot--on-diagnostics)
(funcall callback 'finished +lsp--flycheck-eglot--current-errors))
(defun +lsp--flycheck-eglot--on-diagnostics (diags &rest _)
(cl-labels
((flymake-diag->flycheck-err
(diag)
(with-current-buffer (flymake--diag-buffer diag)
(flycheck-error-new-at-pos
(flymake--diag-beg diag)
(pcase (flymake--diag-type diag)
('eglot-note 'info)
('eglot-warning 'warning)
('eglot-error 'error)
(_ (error "Unknown diagnostic type, %S" diag)))
(flymake--diag-text diag)
:end-pos (flymake--diag-end diag)
:checker 'eglot
:buffer (current-buffer)
:filename (buffer-file-name)))))
(setq +lsp--flycheck-eglot--current-errors
(mapcar #'flymake-diag->flycheck-err diags))
;; Call Flycheck to update the diagnostics annotations
(flycheck-buffer-deferred)))
(defun +lsp--flycheck-eglot-available-p ()
(bound-and-true-p eglot--managed-mode))
(flycheck-define-generic-checker 'eglot
"Report `eglot' diagnostics using `flycheck'."
:start #'+lsp--flycheck-eglot-init
:predicate #'+lsp--flycheck-eglot-available-p
:modes '(prog-mode text-mode))
(push 'eglot flycheck-checkers)
(add-hook! 'eglot-managed-mode-hook
(defun +lsp-eglot-prefer-flycheck-h ()
(when eglot--managed-mode
(flymake-mode -1)
(when-let ((current-checker (flycheck-get-checker-for-buffer)))
(unless (equal current-checker 'eglot)
(flycheck-add-next-checker 'eglot current-checker)))
(flycheck-add-mode 'eglot major-mode)
(flycheck-mode 1)
;; Call flycheck on initilization to make sure to display initial
;; errors
(flycheck-buffer-deferred))))
(after! flymake
(when (and
(not (fboundp 'flymake--diag-buffer))
(fboundp 'flymake--diag-locus))
(defalias 'flymake--diag-buffer 'flymake--diag-locus)))
;;; flycheck-eglot.el ends here

View File

@@ -1,75 +0,0 @@
;;; tools/lsp/autoload/lsp-mode.el -*- lexical-binding: t; -*-
;;;###if (not (modulep! +eglot))
;;;###autodef
(defun set-lsp-priority! (client priority)
"Change the PRIORITY of lsp CLIENT."
(require 'lsp-mode)
(if-let (client (gethash client lsp-clients))
(setf (lsp--client-priority client)
priority)
(error "No LSP client named %S" client)))
;;;###autoload
(defun +lsp/uninstall-server (dir)
"Delete a LSP server from `lsp-server-install-dir'."
(interactive
(list (read-directory-name "Uninstall LSP server: " lsp-server-install-dir nil t)))
(unless (file-directory-p dir)
(user-error "Couldn't find %S directory" dir))
(delete-directory dir 'recursive)
(message "Uninstalled %S" (file-name-nondirectory dir)))
;;;###autoload
(defun +lsp/switch-client (client)
"Switch to another LSP server."
(interactive
(progn
(require 'lsp-mode)
(list (completing-read
"Select server: "
(or (mapcar #'lsp--client-server-id (lsp--filter-clients (-andfn #'lsp--supports-buffer?
#'lsp--server-binary-present?)))
(user-error "No available LSP clients for %S" major-mode))))))
(require 'lsp-mode)
(let* ((client (if (symbolp client) client (intern client)))
(match (car (lsp--filter-clients (lambda (c) (eq (lsp--client-server-id c) client)))))
(workspaces (lsp-workspaces)))
(unless match
(user-error "Couldn't find an LSP client named %S" client))
(let ((old-priority (lsp--client-priority match)))
(setf (lsp--client-priority match) 9999)
(unwind-protect
(if workspaces
(lsp-workspace-restart
(if (cdr workspaces)
(lsp--completing-read "Select server: "
workspaces
'lsp--workspace-print
nil t)
(car workspaces)))
(lsp-mode +1))
(add-transient-hook! 'lsp-after-initialize-hook
(setf (lsp--client-priority match) old-priority))))))
;;;###autoload
(defun +lsp-lookup-definition-handler ()
"Find definition of the symbol at point using LSP."
(interactive)
(when-let (loc (lsp-request "textDocument/definition"
(lsp--text-document-position-params)))
(lsp-show-xrefs (lsp--locations-to-xref-items loc) nil nil)
'deferred))
;;;###autoload
(defun +lsp-lookup-references-handler (&optional include-declaration)
"Find project-wide references of the symbol at point using LSP."
(interactive "P")
(when-let
(loc (lsp-request "textDocument/references"
(append (lsp--text-document-position-params)
(list
:context `(:includeDeclaration
,(lsp-json-bool include-declaration))))))
(lsp-show-xrefs (lsp--locations-to-xref-items loc) nil t)
'deferred))

View File

@@ -1,47 +0,0 @@
;;; tools/lsp/config.el -*- lexical-binding: t; -*-
(defvar +lsp-defer-shutdown 3
"If non-nil, defer shutdown of LSP servers for this many seconds after last
workspace buffer is closed.
This delay prevents premature server shutdown when a user still intends on
working on that project after closing the last buffer, or when programmatically
killing and opening many LSP/eglot-powered buffers.")
;;
;;; Common
(defvar +lsp--default-read-process-output-max nil)
(defvar +lsp--default-gcmh-high-cons-threshold nil)
(defvar +lsp--optimization-init-p nil)
(define-minor-mode +lsp-optimization-mode
"Deploys universal GC and IPC optimizations for `lsp-mode' and `eglot'."
:global t
:init-value nil
(if (not +lsp-optimization-mode)
(setq-default read-process-output-max +lsp--default-read-process-output-max
gcmh-high-cons-threshold +lsp--default-gcmh-high-cons-threshold
+lsp--optimization-init-p nil)
;; Only apply these settings once!
(unless +lsp--optimization-init-p
(setq +lsp--default-read-process-output-max (default-value 'read-process-output-max)
+lsp--default-gcmh-high-cons-threshold (default-value 'gcmh-high-cons-threshold))
(setq-default read-process-output-max (* 1024 1024))
;; REVIEW LSP causes a lot of allocations, with or without the native JSON
;; library, so we up the GC threshold to stave off GC-induced
;; slowdowns/freezes. Doom uses `gcmh' to enforce its GC strategy,
;; so we modify its variables rather than `gc-cons-threshold'
;; directly.
(setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold))
(gcmh-set-high-threshold)
(setq +lsp--optimization-init-p t))))
;;
;;; Implementations
(if (modulep! +eglot)
(load! "+eglot")
(load! "+lsp"))

View File

@@ -1,9 +0,0 @@
;;; tools/lsp/doctor.el -*- lexical-binding: t; -*-
(assert! (not (and (modulep! +eglot)
(modulep! +peek)))
"+eglot and +peek flags are not compatible. Peek uses lsp-mode, while Eglot is another package altogether for LSP.")
(unless (executable-find "npm")
(warn! "Couldn't find npm, most server installers won't work and will have to be installed manually.
For more information, see https://emacs-lsp.github.io/lsp-mode/page/languages/."))

View File

@@ -1,16 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; tools/lsp/packages.el
(if (modulep! +eglot)
(progn
(package! eglot :pin "e501275e06952889056268dabe08ccd0dbaf23e5")
(when (modulep! :completion vertico)
(package! consult-eglot :pin "0da8801dd8435160ce1f62ad8066bd52e38f5cbd")))
(package! lsp-mode :pin "a3b3c15359405f442fc51a2db09e503ca3b39f3d")
(package! lsp-ui :pin "3cd7cc61273341023b863dcf45906ac9142fd1aa")
(when (modulep! :completion ivy)
(package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106"))
(when (modulep! :completion helm)
(package! helm-lsp :pin "c2c6974dadfac459b1a69a1217441283874cea92"))
(when (modulep! :completion vertico)
(package! consult-lsp :pin "58b541476203fa68e9e7682531f2a10e11780857")))

Binary file not shown.

260
dots/doom/config.el Executable file → Normal file
View File

@@ -5,250 +5,60 @@
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Zastian Pretorius"
user-mail-address "Zastian00@gmail.com")
;; clients, file templates and snippets. It is optional.
;; (setq user-full-name "John Doe"
;; user-mail-address "john@doe.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-symbol-font' -- for symbols
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
;;(add-to-list 'load-path "~/.config/doom/themes")
(setq doom-theme 'doom-dracula)
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
(add-to-list 'load-path "~/.config/doom/lisp")
(require 'direnv)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type `relative)
;; scroll one line at a time (less "jumpy" than defaults)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
(setq scroll-step 1) ;; keyboard scroll one line at a time
(setq auto-window-vscroll nil)
(set-fontset-font "fontset-default" nil (font-spec :size 17 :name "ZedMono Nerd Font"))
(setq doom-font (font-spec :family "Illusion Z" :size 17)
doom-variable-pitch-font (font-spec :family "Illusion Z" :size 17)
doom-big-font (font-spec :family "Illusion Z" :size 24))
(require 'whitespace)
(setq whitespace-line-column 99)
(setq whitespace-style '(face lines-tail))
(add-hook 'prog-mode-hook 'whitespace-mode)
(require 'fill-column-indicator)
(setq fci-rule-column 99)
(setq fci-rule-width 1)
(setq fci-rule-color "#a280d5")
(add-hook 'prog-mode-hook 'fci-mode)
;; tab width
(setq-default tab-width 4) ;; Set tab width to 2 spaces
(setq-default indent-tabs-mode nil) ;; Use spaces instead of tabs
(add-hook 'prog-mode-hook
(lambda ()
(setq-local tab-width 4)
(setq-local indent-tabs-mode nil)))
(setq lisp-indent-offset 4)
(use-package nix-mode
:mode "\\.nix\\'"
:config
(setq nix-indent-function (lambda (_) 4)))
(setq rust-indent-offset 4)
(custom-set-faces
'(org-level-1 ((t (:inherit outline-1 :height 1.4))))
'(org-level-2 ((t (:inherit outline-2 :height 1.3))))
'(org-level-3 ((t (:inherit outline-3 :height 1.2))))
'(org-level-4 ((t (:inherit outline-4 :height 1.1))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0)))))
;; company mode delay 0
(setq company-idle-delay 0)
;;japanese stuff
(setq default-input-method "japanese")
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-footer)
(add-hook! '+doom-dashboard-functions :append
(insert "\n" (+doom-dashboard--center +doom-dashboard--width "The UwU Editor")))
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
(setq org-image-actual-width 300)
(setq fancy-splash-image (concat doom-user-dir "xenia.png"))
(setq ess-r--no-company-meta t)
(set-frame-parameter nil 'alpha-background 90) ; For current frame
(add-to-list 'default-frame-alist '(alpha-background . 90)) ; For all new frames henceforth
(add-to-list 'default-frame-alist '(undecorated . t))
;undo fix
(setq undo-tree-enable-undo-in-region nil)
(setq undo-limit 8000000000)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(julia . t)
(python . t)
(jupyter . t)))
;; accept completion from copilot and fallback to company
(defun my-tab ()
(interactive)
(or (copilot-accept-completion)
(company-indent-or-complete-common nil)))
(use-package! copilot
:hook (prog-mode . copilot-mode)
:bind (("C-TAB" . 'copilot-accept-completion-by-word)
("C-<tab>" . 'copilot-accept-completion-by-word)
:map company-active-map
("<tab>" . 'my-tab)
("TAB" . 'my-tab)
:map company-mode-map
("<tab>" . 'my-tab)
("TAB" . 'my-tab)))
(setq copilot-log-max 1000)
;; asm stuff
(use-package! nasm-mode
:mode "\\.[n]*\\(asm\\|s\\)\\'")
;; Get Haxor VM from https://github.com/krzysztof-magosa/haxor
(use-package! haxor-mode
:mode "\\.hax\\'")
(use-package! mips-mode
:mode "\\.mips\\'")
(use-package! riscv-mode
:mode "\\.riscv\\'")
(use-package x86-lookup
:ensure t
:config
(setq x86-lookup-pdf "~/.config/doom/asm-ref.pdf"))
(setq openai-key (getenv "OPENAIKEY"))
(setq chatgpt-input-method 'minibuffer)
;;discord rich presence
;;(require 'elcord)
;;(add-hook 'doom-switch-buffer-hook
;; (lambda ()
;; (if (string= (buffer-name) "*doom*")
;; (elcord-mode -1)
;; (elcord-mode 1))))
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;;(defun elcord--disable-elcord-if-no-frames (f)
;; (declare (ignore f))
;; (when (let ((frames (delete f (visible-frame-list))))
;; (or (null frames)
;; (and (null (cdr frames))
;; (eq (car frames) terminal-frame))))
;; (elcord-mode -1)
;; (add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created)))
;;
;;(defun elcord--enable-on-frame-created (f)
;; (declare (ignore f))
;; (elcord-mode +1))
;;
;;(defun my/elcord-mode-hook ()
;; (if elcord-mode
;; (add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames)
;; (remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames)))
;;
;;(add-hook 'elcord-mode-hook 'my/elcord-mode-hook)
;;
;;(setq elcord-idle-message "Out doing your mom")
;; add my_stuff.el here and load it
(load! "my_stuff.el")
;;ollama stuff
;;
(use-package ellama
:init
;; setup key bindings
(setopt ellama-keymap-prefix "C-c e")
;; language you want ellama to translate to
(setopt ellama-language "English")
;; could be llm-openai for example
(require 'llm-ollama)
(setopt ellama-provider
(make-llm-ollama
;; this model should be pulled to use it
;; value should be the same as you print in terminal during pull
:chat-model "codellama:13b"
:embedding-model "codellama:13b"))
)
(use-package qml-ts-mode
:after lsp-mode
:config
(add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("qmlls", "-E"))
:activation-fn (lsp-activate-on "qml-ts")
:server-id 'qmlls))
(add-hook 'qml-ts-mode-hook (lambda ()
(setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,))
(lsp-deferred))))
;; custom functions
;; Here are some additional functions/macros that could help you configure Doom:
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
@@ -261,6 +71,8 @@
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

View File

@@ -1,24 +0,0 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(elfeed-feeds '("https://www.reddit.com/r/pcmasterrace/rss"))
'(warning-suppress-log-types '((initialization)))
'(warning-suppress-types
'((lsp-mode)
(lsp-mode)
(lsp-mode)
(lsp-mode)
(initialization)
(initialization))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-level-1 ((t (:inherit outline-1 :height 1.4))))
'(org-level-2 ((t (:inherit outline-2 :height 1.3))))
'(org-level-3 ((t (:inherit outline-3 :height 1.2))))
'(org-level-4 ((t (:inherit outline-4 :height 1.1))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0)))))

91
dots/doom/init.el Executable file → Normal file
View File

@@ -4,8 +4,8 @@
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a "Module Index" link where you'll find
;; a comprehensive list of Doom's modules and what flags they support.
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
@@ -15,17 +15,18 @@
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
japanese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
;;(corfu +icons +orderless) ; the even more ultimate completion backend
(company +icons +childframe) ; the ultimate code completion backend
;;(helm +fuzzy) ; the *other* search engine for love and life
;;company ; the ultimate code completion backend
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;(ivy +fuzzy) ; a search engine for love and life
(vertico +icons) ; the search engine of the future
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
@@ -34,19 +35,19 @@
doom-quit ; DOOM quit-message prompts when you quit Emacs
(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
indent-guides ; highlighted indent columns
;;(ligatures +hasklig) ; ligatures and symbols to make your code pretty again
minimap ; show a map of the code on the side
;;indent-guides ; highlighted indent columns
;;ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
smooth-scroll ; So smooth you won't believe it's not butter
;;tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
@@ -56,7 +57,7 @@
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
@@ -67,8 +68,9 @@
;;word-wrap ; soft wrapping with language-aware indent
:emacs
(dired +icons) ; making dired pretty [functional]
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;eww ; the internet is gross
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
@@ -86,31 +88,28 @@
:tools
;;ansible
collab
biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
debugger ; FIXME stepping through code, to help you add bugs
direnv
;;docker
docker
;;editorconfig ; let someone else argue about tabs vs spaces
ein ; tame Jupyter notebooks with emacs
;;biblio ; Writes a PhD for you (citation needed)
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
;;llm ; when I said you needed friends, I didn't mean...
lsp ; M-x vscode
;;lsp2 ; my custom one
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
@@ -118,12 +117,12 @@
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
(csharp +lsp) ; unity, .NET, and mono shenanigans
csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
@@ -132,32 +131,36 @@
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
(gdscript +lsp) ; the language you waited for
;;gdscript ; the language you waited for
(go +lsp) ; the hipster dialect
(haskell +lsp) ; a language that's lazier than I am
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
;;json ; At least it ain't XML
(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
json ; At least it ain't XML
;;janet ; Fun fact: Janet is me!
;;(java +lsp) ; the poster child for carpal tunnel syndrome
javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
lua ; one-based indices? one-based indices
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
(nix +lsp) ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +lsp) ; organize your plain life in plain text
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
;;purescript ; javascript, but functional
(python +lsp) ; beautiful is better than ugly
qt ; the 'cutest' gui framework ever
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
@@ -174,6 +177,7 @@
;;web ; the tubes
;;yaml ; JSON, but readable
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
@@ -184,8 +188,7 @@
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
;;(rss +org) ; emacs as an RSS reader
:config
;;literate

View File

@@ -1,112 +0,0 @@
;;; ollama.el --- ollama client for Emacs
;; Copyright (C) 2023 ZHOU Feng
;; Author: ZHOU Feng <zf.pascal@gmail.com>
;; URL: http://github.com/zweifisch/ollama
;; Keywords: ollama llama2
;; Version: 0.0.1
;; Created: 6th Aug 2023
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; ollama client for Emacs
;;
;;; Code:
(require 'json)
(require 'cl-lib)
(require 'url)
(defgroup ollama nil
"Ollama client for Emacs."
:group 'ollama)
(defcustom ollama:endpoint "http://localhost:11434/api/generate"
"Ollama http service endpoint."
:group 'ollama
:type 'string)
(defcustom ollama:model "codellama:13b"
"Ollama model."
:group 'ollama
:type 'string)
(defcustom ollama:language "English"
"Language to translate to."
:group 'ollama
:type 'string)
(defun ollama-fetch (url prompt model)
(let* ((url-request-method "POST")
(url-request-extra-headers
'(("Content-Type" . "application/json")))
(url-request-data
(encode-coding-string
(json-encode `((model . ,model) (prompt . ,prompt)))
'utf-8)))
(with-current-buffer (url-retrieve-synchronously url)
(goto-char url-http-end-of-headers)
(decode-coding-string
(buffer-substring-no-properties
(point)
(point-max))
'utf-8))))
(defun ollama-get-response-from-line (line)
(cdr
(assoc 'response
(json-read-from-string line))))
(defun ollama-prompt (url prompt model)
(mapconcat 'ollama-get-response-from-line
(cl-remove-if #'(lambda (str) (string= str ""))
(split-string (ollama-fetch url prompt model) "\n")) ""))
;;;###autoload
(defun ollama-prompt-line ()
"Prompt with current word."
(interactive)
(with-output-to-temp-buffer "*ollama*"
(princ
(ollama-prompt ollama:endpoint (thing-at-point 'line) ollama:model))))
;;;###autoload
(defun ollama-define-word ()
"Find definition of current word."
(interactive)
(with-output-to-temp-buffer "*ollama*"
(princ
(ollama-prompt ollama:endpoint (format "define %s" (thing-at-point 'word)) ollama:model))))
;;;###autoload
(defun ollama-translate-word ()
"Translate current word."
(interactive)
(with-output-to-temp-buffer "*ollama*"
(princ
(ollama-prompt ollama:endpoint (format "translate \"%s\" to %s" (thing-at-point 'word) ollama:language) ollama:model))))
;;;###autoload
(defun ollama-summarize-region ()
"Summarize marked text."
(interactive)
(with-output-to-temp-buffer "*ollama*"
(princ
(ollama-prompt ollama:endpoint (format "summarize \"\"\"%s\"\"\"" (buffer-substring (region-beginning) (region-end))) ollama:model))))
(provide 'ollama)
;;; ollama.el ends here

View File

@@ -1,111 +0,0 @@
(autothemer-deftheme oxocarbon "A port of oxocarbon"
;; Specify the color classes used by the theme
((((class color) (min-colors #xFFFFFF))
((class color) (min-colors #xFF)))
;; Specify the color palette, color columns correspond to each of the classes above.
(oxocarbon-bg "#161616")
(oxocarbon-fg "#f2f4f8")
(oxocarbon-base00 "#161616")
(oxocarbon-base01 "#262626")
(oxocarbon-base02 "#393939")
(oxocarbon-base03 "#525252")
(oxocarbon-base04 "#dde1e6")
(oxocarbon-base05 "#f2f4f8")
(oxocarbon-base06 "#ffffff")
(oxocarbon-base07 "#08bdba")
(oxocarbon-base08 "#3ddbd9")
(oxocarbon-base09 "#78a9ff")
(oxocarbon-base10 "#ee5396")
(oxocarbon-base11 "#33b1ff")
(oxocarbon-base12 "#ff7eb6")
(oxocarbon-base13 "#42be65")
(oxocarbon-base14 "#be95ff")
(oxocarbon-base15 "#82cfff"))
;; Specifications for Emacs faces.
;; Simpler than deftheme, just specify a face name and
;; a plist of face definitions (nested for :underline, :box etc.)
(
(default (:foreground oxocarbon-fg :background oxocarbon-bg)) ;; background and foreground
(button (:foreground oxocarbon-fg :background oxocarbon-base01))
;; (counsel--mark-ring-highlight)
;; Programming ;;
(font-lock-string-face (:foreground oxocarbon-base14)) ;; strings
(font-lock-keyword-face (:foreground oxocarbon-base09)) ;; keywords
(font-lock-type-face (:foreground oxocarbon-base09)) ;; variable types
(font-lock-variable-name-face (:foreground oxocarbon-base04)) ;; variable names
(font-lock-comment-face (:foreground oxocarbon-base03)) ;; comments
(font-lock-builtin-face (:foreground oxocarbon-base12)) ;; builtin functions
(font-lock-constant-face (:foreground oxocarbon-base14)) ;; constants
(font-lock-function-name-face (:foreground oxocarbon-base08)) ;; function names
(font-lock-preprocessor-face (:foreground oxocarbon-base09))
(font-lock-doc-face (:foreground oxocarbon-base14))
(corfu-current (:background oxocarbon-base02 :foreground oxocarbon-base08))
;; END ;;
;; General ;;
(error (:foreground oxocarbon-base10))
(warning (:foreground oxocarbon-base13))
;; END ;;
;; UI ;;
(region (:background oxocarbon-base02)) ;; selction background
(highlight (:background oxocarbon-base02)) ;; highlight when hovering over a link etc.
(mode-line (:foreground oxocarbon-fg :background oxocarbon-bg)) ;; modeline
(mode-line-inactive (:foreground oxocarbon-fg :background oxocarbon-bg))
(line-number-current-line (:foreground oxocarbon-base04 :background oxocarbon-base00)) ;; the current line num
(line-number (:foreground oxocarbon-base02)) ;; line numbers
;; parens
(show-paren-match (:background oxocarbon-base02)) ;; matching parens
(show-paren-mismatch (:background oxocarbon-base11)) ;; mismatching parens
;; isearch
(isearch-fail (:background oxocarbon-base10))
;; ivy
(ivy-current-match (:background oxocarbon-base02 :foreground oxocarbon-base08))
(ivy-minibuffer-match-face-1 (:foreground oxocarbon-base08))
(ivy-minibuffer-match-face-2 (:foreground oxocarbon-base08))
(ivy-minibuffer-match-face-3 (:foreground oxocarbon-base08))
(ivy-minibuffer-match-face-4 (:foreground oxocarbon-base08))
;; END ;;
)
;; (custom-theme-set-variables 'oxocarbon
;; `(ansi-color-names-vector [
;; ,oxocarbon-base00
;; ,oxocarbon-base01
;; ,oxocarbon-base02
;; ,oxocarbon-base03
;; ,oxocarbon-base04
;; ,oxocarbon-base05
;; ,oxocarbon-base06
;; ,oxocarbon-base07
;; ,oxocarbon-base08
;; ,oxocarbon-base09
;; ,oxocarbon-base10
;; ,oxocarbon-base11
;; ,oxocarbon-base12
;; ,oxocarbon-base13
;; ,oxocarbon-base14
;; ,oxocarbon-base15
;; ]))
)
(provide-theme 'oxocarbon) ;; theme ends here

View File

@@ -1,9 +0,0 @@
;;; ../../dotfiles/doom/.config/doom/lisp/programs.el -*- lexical-binding: t; -*-
;; make a function to run a program with a given name and arguments
(defun run-program (name &rest args)
(interactive)
(let ((program (executable-find name)))
(if program
(apply #'start-process name nil program args)
(error "Could not find program %s" name))))

View File

@@ -1,129 +0,0 @@
;;; ../../dotfiles/doom/.config/doom/my_stuff.el -*- lexical-binding: t; -*-
(defun emenu ()
"List all executable programs in the PATH environment variable and open the selected one.
Any text entered after the program name (separated by a space) is taken as arguments to the program."
(interactive)
(let* ((path-dirs (delete-dups (split-string (getenv "PATH") path-separator)))
(executables (apply #'append
(mapcar #'(lambda (dir)
(when (file-directory-p dir)
(mapcar #'file-name-nondirectory
(directory-files dir t ".+"
'nosort))))
path-dirs)))
(buf (generate-new-buffer "Programs")))
(with-current-buffer buf
(insert (mapconcat 'identity executables "\n")))
(let* ((program (completing-read "Program: " executables))
(args (if (string-match (concat "^" program " ") (buffer-substring-no-properties
(line-beginning-position)
(line-end-position)))
(substring-no-properties (buffer-substring-no-properties
(line-beginning-position)
(line-end-position)) (length program) nil)
nil))
(program-args (if args (concat program " " args) program)))
(when program
(start-process-shell-command program nil program-args)
(kill-buffer buf)))))
(map! :leader
:desc "Emenu" "d e" #'emenu)
;; open pdfs scaled in zathura
(defun open-pdf-with-zathura ()
(interactive)
(start-process "zathura" nil "zathura" (buffer-file-name)))
(add-hook 'pdf-view-mode-hook
(lambda ()
(open-pdf-with-zathura)
(kill-buffer)))
;; open images in imv
(defun open-image-with-imv ()
"Open the current image file with imv, then kill the current buffer and
open a dired buffer in the directory of the image file."
(interactive)
(let* ((current-file (buffer-file-name))
(directory (file-name-directory current-file))
(all-files (directory-files directory nil "\\(png\\|jpg\\|jpeg\\|gif\\|bmp\\)$"))
(selected-file (file-relative-name current-file directory))
(selected-index (cl-position selected-file all-files :test #'equal))
(sorted-files (append (nthcdr selected-index all-files)
(butlast all-files (- (length all-files) selected-index)))))
(apply 'start-process "imv" nil "imv" sorted-files))
(let ((image-dir (when buffer-file-name (file-name-directory buffer-file-name))))
(kill-buffer)
(when image-dir
(cd image-dir)
(dired image-dir))))
(add-hook 'image-mode-hook
(lambda ()
(open-image-with-imv)))
;;(add-hook 'doom-switch-buffer-hook
;; (lambda ()
;; (if (string= (buffer-name) "*doom*")
;; (elcord-mode -1)
;; (elcord-mode 1))))
;; search forwards for link and copy the link under point to the clipboard withouth external dependencies
(defun elfeed-copy-image ()
"Copy the URL of the image under point to the clipboard."
(interactive)
(or (search-forward "link" nil t)
(search-backward "link" nil t))
(let ((url (get-text-property (point) 'shr-url)))
(if url
(progn
(message (concat "Copying image URL to clipboard: " url))
(kill-new url)
(message "Copied image URL to clipboard."))
(message "No image under point."))))
;;bind the function to a key spc i c
(map! :leader
:desc "Copy image URL to clipboard" "i c" #'elfeed-copy-image)
(defun open-video-with-mpv ()
"Open the current video file with mpv, then kill the current buffer and
open a dired buffer in the directory of the video file."
(interactive)
(setq large-file-warning-threshold nil) ; disable threshold
(let ((current-file (buffer-file-name)))
(start-process "mpv" nil "mpv" current-file))
(let ((video-dir (when buffer-file-name (file-name-directory buffer-file-name))))
(kill-buffer)
(when video-dir
(cd video-dir)
(dired video-dir))))
(add-hook 'find-file-hook
(lambda ()
(when (and buffer-file-name
(string-match-p "\\(mp4\\|avi\\|mkv\\|webm\\|flv\\|mov\\|wmv\\)$" buffer-file-name))
(open-video-with-mpv))))
(defun open-audio-with-mpv ()
"Open the current audio file with mpv, then kill the current buffer and
open a dired buffer in the directory of the audio file."
(interactive)
(setq large-file-warning-threshold nil) ; disable threshold
(let ((current-file (buffer-file-name)))
(start-process "mpv" nil "mpv" "--no-video" current-file))
(let ((audio-dir (when buffer-file-name (file-name-directory buffer-file-name))))
(kill-buffer)
(when audio-dir
(cd audio-dir)
(dired audio-dir))))
(add-hook 'find-file-hook
(lambda ()
(when (and buffer-file-name
(string-match-p "\\(mp3\\|flac\\|wav\\|aac\\|ogg\\|m4b\\)$" buffer-file-name))
(open-audio-with-mpv))))

62
dots/doom/packages.el Executable file → Normal file
View File

@@ -3,76 +3,48 @@
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
;; (package! some-package)
(package! elisp-benchmarks)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/raxod502/straight.el#the-recipe-format
;(package! another-package
; :recipe (:host github :repo "username/repo"))
;; https://github.com/radian-software/straight.el#the-recipe-format
;; (package! another-package
;; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;(package! this-package
; :recipe (:host github :repo "username/repo"
; :files ("some-file.el" "src/lisp/*.el")))
;; (package! this-package
;; :recipe (:host github :repo "username/repo"
;; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;(package! builtin-package :disable t)
;; (package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;(package! builtin-package :recipe (:nonrecursive t))
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
;; (package! builtin-package :recipe (:nonrecursive t))
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see raxod502/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
;; our package manager can't deal with; see radian-software/straight.el#279)
;; (package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;(package! builtin-package :pin "1a2b3c4d5e")
;; (package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; (unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; (unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)
(package! catppuccin-theme)
;;(package! elcord)
(package! fill-column-indicator)
(package! rainbow-mode)
(package! poly-org)
(package! ein)
(package! copilot
:recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))
;;(package! codeium
;; :recipe (:host github :repo "Exafunction/codeium.el" :files ("*.el")))
(package! ellama)
(package! highlight-indent-guides)
(package! yuck-mode)
(package! openai
:recipe (:host github :repo "emacs-openai/openai" :files ("*.el")))
(package! chatgpt
:recipe (:host github :repo "mrfluffy-dev/chatgpt" :files ("*.el")))
(package! nasm-mode :pin "65ca6546fc395711fac5b3b4299e76c2303d43a8")
(package! haxor-mode :pin "6fa25a8e6b6a59481bc0354c2fe1e0ed53cbdc91")
(package! mips-mode :pin "98795cdc81979821ac35d9f94ce354cd99780c67")
(package! riscv-mode :pin "8e335b9c93de93ed8dd063d702b0f5ad48eef6d7")
(package! x86-lookup :pin "1573d61cc4457737b94624598a891c837fb52c16")
(package! package-lint :pin "21edc6d0d0eadd2d0a537f422fb9b7b8a3ae6991")
;;(package! jupyter)
;; (unpin! t)

View File

@@ -1,120 +0,0 @@
;;; doom-hardcore-theme.el --- inspired by the Hardcore theme -*- lexical-binding: t; no-byte-compile: t; -*-
;;
;; Added: February 23, 2025
;; Author: Your Name <https://github.com/yourusername>
;; Maintainer: Your Name <https://github.com/yourusername>
;; Source: Hardcore Theme
;;
;;; Commentary:
;;; Code:
(require 'doom-themes)
;;
;;; Variables
(defgroup doom-hardcore-theme nil
"Options for the `doom-hardcore' theme."
:group 'doom-themes)
(defcustom doom-hardcore-brighter-modeline nil
"If non-nil, more vivid colors will be used to style the mode-line."
:group 'doom-hardcore-theme
:type 'boolean)
(defcustom doom-hardcore-brighter-comments nil
"If non-nil, comments will be highlighted in more vivid colors."
:group 'doom-hardcore-theme
:type 'boolean)
(defcustom doom-hardcore-colorful-headers nil
"If non-nil, headers in org-mode will be more colorful."
:group 'doom-hardcore-theme
:type 'boolean)
(defcustom doom-hardcore-comment-bg doom-hardcore-brighter-comments
"If non-nil, comments will have a subtle, darker background."
:group 'doom-hardcore-theme
:type 'boolean)
(defcustom doom-hardcore-padded-modeline doom-themes-padded-modeline
"If non-nil, adds a 4px padding to the mode-line. Can be an integer."
:group 'doom-hardcore-theme
:type '(choice integer boolean))
;;
;;; Theme definition
(def-doom-theme doom-hardcore
"A dark theme based on the Hardcore theme."
;; name default 256 16
((bg '("#141414" "#121212" "black" ))
(bg-alt '("#141414" "#0d0d0d" "black" ))
(base0 '("#0f0f0f" "#0a0a0a" "black" ))
(base1 '("#191919" "#161616" "brightblack" ))
(base2 '("#242424" "#202020" "brightblack" ))
(base3 '("#303030" "#282828" "brightblack" ))
(base4 '("#3c3c3c" "#363636" "brightblack" ))
(base5 '("#4e4e4e" "#484848" "brightblack" ))
(base6 '("#8c8c8c" "#888888" "brightblack" ))
(base7 '("#b2b2b2" "#b0b0b0" "brightblack" ))
(base8 '("#ffffff" "#eeeeee" "white" ))
(fg '("#e0e0e0" "#ffffff" "white" ))
(fg-alt '("#c6c6c6" "#b0b0b0" "brightwhite" ))
(grey base4)
(red '("#ff5f5f" "#ff6b6b" "red" ))
(orange '("#ffaf5f" "#ffae5f" "brightred" ))
(green '("#5fff5f" "#6bff6b" "green" ))
(teal '("#5fafd7" "#5faed7" "brightgreen" ))
(yellow '("#ffff5f" "#ffff6b" "yellow" ))
(blue '("#5fafff" "#5faeff" "brightblue" ))
(dark-blue '("#005f87" "#004f77" "blue" ))
(magenta '("#af5fff" "#ae5fff" "magenta" ))
(violet '("#875fff" "#865fff" "brightmagenta"))
(cyan '("#5fdfff" "#5fceff" "brightcyan" ))
(dark-cyan '("#0087af" "#00779f" "cyan" ))
;; face categories -- required for all themes
(highlight magenta)
(vertical-bar (doom-darken base1 0.1))
(selection dark-blue)
(builtin orange)
(comments (if doom-hardcore-brighter-comments dark-cyan base5))
(doc-comments (doom-lighten (if doom-hardcore-brighter-comments dark-cyan base5) 0.25))
(constants cyan)
(functions green)
(keywords magenta)
(methods teal)
(operators violet)
(type violet)
(strings yellow)
(variables (doom-lighten magenta 0.6))
(numbers violet)
(region `(,(car base3) ,@(cdr base1)))
(error red)
(warning yellow)
(success green)
(vc-modified orange)
(vc-added green)
(vc-deleted red)
;; modeline
(-modeline-bright doom-hardcore-brighter-modeline)
(-modeline-pad (when doom-hardcore-padded-modeline (if (integerp doom-hardcore-padded-modeline) doom-hardcore-padded-modeline 4)))
(modeline-bg `(,(doom-darken (car bg) 0.15) ,@(cdr base0)))
(modeline-bg-l `(,(car bg) ,@(cdr base0)))
(modeline-bg-inactive `(,(doom-darken (car bg) 0.075) ,@(cdr base1)))
(modeline-bg-inactive-l (doom-darken bg 0.1)))
;; Base theme face overrides
(((line-number &override) :foreground base5)
((line-number-current-line &override) :foreground fg)
(mode-line :background modeline-bg :foreground base8
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg)))
(mode-line-inactive :background modeline-bg-inactive :foreground base5
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive))))
)
;;; doom-hardcore-theme.el ends here

View File

@@ -1,107 +0,0 @@
;;; doom-pandora-theme.el --- Pandora Base16 theme for Doom Emacs -*- lexical-binding: t; no-byte-compile: t; -*-
;;
;; Based on Base16 Pandora scheme by Cassandra Fox.
;; Adapted from doom-dracula-theme.el
;;
;;; Commentary:
;; This theme is a modification of the Doom Dracula theme,
;; replacing the Dracula palette with the Base16 Pandora colors.
;;
;;; Code:
(require 'doom-themes)
(defgroup doom-pandora-theme nil
"Options for the `doom-pandora' theme."
:group 'doom-themes)
(defcustom doom-pandora-brighter-modeline nil
"If non-nil, more vivid colors will be used to style the mode-line."
:group 'doom-pandora-theme
:type 'boolean)
(defcustom doom-pandora-brighter-comments nil
"If non-nil, comments will be highlighted in more vivid colors."
:group 'doom-pandora-theme
:type 'boolean)
(defcustom doom-pandora-colorful-headers nil
"If non-nil, headers in org-mode will be more colorful."
:group 'doom-pandora-theme
:type 'boolean)
(defcustom doom-pandora-comment-bg doom-pandora-brighter-comments
"If non-nil, comments will have a subtle, darker background to enhance legibility."
:group 'doom-pandora-theme
:type 'boolean)
(defcustom doom-pandora-padded-modeline doom-themes-padded-modeline
"If non-nil, adds a padding to the mode-line. It can be an integer to specify exact padding."
:group 'doom-pandora-theme
:type '(choice integer boolean))
(def-doom-theme doom-pandora
"A dark theme based on the Base16 Pandora color scheme by Cassandra Fox."
;; Palette:
;; Base16 Pandora (keys from base00 to base0F)
((bg '("#131213" nil nil)) ; base00
(bg-alt '("#2f1823" nil nil)) ; base01
(base02 '("#472234" nil nil)) ; base02
(base03 '("#ffbee3" nil nil)) ; base03
(base04 '("#9b2a46" nil nil)) ; base04
(fg '("#f15c99" "#f15c99" "brightwhite")) ; base05
(fg-alt '("#9ddf69" "#9ddf69" "white")) ; base0B
(accent '("#008080" nil nil)) ; base0D
(base06 '("#81506a" nil nil)) ; base06
(base07 '("#632227" nil nil)) ; base07
(base08 '("#b00b69" nil nil)) ; base08 (red)
(base09 '("#ff9153" nil nil)) ; base09 (orange)
(base0A '("#ffcc00" nil nil)) ; base0A (yellow)
(base0C '("#714ca6" nil nil)) ; base0C (blue)
(base0D '("#008080" nil nil)) ; base0D (teal; reused as accent)
(base0E '("#a24030" nil nil)) ; base0E (magenta)
(base0F '("#a24030" nil nil)) ; base0F (duplicate of base0E)
;; You may optionally define a "grey" for extra use:
(grey base04))
;; Face categories:
;; Here we map our palette to Doom's standard face categories.
((red base08)
(orange base09)
(green base0B)
(teal base0D)
(yellow base0A)
(blue base0C)
(dark-blue (doom-darken base0C 0.2))
(magenta base0E)
(violet (doom-blend base0E base0C 0.5))
(cyan base0D)) ; Using base0D for cyan (teal)
;; Base theme face overrides
(((line-number &override) :foreground base04)
((line-number-current-line &override) :foreground fg)
((font-lock-comment-face &override)
:background (if doom-pandora-comment-bg (doom-lighten bg 0.05) 'unspecified))
(mode-line
:background accent :foreground fg
:box (when doom-pandora-padded-modeline
`(:line-width ,(if (integerp doom-pandora-padded-modeline)
doom-pandora-padded-modeline 4)
:color ,accent)))
(mode-line-inactive
:background (doom-darken bg 0.075) :foreground base04
:box (when doom-pandora-padded-modeline
`(:line-width ,(if (integerp doom-pandora-padded-modeline)
doom-pandora-padded-modeline 4)
:color ,(doom-darken bg 0.075))))
(mode-line-emphasis :foreground (if doom-pandora-brighter-modeline fg accent))
;; Example for org-mode customizations:
((org-tag &override) :foreground (doom-lighten orange 0.3)))
;; No additional variable overrides
())
;;; doom-pandora-theme.el ends here

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

View File

@@ -10,6 +10,8 @@
settings = {
main = {
pad = "5x5";
font = "${config.stylix.fonts.monospace.name}:size=${toString config.stylix.fonts.sizes.terminal}";
include = "/home/${config.home.username}/.config/foot/dank-colors.ini";
};
colors = {
alpha = lib.mkForce (0.9);
@@ -17,4 +19,3 @@
};
};
}

View File

@@ -4,99 +4,191 @@
pkgs,
window_manager,
systemName,
inputs,
...
}:
let
hypr-package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
hypr-portal =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
hypr-split =
inputs.hyprland-hyprsplit.packages.${pkgs.stdenv.hostPlatform.system}.split-monitor-workspaces;
#hyprscrolling = inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprscrolling;
mod = "Alt";
terminal = "footclient";
fileManager = "pcmanfm";
runner = "anyrun";
browser = "zen-twilight";
fileManager = "thunar";
#runner = "${lib.getExe caelestia-cli} shell drawers toggle launcher";
runner = "vicinae toggle";
# runner = "anyrun";
browser = "firefox";
editor = "emacsclient -c";
in
{
wayland = {
windowManager = {
hyprland = {
wayland.windowManager.hyprland = {
enable = window_manager == "hyprland" || window_manager == "all";
package = hypr-package;
portalPackage = hypr-portal;
plugins = [
pkgs.hyprlandPlugins.hyprsplit
#pkgs.hyprlandPlugins.hyprsplit
hypr-split
#hyprscrolling
];
settings = {
##########################################################################
# Monitors
##########################################################################
source = [
"./dms/outputs.conf"
#"./dms/cursor.conf"
"./dms/colors.conf"
];
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor = lib.mkMerge [
(lib.mkIf (systemName == "laptop") [ "eDP-1,1920x1080@59.99700,0x0,1" ])
(lib.mkIf (systemName == "pc") [
"HDMI-A-1,1920x1080@60,0x0,1"
"DP-1,2560x1440@144,1920x0,1"
])
];
#monitor = lib.mkMerge [
# #(lib.mkIf (systemName == "laptop") [ "eDP-1,1920x1080@59.99700,0x0,1" ])
# (lib.mkIf (systemName == "pc") [
# "HDMI-A-2, disable"
# ])
#];
#monitorv2 =
# [ ]
# ++ lib.optional (systemName == "laptop") {
# output = "eDP-1";
# mode = "1920x1080@59.99700";
# scale = 1;
# position = "0x0";
# }
# ++ lib.optional (systemName == "pc") {
# output = "DP-1";
# mode = "2560x1440@239.97";
# position = "2560x0"; # "1440x750"; # Corrected from 2569x0 for seamless alignment
# scale = 1;
# #supports_wide_color = 1;
# bitdepth = 10;
# cm = "wide";
# supports_hdr = true;
# supports_wide_color = true;
# sdr_min_luminance = 0; # For true black on OLED
# sdr_max_luminance = 275; # Matches typical SDR brightness
# min_luminance = 0;
# max_luminance = 1000; # HDR peak
# max_avg_luminance = 400; # Average frame luminance
# sdrbrightness = 1.2; # Slight boost to avoid washed out look
# sdrsaturation = 1.0;
# }
# ++ lib.optional (systemName == "pc") {
# output = "DP-2";
# mode = "2560x1440@144";
# scale = 1;
# position = "0x0";
# transform = 0;
# };
##########################################################################
# Autostart
##########################################################################
# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
exec-once = [
# "waybar"
"quickshell"
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
# "quickshell"
#"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1"
"${pkgs.kdePackages.kwallet-pam}/libexec/pam_kwallet_init"
"fcitx5 -d"
"foot -s"
] ++ lib.optional (config.home.username == "work") "thunderbird";
#++ lib.optional (systemName == "laptop") "swaybg -o eDP-1 -i ${../assets/Wallpapers/138.png}"
#++
# lib.optional (systemName == "pc")
"systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP QT_QPA_PLATFORMTHEME GTK_THEME"
"dbus-update-activation-environment --systemd --all"
]
++ lib.optionals (config.home.username == "work") [
"thunderbird"
"sleep 10 && emacsclient -c --frame-parameters='((name . \"work\"))' $HOME/Documents/work/README.org"
];
# ++ lib.optional (systemName == "laptop")
# "swaybg -o eDP-1 -i ${../assets/Wallpapers/138.png}"
#
# ++ lib.optional (systemName == "pc")
# "swaybg -o HDMI-A-1 -i ${../assets/Wallpapers/138.png} -o DP-1 -i ${../assets/Wallpapers/138.png}";
#plugins
##########################################################################
# Plugins
##########################################################################
plugin = {
hyprsplit = {
num_workspaces = 10;
persistent_workspaces = true;
split-monitor-workspaces = {
count = 10;
penable_persistent_workspaces = 1;
};
hyprscrolling = {
column_width = 0.9;
follow_focus = false;
fullscreen_on_one_column = true;
};
};
##########################################################################
# Environment
##########################################################################
env = [
"XCURSOR_SIZE, 24"
"HYPRCURSOR_SIZE, 24"
];
# Refer to https://wiki.hyprland.org/Configuring/Variables/
##########################################################################
# General / Render / Decoration / Animations
##########################################################################
# https://wiki.hyprland.org/Configuring/Variables/
# https://wiki.hyprland.org/Configuring/Variables/#general
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
# "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
# "col.inactive_border" = "rgba(595959aa)";
# Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false;
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false;
layout = "dwindle";
resize_on_border = false; # enable resizing windows by clicking and dragging on borders and gaps
allow_tearing = false; # see https://wiki.hyprland.org/Configuring/Tearing/ before enabling
layout = "master";
};
render = {
cm_enabled = true; # turn on the CM pipeline (requires Hyprland restart)
cm_fs_passthrough = 2; # passthrough only for HDR content (safer than 1)
cm_auto_hdr = 1; # auto-switch monitor to HDR for fullscreen apps
send_content_type = true; # helps auto HDR on some displays
# cm_fs_passthrough = 1; # optional: keep your existing line; you can replace with 2 as above
};
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration = {
rounding = 10;
rounding_power = 2;
# Change transparency of focused and unfocused windows
rounding = 0;
rounding_power = 0;
active_opacity = 1.0;
inactive_opacity = 1.0;
shadow = {
enabled = true;
range = 4;
render_power = 3;
# color = "rgba(1a1a1aee)";
};
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur = {
enabled = true;
enabled = false;
size = 3;
passes = 1;
vibrancy = 0.1696;
};
};
animations = {
enabled = "yes, please :)";
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = [
"easeOutQuint,0.23,1,0.32,1"
@@ -105,6 +197,7 @@ in
"almostLinear,0.5,0.5,0.75,1.0"
"quick,0.15,0,0.1,1"
];
animation = [
"global, 1, 10, default"
"border, 1, 5.39, easeOutQuint"
@@ -124,19 +217,14 @@ in
"workspacesOut, 1, 1.94, almostLinear, fade"
];
};
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
# "Smart gaps" / "No gaps when only"
# uncomment all if you wish to use that.
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
# windowrule = rounding 0, floating:0, onworkspace:f[1]
##########################################################################
# Layouts
##########################################################################
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle = {
pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds
preserve_split = true; # You probably want this
force_split = 2;
};
@@ -144,14 +232,20 @@ in
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master = {
new_status = "master";
mfact = 0.5;
new_on_top = true;
};
##########################################################################
# Misc / Input / Gestures / Devices
##########################################################################
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc = {
force_default_wallpaper = -1; # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = false; # If true disables the random hyprland logo / anime girl background. :(
disable_hyprland_logo = true; # If true disables the random hyprland logo / anime girl background. :(
enable_swallow = true;
swallow_regex = "foot";
swallow_regex = "footclient";
};
# https://wiki.hyprland.org/Configuring/Variables/#input
@@ -160,78 +254,116 @@ in
(lib.mkIf (systemName == "laptop") "ie")
(lib.mkIf (systemName == "pc") "us")
];
repeat_rate = 40;
repeat_delay = 500;
# kb_variant =
# kb_model =
# kb_options =
# kb_rules =
follow_mouse = 1;
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = false;
};
};
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures = {
workspace_swipe = true;
};
# gestures = {
# workspace_swipe = true;
# workspace_swipe_cancel_ratio = 0.15;
# };
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs
device = {
name = "epic-mouse-v1";
sensitivity = -0.5;
};
##########################################################################
# Binds
##########################################################################
bind = [
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
# Launcher / apps
"${mod}, Return, exec, ${terminal}"
"${mod}, B, exec, ${browser}"
"${mod}, Q, killactive,"
"${mod}, M, exit,"
"${mod}, F, exec, ${fileManager}"
"${mod}, V, togglefloating,"
"${mod}, D, exec, ${runner}"
"${mod}, E, exec, ${editor}"
",Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
"${mod}, P, pseudo, " # dwindle
#focus with mainMod + arrow keys
# Session / window controls
"${mod}, Q, killactive,"
"${mod}, M, exit,"
"${mod}, V, togglefloating,"
"${mod}, T, fullscreen"
# ",Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
",Print, exec, dms screenshot"
"${mod}, f1, exec, dms ipc call keybinds toggle hyprland"
# Dwindle
"${mod}, P, pseudo, "
# Focus (arrows)
"${mod}, H, movefocus, l"
"${mod}, L, movefocus, r"
"${mod}, K, movefocus, u"
"${mod}, J, movefocus, d"
# Column movement (hyprscrolling)
#"${mod}, h, layoutmsg, move -col"
#"${mod}, L, layoutmsg, move +col"
# Move window
"${mod} SHIFT, H, movewindow, l"
"${mod} SHIFT, L, movewindow, r"
"${mod} SHIFT, K, movewindow, u"
"${mod} SHIFT, J, movewindow, d"
#"${mod} SHIFT, L, layoutmsg, movewindowto r"
#"${mod} SHIFT, H, layoutmsg, movewindowto l"
#"${mod} SHIFT, K, layoutmsg, movewindowto u"
#"${mod} SHIFT, J, layoutmsg, movewindowto d"
"${mod}, semicolon, layoutmsg, promote"
# Switch workspaces with Mod + [0-9]
"${mod}, 1, split:workspace, 1 "
"${mod}, 2, split:workspace, 2 "
"${mod}, 3, split:workspace, 3 "
"${mod}, 4, split:workspace, 4 "
"${mod}, 5, split:workspace, 5 "
"${mod}, 6, split:workspace, 6 "
"${mod}, 7, split:workspace, 7 "
"${mod}, 8, split:workspace, 8 "
"${mod}, 9, split:workspace, 9 "
"${mod}, 0, split:workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"${mod} SHIFT, 1, split:movetoworkspacesilent, 1 "
"${mod} SHIFT, 2, split:movetoworkspacesilent, 2 "
"${mod} SHIFT, 3, split:movetoworkspacesilent, 3 "
"${mod} SHIFT, 4, split:movetoworkspacesilent, 4 "
"${mod} SHIFT, 5, split:movetoworkspacesilent, 5 "
"${mod} SHIFT, 6, split:movetoworkspacesilent, 6 "
"${mod} SHIFT, 7, split:movetoworkspacesilent, 7 "
"${mod} SHIFT, 8, split:movetoworkspacesilent, 8 "
"${mod} SHIFT, 9, split:movetoworkspacesilent, 9 "
"${mod} SHIFT, 0, split:movetoworkspacesilent, 10"
# Example special workspace (scratchpad)
#hyperscrolling stuff
"${mod}, period, layoutmsg, move +col"
"${mod}, comma, layoutmsg, move -col"
# Workspaces (switch)
"${mod}, 1, split-workspace, 1 "
"${mod}, 2, split-workspace, 2 "
"${mod}, 3, split-workspace, 3 "
"${mod}, 4, split-workspace, 4 "
"${mod}, 5, split-workspace, 5 "
"${mod}, 6, split-workspace, 6 "
"${mod}, 7, split-workspace, 7 "
"${mod}, 8, split-workspace, 8 "
"${mod}, 9, split-workspace, 9 "
"${mod}, 0, split-workspace, 10"
# Workspaces (move active window)
"${mod} SHIFT, 1, split-movetoworkspacesilent, 1 "
"${mod} SHIFT, 2, split-movetoworkspacesilent, 2 "
"${mod} SHIFT, 3, split-movetoworkspacesilent, 3 "
"${mod} SHIFT, 4, split-movetoworkspacesilent, 4 "
"${mod} SHIFT, 5, split-movetoworkspacesilent, 5 "
"${mod} SHIFT, 6, split-movetoworkspacesilent, 6 "
"${mod} SHIFT, 7, split-movetoworkspacesilent, 7 "
"${mod} SHIFT, 8, split-movetoworkspacesilent, 8 "
"${mod} SHIFT, 9, split-movetoworkspacesilent, 9 "
"${mod} SHIFT, 0, split-movetoworkspacesilent, 10"
# Special workspace (scratchpad)
"${mod}, SLASH, togglespecialworkspace, magic"
"${mod} SHIFT, SLASH, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
"${mod}, mouse_down, workspace, e+1"
"${mod}, mouse_up, workspace, e-1"
# 8BitDo keyboard big red b Button
"${mod} SHIFT, F1, exec, scrcpy --video-source=camera -m3000 --camera-facing=back --v4l2-sink=/dev/video1 --no-video-playback --no-audio"
];
bindm = [
@@ -245,9 +377,14 @@ in
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioMute, exec, pamixer --toggle-mute"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, light -A 5"
",XF86MonBrightnessDown, exec, light -U 5"
# ",XF86MonBrightnessUp, exec, light -A 5"
# ",XF86MonBrightnessDown, exec, light -U 5"
# Brightness
",XF86MonBrightnessUp, global, dms ipc call brightness increment 5"
",XF86MonBrightnessDown, global, dms ipc call brightness decrement 5"
];
bindl = [
", XF86AudioNext, exec, playerctl next"
", XF86AudioPause, exec, playerctl play-pause"
@@ -255,23 +392,36 @@ in
", XF86AudioPrev, exec, playerctl previous "
];
binds = [ ];
##########################################################################
# Rules (windows / workspaces)
##########################################################################
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
# Example windowrule
# windowrule = float,class:^(kitty)$,title:^(kitty)$
# Ignore maximize requests from apps. You'll probably like this.
# Smart gaps / No gaps when only
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
# windowrule = rounding 0, floating:0, onworkspace:f[1]
windowrule = [
# Ignore maximize requests from apps. You'll probably like this.
"suppressevent maximize, class:.*"
# Fix some dragging issues with XWayland
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
"workspace special:magic silent, class:thunderbird"
];
"match:class .*, suppress_event maximize"
};
};
# Fix some dragging issues with XWayland
"match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0, no_focus on"
"match:class thunderbird, workspace special:magic silent"
"match:class emacs, match:title work, workspace special:magic silent"
];
};
};
}

View File

@@ -18,22 +18,25 @@
before_sleep_cmd = "loginctl lock-session && sleep 1.5";
ignore_dbus_inhibit = false;
};
listener =
[
listener = [
{
timeout = 600;
on-timeout = "loginctl lock-session";
}
]
++ lib.optional (systemName == "laptop") {
timeout = 700;
on-timeout = "light -S 0";
on-resume = "light -I";
on-timeout = "hyprctl dispatch dpms off"; # Turns off all displays
on-resume = "hyprctl dispatch dpms on"; # Turns displays back on
}
++ lib.optional (systemName == "laptop") {
timeout = 800;
on-timeout = "systemctl suspend-then-hibernate";
}
++ lib.optional (systemName == "pc") {
timeout = 700; # Adjust timeout as needed (in seconds)
on-timeout = "hyprctl dispatch dpms off"; # Turns off all displays
on-resume = "hyprctl dispatch dpms on"; # Turns displays back on
};
};
};

View File

@@ -9,17 +9,451 @@
programs = {
niri = {
settings = {
outputs."eDP-1".scale = 1.0;
input = {
keyboard = {
xkb = {
# You can set rules, model, layout, variant and options.
# For more information, see xkeyboard-config(7).
# For example:
# layout "us,ru"
# options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
};
# Enable numlock on startup, omitting this setting disables it.
numlock = true;
};
# Next sections include libinput settings.
# Omitting settings disables them, or leaves them at their default values.
# All commented-out settings here are examples, not defaults.
touchpad = {
# off
tap = true;
# dwt
# dwtp
# drag false
# drag-lock
natural-scroll = true;
# accel-speed 0.2
# accel-profile "flat"
# scroll-method "two-finger"
# disabled-on-external-mouse
};
mouse = {
# off
# natural-scroll
# accel-speed 0.2
# accel-profile "flat"
# scroll-method "no-scroll"
};
trackpoint = {
# off
# natural-scroll
# accel-speed 0.2
# accel-profile "flat"
# scroll-method "on-button-down"
# scroll-button 273
# scroll-button-lock
# middle-emulation
};
# Uncomment this to make the mouse warp to the center of newly focused windows.
# warp-mouse-to-focus
# Focus windows and outputs automatically when moving the mouse into them.
# Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
# focus-follows-mouse max-scroll-amount="0%"
};
# You can configure outputs by their name, which you can find
# by running `niri msg outputs` while inside a niri instance.
# The built-in laptop monitor is usually called "eDP-1".
# Find more information on the wiki:
# https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
# Remember to uncomment the node by removing "/-"!
outputs."eDP-1" = {
# Uncomment this line to disable this output.
# off
# Resolution and, optionally, refresh rate of the output.
# The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
# If the refresh rate is omitted, niri will pick the highest refresh rate
# for the resolution.
# If the mode is omitted altogether or is invalid, niri will pick one automatically.
# Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
mode = {
width = 1920;
height = 1080;
refresh = 60.00;
};
# You can use integer or fractional scale, for example use 1.5 for 150% scale.
scale = 1.0;
# Transform allows to rotate the output counter-clockwise, valid values are:
# normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
# transform = "normal";
# Position of the output in the global coordinate space.
# This affects directional monitor actions like "focus-monitor-left", and cursor movement.
# The cursor can only move between directly adjacent outputs.
# Output scale and rotation has to be taken into account for positioning:
# outputs are sized in logical, or scaled, pixels.
# For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
# so to put another output directly adjacent to it on the right, set its x to 1920.
# If the position is unset or results in an overlap, the output is instead placed
# automatically.
position = {
x = 1280;
y = 0;
};
};
# Settings that influence how windows are positioned and sized.
# Find more information on the wiki:
# https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
layout = {
# Set gaps around windows in logical pixels.
gaps = 16;
# When to center a column when changing focus, options are:
# - "never", default behavior, focusing an off-screen column will keep at the left
# or right edge of the screen.
# - "always", the focused column will always be centered.
# - "on-overflow", focusing a column will center it if it doesn't fit
# together with the previously focused column.
center-focused-column = "never";
# You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
preset-column-widths = [
# Proportion sets the width as a fraction of the output width, taking gaps into account.
# For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
# The default preset widths are 1/3, 1/2 and 2/3 of the output.
{ proportion = 0.33333; }
{ proportion = 0.5; }
{ proportion = 0.66667; }
# Fixed sets the width in logical pixels exactly.
# fixed 1920
];
# You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
# preset-window-heights { }
# You can change the default width of the new windows.
default-column-width = {
proportion = 0.5;
};
# If you leave the brackets empty, the windows themselves will decide their initial width.
# default-column-width {}
# By default focus ring and border are rendered as a solid background rectangle
# behind windows. That is, they will show up through semitransparent windows.
# This is because windows using client-side decorations can have an arbitrary shape.
#
# If you don't like that, you should uncomment `prefer-no-csd` below.
# Niri will draw focus ring and border *around* windows that agree to omit their
# client-side decorations.
#
# Alternatively, you can override it with a window rule called
# `draw-border-with-background`.
# You can change how the focus ring looks.
focus-ring = {
#omment this line to disable the focus ring.
# off
# How many logical pixels the ring extends out from the windows.
width = 4;
# Colors can be set in a variety of ways:
# - CSS named colors: "red"
# - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
# - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
# Color of the ring on the active monitor.
active = {
color = "#7fc8ff";
};
# Color of the ring on inactive monitors.
#
# The focus ring only draws around the active window, so the only place
# where you can see its inactive-color is on other monitors.
inactive = {
color = "#505050";
};
# You can also use gradients. They take precedence over solid colors.
# Gradients are rendered the same as CSS linear-gradient(angle, from, to).
# The angle is the same as in linear-gradient, and is optional,
# defaulting to 180 (top-to-bottom gradient).
# You can use any CSS linear-gradient tool on the web to set these up.
# Changing the color space is also supported, check the wiki for more info.
#
# active-gradient from="#80c8ff" to="#c7ff7f" angle=45
# You can also color the gradient relative to the entire view
# of the workspace, rather than relative to just the window itself.
# To do that, set relative-to="workspace-view".
#
# inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
};
# You can also add a border. It's similar to the focus ring, but always visible.
border = {
# The settings are the same as for the focus ring.
# If you enable the border, you probably want to disable the focus ring.
enable = true;
width = 4;
active = {
color = "#ffc87f";
};
inactive = {
color = "#505050";
};
# Color of the border around windows that request your attention.
urgent = {
color = "#9b0000";
};
# Gradients can use a few different interpolation color spaces.
# For example, this is a pastel rainbow gradient via in="oklch longer hue".
#
# active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue"
# inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
};
# You can enable drop shadows for windows.
shadow = {
# Uncomment the next line to enable shadows.
# on
# By default, the shadow draws only around its window, and not behind it.
# Uncomment this setting to make the shadow draw behind its window.
#
# Note that niri has no way of knowing about the CSD window corner
# radius. It has to assume that windows have square corners, leading to
# shadow artifacts inside the CSD rounded corners. This setting fixes
# those artifacts.
#
# However, instead you may want to set prefer-no-csd and/or
# geometry-corner-radius. Then, niri will know the corner radius and
# draw the shadow correctly, without having to draw it behind the
# window. These will also remove client-side shadows if the window
# draws any.
#
# draw-behind-window true
# You can change how shadows look. The values below are in logical
# pixels and match the CSS box-shadow properties.
# Softness controls the shadow blur radius.
softness = 30;
# Spread expands the shadow.
spread = 5;
# Offset moves the shadow relative to the window.
offset = {
x = 0;
y = 5;
};
# You can also change the shadow color and opacity.
color = "#0007";
};
# Struts shrink the area occupied by windows, similarly to layer-shell panels.
# You can think of them as a kind of outer gaps. They are set in logical pixels.
# Left and right struts will cause the next window to the side to always be visible.
# Top and bottom struts will simply add outer gaps in addition to the area occupied by
# layer-shell panels and regular gaps.
struts = {
# left 64
# right 64
# top 64
# bottom 64
};
};
# Add lines like this to spawn processes at startup.
# Note that running niri as a session supports xdg-desktop-autostart,
# which may be more convenient to use.
# See the binds section below for more spawn examples.
spawn-at-startup = [
{
command = [ "xwayland-satellite" ];
}
{
command = [ "foot -s" ];
}
];
# Uncomment this line to ask the clients to omit their client-side decorations if possible.
# If the client will specifically ask for CSD, the request will be honored.
# Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
# This option will also fix border/focus ring drawing behind some semitransparent windows.
# After enabling or disabling this, you need to restart the apps for this to take effect.
# prefer-no-csd
# You can change the path where screenshots are saved.
# A ~ at the front will be expanded to the home directory.
# The path is formatted with strftime(3) to give you the screenshot date and time.
#sreenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png";
# You can also set this to null to disable saving screenshots to disk.
# screenshot-path null
#/ Animation settings.
# The wiki explains how to configure individual animations:
# https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
animations = {
# Uncomment to turn off all animations.
# off
# Slow down all animations by this factor. Values below 1 speed them up instead.
# slowdown 3.0
};
# Window rules let you adjust behavior for individual windows.
# Find more information on the wiki:
# https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
#/ Work around WezTerm's initial configure bug
# by setting an empty default-column-width.
window-rules = [
# This regular expression is intentionally made as specific as possible,
# since this is the default config, and we want no false positives.
# You can get away with just app-id="wezterm" if you want.
#match = { app-id=#"^org\.wezfurlong\.wezterm$"\#};
#default-column-width = {}
];
environment = {
DISPLAY = ":0";
};
binds = {
"Mod+T".action.spawn = "alacritty";
binds = with config.lib.niri.actions; {
# App launchers
"Alt+Return".action = spawn "footclient";
"Alt+D".action = spawn "anyrun";
"Super+Alt+L".action = spawn "${lib.getExe pkgs.hyprlock}";
# Audio control
"XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
"XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-";
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
# Brightness control
"XF86MonBrightnessUp".action = spawn "brightnessctl" "--class=backlight" "set" "+10%";
"XF86MonBrightnessDown".action = spawn "brightnessctl" "--class=backlight" "set" "10%-";
# Overview and quitting
"Alt+O".action = toggle-overview;
"Alt+Q".action = close-window;
"Alt+Shift+E".action = quit;
"Alt+Ctrl+Shift+E".action = quit { skip-confirmation = true; };
# Navigation
"Alt+H".action = focus-column-left;
"Alt+J".action = focus-window-down;
"Alt+K".action = focus-window-up;
"Alt+L".action = focus-column-right;
"Alt+Ctrl+H".action = move-column-left;
"Alt+Ctrl+J".action = move-window-down;
"Alt+Ctrl+K".action = move-window-up;
"Alt+Ctrl+L".action = move-column-right;
"Alt+Shift+H".action = focus-monitor-left;
"Alt+Shift+J".action = focus-monitor-down;
"Alt+Shift+K".action = focus-monitor-up;
"Alt+Shift+L".action = focus-monitor-right;
"Alt+Shift+Ctrl+H".action = move-column-to-monitor-left;
"Alt+Shift+Ctrl+J".action = move-column-to-monitor-down;
"Alt+Shift+Ctrl+K".action = move-column-to-monitor-up;
"Alt+Shift+Ctrl+L".action = move-column-to-monitor-right;
"Alt+U".action = focus-workspace-down;
"Alt+I".action = focus-workspace-up;
"Alt+Ctrl+U".action = move-column-to-workspace-down;
"Alt+Ctrl+I".action = move-column-to-workspace-up;
"Alt+Shift+U".action = move-workspace-down;
"Alt+Shift+I".action = move-workspace-up;
# Scroll bindings
"Alt+WheelScrollDown".action = focus-workspace-down;
"Alt+WheelScrollUp".action = focus-workspace-up;
"Alt+Ctrl+WheelScrollDown".action = move-column-to-workspace-down;
"Alt+Ctrl+WheelScrollUp".action = move-column-to-workspace-up;
"Alt+WheelScrollLeft".action = focus-column-left;
"Alt+WheelScrollRight".action = focus-column-right;
"Alt+Ctrl+WheelScrollLeft".action = move-column-left;
"Alt+Ctrl+WheelScrollRight".action = move-column-right;
"Alt+Shift+WheelScrollUp".action = focus-column-left;
"Alt+Shift+WheelScrollDown".action = focus-column-right;
"Alt+Ctrl+Shift+WheelScrollUp".action = move-column-left;
"Alt+Ctrl+Shift+WheelScrollDown".action = move-column-right;
# Workspace numbers (19)
"Alt+1".action = focus-workspace 1;
"Alt+2".action = focus-workspace 2;
"Alt+3".action = focus-workspace 3;
"Alt+4".action = focus-workspace 4;
"Alt+5".action = focus-workspace 5;
"Alt+6".action = focus-workspace 6;
"Alt+7".action = focus-workspace 7;
"Alt+8".action = focus-workspace 8;
"Alt+9".action = focus-workspace 9;
"Alt+Ctrl+1".action = move-column-to-index 1;
"Alt+Ctrl+2".action = move-column-to-index 2;
"Alt+Ctrl+3".action = move-column-to-index 3;
"Alt+Ctrl+4".action = move-column-to-index 4;
"Alt+Ctrl+5".action = move-column-to-index 5;
"Alt+Ctrl+6".action = move-column-to-index 6;
"Alt+Ctrl+7".action = move-column-to-index 7;
"Alt+Ctrl+8".action = move-column-to-index 8;
"Alt+Ctrl+9".action = move-column-to-index 9;
# Window & column management
"Alt+Comma".action = consume-window-into-column;
"Alt+Period".action = expel-window-from-column;
"Alt+BracketLeft".action = consume-or-expel-window-left;
"Alt+BracketRight".action = consume-or-expel-window-right;
"Alt+F".action = maximize-column;
"Alt+Shift+F".action = fullscreen-window;
"Alt+Ctrl+F".action = expand-column-to-available-width;
"Alt+C".action = center-column;
"Alt+Ctrl+C".action = center-visible-columns;
"Alt+Minus".action = set-column-width "-10%";
"Alt+Plus".action = set-column-width "+10%";
"Alt+Shift+Minus".action = set-window-height "-10%";
"Alt+Shift+Plus".action = set-window-height "+10%";
"Alt+R".action = switch-preset-column-width;
"Alt+Shift+R".action = switch-preset-window-height;
"Alt+Ctrl+R".action = reset-window-height;
"Alt+V".action = toggle-window-floating;
"Alt+Shift+V".action = switch-focus-between-floating-and-tiling;
"Alt+W".action = toggle-column-tabbed-display;
# Screenshots
#"Print".action = screenshot { show-pointer = false; };
"Ctrl+Print".action.screenshot-screen = {
write-to-disk = false;
};
#"Alt+Print".action = screenshot-window;
# Other
"Alt+Escape".action = toggle-keyboard-shortcuts-inhibit;
"Alt+Shift+P".action = power-off-monitors;
};
};
};

View File

@@ -8,9 +8,14 @@
{
programs.nixcord = {
enable = true;
discord.enable = false;
discord = {
enable = false;
#package = pkgs.vencord;
};
vesktop = {
enable = true;
#package = pkgs.vesktop;
#useSystemVencord = false;
};
config = {
plugins = {
@@ -37,15 +42,9 @@
biggerStreamPreview = {
enable = true;
};
clearURLs = {
enable = true;
};
copyFileContents = {
enable = true;
};
emoteCloner = {
enable = true;
};
fakeNitro = {
enable = true;
enableEmojiBypass = true;
@@ -77,9 +76,6 @@
messageLogger = {
enable = true;
};
nsfwGateBypass = {
enable = true;
};
petpet = {
enable = true;
};

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -1,123 +0,0 @@
<h1 align=center>caelestia-shell</h1>
<div align=center>
![GitHub last commit](https://img.shields.io/github/last-commit/caelestia-dots/shell?style=for-the-badge&labelColor=101418&color=9ccbfb)
![GitHub Repo stars](https://img.shields.io/github/stars/caelestia-dots/shell?style=for-the-badge&labelColor=101418&color=b9c8da)
![GitHub repo size](https://img.shields.io/github/repo-size/caelestia-dots/shell?style=for-the-badge&labelColor=101418&color=d3bfe6)
![Ko-Fi donate](https://img.shields.io/badge/donate-kofi?style=for-the-badge&logo=ko-fi&logoColor=ffffff&label=ko-fi&labelColor=101418&color=f16061&link=https%3A%2F%2Fko-fi.com%2Fsoramane)
</div>
> [!WARNING]
> The overhaul is finished!
> Installation is now via an [install script](https://github.com/caelestia-dots/caelestia/blob/main/install.fish) in the
> [`caelestia` repo](https://github.com/caelestia-dots/caelestia).
>
> Anyone with an existing installation, please reinstall via the install script.
>
> Some breaking changes:
> - Rename the `scripts` repo -> `cli`
> - Rename the `hypr` repo -> `caelestia`
> - Merge all other repos (except this and `cli`) into `caelestia`
> - Installation for the `shell` and `cli` will be done via AUR packages; `caelestia` will have a meta package and an install script (should fix most installation issues)
> - Overhaul the scheme system (should fix a few bugs with that and make it cleaner in general)
https://github.com/user-attachments/assets/0840f496-575c-4ca6-83a8-87bb01a85c5f
## Components
- Widgets: [`Quickshell`](https://quickshell.outfoxxed.me)
- Window manager: [`Hyprland`](https://hyprland.org)
- Dots: [`caelestia`](https://github.com/caelestia-dots)
## Installation
This is not implemented as of now.
## Usage
The shell can be started in two ways: via systemd or manually running `caelestia shell`.
### Via systemd
The install script creates and enables the systemd service `caelestia-shell.service` which should automatically start the
shell on login.
### Via command
If not on a system that uses systemd, you can manually start the shell via `caelestia-shell`.
To autostart it on login, you can use an `exec-once` rule in your Hyprland config:
```
exec-once = caelestia shell
```
### Shortcuts/IPC
All keybinds are accessible via Hyprland [global shortcuts](https://wiki.hyprland.org/Configuring/Binds/#dbus-global-shortcuts).
For a preconfigured setup, install [`caelestia-hypr`](https://github.com/caelestia-dots/hypr) via `caelestia install hypr` or see
[this file](https://github.com/caelestia-dots/hypr/blob/main/hyprland/keybinds.conf#L1-L29) for an example on how to use global
shortcuts.
All IPC commands can be accessed via `caelestia shell ...`. For example
```sh
caelestia shell mpris getActive trackTitle
```
The list of IPC commands can be shown via `caelestia shell help`:
```
> caelestia shell help
target mpris
function stop(): void
function play(): void
function next(): void
function getActive(prop: string): string
function list(): string
function playPause(): void
function pause(): void
function previous(): void
target drawers
function list(): string
function toggle(drawer: string): void
target wallpaper
function list(): string
function get(): string
function set(path: string): void
target notifs
function clear(): void
```
### PFP/Wallpapers
The profile picture for the dashboard is read from the file `~/.face`, so to set it just put your image there.
The wallpapers for the wallpaper switcher are read from `~/Pictures/Wallpapers`, so put your wallpapers there for
them to show up in the switcher (you need to restart the shell after changing stuff in `~/Pictures/Wallpapers` sadly,
no watching for changes yet).
To set the wallpaper, you can use the command `caelestia wallpaper`. Use `caelestia wallpaper -h` for more info about
the command.
## Credits
Thanks to the Hyprland discord community (especially the homies in #rice-discussion) for all the help and suggestions
for improving these dots!
A special thanks to [@outfoxxed](https://github.com/outfoxxed) for making Quickshell and the effort put into fixing issues
and implementing various feature requests.
Another special thanks to [@end_4](https://github.com/end-4) for his [config](https://github.com/end-4/dots-hyprland)
which helped me a lot with learning how to use Quickshell.
Finally another thank you to all the configs I took inspiration from (only one for now):
- [Axenide/Ax-Shell](https://github.com/Axenide/Ax-Shell)
## Stonks 📈
<a href="https://www.star-history.com/#caelestia-dots/shell&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=caelestia-dots/shell&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=caelestia-dots/shell&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=caelestia-dots/shell&type=Date" />
</picture>
</a>

View File

@@ -1,568 +0,0 @@
#include <algorithm>
#include <pipewire/pipewire.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/props.h>
#include <aubio/aubio.h>
#include <memory>
#include <iostream>
#include <fstream>
#include <csignal>
#include <atomic>
#include <vector>
#include <cstring>
#include <chrono>
#include <iomanip>
#include <sstream>
#include <thread>
#include <cmath>
class EnhancedBeatDetector {
private:
static constexpr uint32_t SAMPLE_RATE = 44100;
static constexpr uint32_t CHANNELS = 1;
// PipeWire objects
pw_main_loop* main_loop_;
pw_context* context_;
pw_core* core_;
pw_stream* stream_;
// Aubio objects
std::unique_ptr<aubio_tempo_t, decltype(&del_aubio_tempo)> tempo_;
std::unique_ptr<fvec_t, decltype(&del_fvec)> input_buffer_;
std::unique_ptr<fvec_t, decltype(&del_fvec)> output_buffer_;
// Additional aubio objects for enhanced features
std::unique_ptr<aubio_onset_t, decltype(&del_aubio_onset)> onset_;
std::unique_ptr<aubio_pitch_t, decltype(&del_aubio_pitch)> pitch_;
std::unique_ptr<fvec_t, decltype(&del_fvec)> pitch_buffer_;
const uint32_t buf_size_;
const uint32_t fft_size_;
static std::atomic<bool> should_quit_;
static EnhancedBeatDetector* instance_;
// Enhanced features
std::ofstream log_file_;
bool enable_logging_;
bool enable_performance_stats_;
bool enable_pitch_detection_;
bool enable_visual_feedback_;
// Performance tracking
std::chrono::high_resolution_clock::time_point last_process_time_;
std::vector<double> process_times_;
uint64_t total_beats_;
uint64_t total_onsets_;
std::chrono::steady_clock::time_point start_time_;
// Beat analysis
std::vector<float> recent_bpms_;
static constexpr size_t BPM_HISTORY_SIZE = 10;
float last_bpm_;
std::chrono::steady_clock::time_point last_beat_time_;
// Useless Visual feedback
std::string generate_beat_visual(float bpm, bool is_beat) {
if (!enable_visual_feedback_) return "";
std::stringstream ss;
if (is_beat) {
// Useless Animated beat indicator based on BPM intensity
int intensity = static_cast<int>(std::min(bpm / 20.0f, 10.0f));
ss << "\r";
for (int i = 0; i < intensity; ++i) ss << "";
for (int i = intensity; i < 10; ++i) ss << "";
ss << " BPM: " << std::fixed << std::setprecision(1) << bpm;
ss << " | Avg: " << get_average_bpm();
}
return ss.str();
}
public:
explicit EnhancedBeatDetector(uint32_t buf_size = 512,
bool enable_logging = true,
bool enable_performance_stats = true,
bool enable_pitch_detection = false,
bool enable_visual_feedback = true)
: main_loop_(nullptr)
, context_(nullptr)
, core_(nullptr)
, stream_(nullptr)
, tempo_(nullptr, &del_aubio_tempo)
, input_buffer_(nullptr, &del_fvec)
, output_buffer_(nullptr, &del_fvec)
, onset_(nullptr, &del_aubio_onset)
, pitch_(nullptr, &del_aubio_pitch)
, pitch_buffer_(nullptr, &del_fvec)
, buf_size_(buf_size)
, fft_size_(buf_size * 2)
, enable_logging_(enable_logging)
, enable_performance_stats_(enable_performance_stats)
, enable_pitch_detection_(enable_pitch_detection)
, enable_visual_feedback_(enable_visual_feedback)
, total_beats_(0)
, total_onsets_(0)
, last_bpm_(0.0f)
{
instance_ = this;
recent_bpms_.reserve(BPM_HISTORY_SIZE);
if (enable_performance_stats_) {
process_times_.reserve(1000); // Reserve space for performance data
}
initialize();
}
~EnhancedBeatDetector() {
print_final_stats();
cleanup();
instance_ = nullptr;
}
// Delete copy constructor and assignment operator
EnhancedBeatDetector(const EnhancedBeatDetector&) = delete;
EnhancedBeatDetector& operator=(const EnhancedBeatDetector&) = delete;
bool initialize() {
start_time_ = std::chrono::steady_clock::now();
// Useless Initialize logging (actually useful)
if (enable_logging_) {
auto now = std::chrono::system_clock::now();
auto time_t = std::chrono::system_clock::to_time_t(now);
std::stringstream filename;
filename << "beat_log_" << std::put_time(std::localtime(&time_t), "%Y%m%d_%H%M%S") << ".txt";
log_file_.open(filename.str());
if (log_file_.is_open()) {
log_file_ << "# Beat Detection Log - " << std::put_time(std::localtime(&time_t), "%Y-%m-%d %H:%M:%S") << "\n";
log_file_ << "# Timestamp,BPM,Onset,Pitch(Hz),ProcessTime(ms)\n";
std::cout << " Logging to: " << filename.str() << std::endl;
}
}
// Initialize PipeWire
pw_init(nullptr, nullptr);
main_loop_ = pw_main_loop_new(nullptr);
if (!main_loop_) {
std::cerr << " Failed to create main loop" << std::endl;
return false;
}
context_ = pw_context_new(pw_main_loop_get_loop(main_loop_), nullptr, 0);
if (!context_) {
std::cerr << " Failed to create context" << std::endl;
return false;
}
core_ = pw_context_connect(context_, nullptr, 0);
if (!core_) {
std::cerr << " Failed to connect to PipeWire" << std::endl;
return false;
}
// Initialize Aubio objects
tempo_.reset(new_aubio_tempo("default", fft_size_, buf_size_, SAMPLE_RATE));
if (!tempo_) {
std::cerr << " Failed to create aubio tempo detector" << std::endl;
return false;
}
input_buffer_.reset(new_fvec(buf_size_));
output_buffer_.reset(new_fvec(1));
if (!input_buffer_ || !output_buffer_) {
std::cerr << " Failed to create aubio buffers" << std::endl;
return false;
}
// Initialize onset detection
onset_.reset(new_aubio_onset("default", fft_size_, buf_size_, SAMPLE_RATE));
if (!onset_) {
std::cerr << " Failed to create aubio onset detector" << std::endl;
return false;
}
// Initialize pitch detection if enabled
if (enable_pitch_detection_) {
pitch_.reset(new_aubio_pitch("default", fft_size_, buf_size_, SAMPLE_RATE));
pitch_buffer_.reset(new_fvec(1));
if (!pitch_ || !pitch_buffer_) {
std::cerr << " Failed to create aubio pitch detector" << std::endl;
return false;
}
aubio_pitch_set_unit(pitch_.get(), "Hz");
}
return setup_stream();
}
void run() {
if (!main_loop_) return;
print_startup_info();
pw_main_loop_run(main_loop_);
}
void stop() {
should_quit_ = true;
if (main_loop_) {
pw_main_loop_quit(main_loop_);
}
}
static void signal_handler(int sig) {
if (instance_) {
std::cout << "\n Received signal " << sig << ", stopping gracefullllly..." << std::endl;
instance_->stop();
}
}
private:
void print_startup_info() {
std::cout << "\n󰝚 Beat Detector Started!" << std::endl;
std::cout << " Buffer size: " << buf_size_ << " samples" << std::endl;
std::cout << " Sample rate: " << SAMPLE_RATE << " Hz" << std::endl;
std::cout << " Features enabled:" << std::endl;
std::cout << "  Logging: " << (enable_logging_ ? "" : "") << std::endl;
std::cout << "  Performance stats: " << (enable_performance_stats_ ? "" : "") << std::endl;
std::cout << " 󰗅 Pitch detection: " << (enable_pitch_detection_ ? "" : "") << std::endl;
std::cout << "\n Listening for beats... Press Ctrl+C to stop.\n" << std::endl;
}
void print_final_stats() {
if (!enable_performance_stats_) return;
auto end_time = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(end_time - start_time_);
std::cout << "\n Final Statistics:" << std::endl;
std::cout << " 󱎫 Total runtime: " << duration.count() << " seconds" << std::endl;
std::cout << "  Total beats detected: " << total_beats_ << std::endl;
std::cout << "  Total onsets detected: " << total_onsets_ << std::endl;
if (!process_times_.empty()) {
double avg_time = 0;
for (double t : process_times_) avg_time += t;
avg_time /= process_times_.size();
auto max_time = *std::max_element(process_times_.begin(), process_times_.end());
auto min_time = *std::min_element(process_times_.begin(), process_times_.end());
std::cout << " ⚡ Average processing time: " << std::fixed << std::setprecision(3)
<< avg_time << " ms" << std::endl;
std::cout << " 📈 Max processing time: " << max_time << " ms" << std::endl;
std::cout << " 📉 Min processing time: " << min_time << " ms" << std::endl;
}
if (!recent_bpms_.empty()) {
std::cout << " 󰝚 Final average BPM: " << get_average_bpm() << std::endl;
}
}
float get_average_bpm() const {
if (recent_bpms_.empty()) return 0.0f;
float sum = 0;
for (float bpm : recent_bpms_) sum += bpm;
return sum / recent_bpms_.size();
}
bool setup_stream() {
// Stream events
static const pw_stream_events stream_events = {
.version = PW_VERSION_STREAM_EVENTS,
.destroy = nullptr,
.state_changed = on_state_changed,
.control_info = nullptr,
.io_changed = nullptr,
.param_changed = nullptr,
.add_buffer = nullptr,
.remove_buffer = nullptr,
.process = on_process,
.drained = nullptr,
.command = nullptr,
.trigger_done = nullptr,
};
stream_ = pw_stream_new_simple(
pw_main_loop_get_loop(main_loop_),
"enhanced-beat-detector",
pw_properties_new(
PW_KEY_MEDIA_TYPE, "Audio",
PW_KEY_MEDIA_CATEGORY, "Capture",
PW_KEY_MEDIA_ROLE, "Music",
nullptr
),
&stream_events,
this
);
if (!stream_) {
std::cerr << " Failed to create stream" << std::endl;
return false;
}
// Audio format parameters
uint8_t buffer[1024];
spa_pod_builder pod_builder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
struct spa_audio_info_raw audio_info = {};
audio_info.format = SPA_AUDIO_FORMAT_F32_LE;
audio_info.channels = CHANNELS;
audio_info.rate = SAMPLE_RATE;
audio_info.flags = 0;
const spa_pod* params[1];
params[0] = spa_format_audio_raw_build(&pod_builder, SPA_PARAM_EnumFormat, &audio_info);
if (pw_stream_connect(stream_,
PW_DIRECTION_INPUT,
PW_ID_ANY,
static_cast<pw_stream_flags>(
PW_STREAM_FLAG_AUTOCONNECT |
PW_STREAM_FLAG_MAP_BUFFERS |
PW_STREAM_FLAG_RT_PROCESS),
params, 1) < 0) {
std::cerr << " Failed to connect stream" << std::endl;
return false;
}
return true;
}
static void on_state_changed(void* userdata, enum pw_stream_state /* old_state */,
enum pw_stream_state state, const char* error) {
auto* detector = static_cast<EnhancedBeatDetector*>(userdata);
const char* state_emoji = "󰑓 ";
switch (state) {
case PW_STREAM_STATE_CONNECTING: state_emoji = "󰄙 "; break;
case PW_STREAM_STATE_PAUSED: state_emoji = ""; break;
case PW_STREAM_STATE_STREAMING: state_emoji = "󰝚 "; break;
case PW_STREAM_STATE_ERROR: state_emoji = ""; break;
case PW_STREAM_STATE_UNCONNECTED: state_emoji = ""; break;
}
std::cout << state_emoji << " Stream state: " << pw_stream_state_as_string(state) << std::endl;
if (state == PW_STREAM_STATE_ERROR) {
std::cerr << " Stream error: " << (error ? error : "unknown") << std::endl;
detector->stop();
}
}
static void on_process(void* userdata) {
auto* detector = static_cast<EnhancedBeatDetector*>(userdata);
detector->process_audio();
}
void process_audio() {
if (should_quit_) return;
auto process_start = std::chrono::high_resolution_clock::now();
pw_buffer* buffer = pw_stream_dequeue_buffer(stream_);
if (!buffer) return;
spa_buffer* spa_buf = buffer->buffer;
if (!spa_buf->datas[0].data) {
pw_stream_queue_buffer(stream_, buffer);
return;
}
const float* audio_data = static_cast<const float*>(spa_buf->datas[0].data);
const uint32_t n_samples = spa_buf->datas[0].chunk->size / sizeof(float);
// Process in chunks
for (uint32_t offset = 0; offset + buf_size_ <= n_samples; offset += buf_size_) {
std::memcpy(input_buffer_->data, audio_data + offset, buf_size_ * sizeof(float));
// Beat detection
aubio_tempo_do(tempo_.get(), input_buffer_.get(), output_buffer_.get());
bool is_beat = output_buffer_->data[0] != 0.0f;
// Onset detection
aubio_onset_do(onset_.get(), input_buffer_.get(), output_buffer_.get());
bool is_onset = output_buffer_->data[0] != 0.0f;
float pitch_hz = 0.0f;
if (enable_pitch_detection_) {
aubio_pitch_do(pitch_.get(), input_buffer_.get(), pitch_buffer_.get());
pitch_hz = pitch_buffer_->data[0];
}
if (is_beat) {
total_beats_++;
last_bpm_ = aubio_tempo_get_bpm(tempo_.get());
last_beat_time_ = std::chrono::steady_clock::now();
// Update BPM history
recent_bpms_.push_back(last_bpm_);
if (recent_bpms_.size() > BPM_HISTORY_SIZE) {
recent_bpms_.erase(recent_bpms_.begin());
}
// Visual feedback
if (enable_visual_feedback_) {
std::cout << generate_beat_visual(last_bpm_, true) << std::flush;
} else {
std::cout << " BPM: " << std::fixed << std::setprecision(1) << last_bpm_ << std::endl;
}
}
if (is_onset) {
total_onsets_++;
}
// Logging
if (enable_logging_ && log_file_.is_open() && (is_beat || is_onset)) {
auto now = std::chrono::system_clock::now();
auto time_t = std::chrono::system_clock::to_time_t(now);
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
now.time_since_epoch()) % 1000;
log_file_ << std::put_time(std::localtime(&time_t), "%H:%M:%S")
<< "." << std::setfill('0') << std::setw(3) << ms.count() << ","
<< (is_beat ? last_bpm_ : 0) << ","
<< (is_onset ? 1 : 0) << ","
<< pitch_hz << ",";
}
}
pw_stream_queue_buffer(stream_, buffer);
// Performance tracking
if (enable_performance_stats_) {
auto process_end = std::chrono::high_resolution_clock::now();
auto process_time = std::chrono::duration<double, std::milli>(process_end - process_start).count();
if (log_file_.is_open() && (total_beats_ > 0 || total_onsets_ > 0)) {
log_file_ << std::fixed << std::setprecision(3) << process_time << "\n";
}
if (process_times_.size() < 1000) {
process_times_.push_back(process_time);
}
}
}
void cleanup() {
if (log_file_.is_open()) {
log_file_.close();
}
if (stream_) {
pw_stream_destroy(stream_);
stream_ = nullptr;
}
if (core_) {
pw_core_disconnect(core_);
core_ = nullptr;
}
if (context_) {
pw_context_destroy(context_);
context_ = nullptr;
}
if (main_loop_) {
pw_main_loop_destroy(main_loop_);
main_loop_ = nullptr;
}
tempo_.reset();
input_buffer_.reset();
output_buffer_.reset();
onset_.reset();
pitch_.reset();
pitch_buffer_.reset();
pw_deinit();
std::cout << "\n Cleanup complete - All resources freed!" << std::endl;
}
};
// Static member definitions
std::atomic<bool> EnhancedBeatDetector::should_quit_{false};
EnhancedBeatDetector* EnhancedBeatDetector::instance_{nullptr};
void print_usage() {
std::cout << " Beat Detector Usage:" << std::endl;
std::cout << " ./beat_detector [buffer_size] [options]" << std::endl;
std::cout << "\nOptions:" << std::endl;
std::cout << " --no-log Disable logging to file" << std::endl;
std::cout << " --no-stats Disable performance statistics" << std::endl;
std::cout << " --pitch Enable pitch detection" << std::endl;
std::cout << " --no-visual Disable visual feedback" << std::endl;
std::cout << " --help Show this help" << std::endl;
std::cout << "\nExamples:" << std::endl;
std::cout << " ./beat_detector # Default settings" << std::endl;
std::cout << " ./beat_detector 256 --pitch # Smaller buffer with pitch detection" << std::endl;
std::cout << " ./beat_detector 1024 --no-visual # Larger buffer, no visual feedback" << std::endl;
}
int main(int argc, char* argv[]) {
// Parse command line arguments
uint32_t buffer_size = 512;
bool enable_logging = true;
bool enable_performance_stats = true;
bool enable_pitch_detection = false;
bool enable_visual_feedback = true;
for (int i = 1; i < argc; ++i) {
std::string arg = argv[i];
if (arg == "--help" || arg == "-h") {
print_usage();
return 0;
} else if (arg == "--no-log") {
enable_logging = false;
} else if (arg == "--no-stats") {
enable_performance_stats = false;
} else if (arg == "--pitch") {
enable_pitch_detection = true;
} else if (arg == "--no-visual") {
enable_visual_feedback = false;
} else if (arg[0] != '-') {
// Assume it's a buffer size
try {
buffer_size = std::stoul(arg);
if (buffer_size < 64 || buffer_size > 8192) {
std::cerr << " Buffer size must be between 64 and 8192" << std::endl;
return 1;
}
} catch (...) {
std::cerr << " Invalid buffer size: " << arg << std::endl;
return 1;
}
} else {
std::cerr << " Unknown option: " << arg << std::endl;
print_usage();
return 1;
}
}
// Set up signal handling
std::signal(SIGINT, EnhancedBeatDetector::signal_handler);
std::signal(SIGTERM, EnhancedBeatDetector::signal_handler);
try {
EnhancedBeatDetector detector(buffer_size, enable_logging, enable_performance_stats,
enable_pitch_detection, enable_visual_feedback);
detector.run();
} catch (const std::exception& e) {
std::cerr << " Error: " << e.what() << std::endl;
return 1;
}
return 0;
}
/*
* Compilation command:
* g++ -std=c++17 -O3 -Wall -Wextra -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -I/usr/include/aubio \
* -o beat_detector beat_detector.cpp -lpipewire-0.3 -laubio -pthread
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -1,84 +0,0 @@
pragma Singleton
import Quickshell
import QtQuick
Singleton {
id: root
readonly property Rounding rounding: Rounding {}
readonly property Spacing spacing: Spacing {}
readonly property Padding padding: Padding {}
readonly property Font font: Font {}
readonly property Anim anim: Anim {}
component Rounding: QtObject {
readonly property int small: 12
readonly property int normal: 17
readonly property int large: 25
readonly property int full: 1000
}
component Spacing: QtObject {
readonly property int small: 7
readonly property int smaller: 10
readonly property int normal: 12
readonly property int larger: 15
readonly property int large: 20
}
component Padding: QtObject {
readonly property int small: 5
readonly property int smaller: 7
readonly property int normal: 10
readonly property int larger: 12
readonly property int large: 15
}
component FontFamily: QtObject {
readonly property string sans: "IBM Plex Sans"
readonly property string mono: "JetBrains Mono NF"
readonly property string material: "Material Symbols Rounded"
}
component FontSize: QtObject {
readonly property int small: 11
readonly property int smaller: 12
readonly property int normal: 13
readonly property int larger: 15
readonly property int large: 18
readonly property int extraLarge: 28
}
component Font: QtObject {
readonly property FontFamily family: FontFamily {}
readonly property FontSize size: FontSize {}
}
component AnimCurves: QtObject {
readonly property list<real> emphasized: [0.05, 0, 2 / 15, 0.06, 1 / 6, 0.4, 5 / 24, 0.82, 0.25, 1, 1, 1]
readonly property list<real> emphasizedAccel: [0.3, 0, 0.8, 0.15, 1, 1]
readonly property list<real> emphasizedDecel: [0.05, 0.7, 0.1, 1, 1, 1]
readonly property list<real> standard: [0.2, 0, 0, 1, 1, 1]
readonly property list<real> standardAccel: [0.3, 0, 1, 1, 1, 1]
readonly property list<real> standardDecel: [0, 0, 0, 1, 1, 1]
readonly property list<real> expressiveFastSpatial: [0.42, 1.67, 0.21, 0.9, 1, 1]
readonly property list<real> expressiveDefaultSpatial: [0.38, 1.21, 0.22, 1, 1, 1]
readonly property list<real> expressiveEffects: [0.34, 0.8, 0.34, 1, 1, 1]
}
component AnimDurations: QtObject {
readonly property int small: 200
readonly property int normal: 400
readonly property int large: 600
readonly property int extraLarge: 1000
readonly property int expressiveFastSpatial: 350
readonly property int expressiveDefaultSpatial: 500
readonly property int expressiveEffects: 200
}
component Anim: QtObject {
readonly property AnimCurves curves: AnimCurves {}
readonly property AnimDurations durations: AnimDurations {}
}
}

View File

@@ -1,22 +0,0 @@
import Quickshell.Io
JsonObject {
property JsonObject sizes: JsonObject {
property int innerHeight: 30
property int windowPreviewSize: 400
property int trayMenuWidth: 300
property int batteryWidth: 250
}
property JsonObject workspaces: JsonObject {
property int shown: 5
property bool rounded: true
property bool activeIndicator: true
property bool occupiedBg: false
property bool showWindows: true
property bool activeTrail: false
property string label: " "
property string occupiedLabel: "󰮯 "
property string activeLabel: "󰮯 "
}
}

View File

@@ -1,9 +0,0 @@
import "root:/services"
import Quickshell.Io
import QtQuick
JsonObject {
property color colour: Colours.palette.m3surface
property int thickness: Appearance.padding.normal
property int rounding: Appearance.rounding.large
}

View File

@@ -1,36 +0,0 @@
pragma Singleton
import "root:/utils"
import Quickshell
import Quickshell.Io
Singleton {
id: root
property alias bar: adapter.bar
property alias border: adapter.border
property alias dashboard: adapter.dashboard
property alias launcher: adapter.launcher
property alias notifs: adapter.notifs
property alias osd: adapter.osd
property alias session: adapter.session
FileView {
path: `${Paths.config}/shell.json`
watchChanges: true
onFileChanged: reload()
onAdapterUpdated: writeAdapter()
JsonAdapter {
id: adapter
property JsonObject bar: BarConfig {}
property JsonObject border: BorderConfig {}
property JsonObject dashboard: DashboardConfig {}
property JsonObject launcher: LauncherConfig {}
property JsonObject notifs: NotifsConfig {}
property JsonObject osd: OsdConfig {}
property JsonObject session: SessionConfig {}
}
}
}

View File

@@ -1,23 +0,0 @@
import Quickshell.Io
JsonObject {
property int mediaUpdateInterval: 500
property int visualiserBars: 45
property string weatherLocation: "" // A lat,long pair, e.g. "37.8267,-122.4233"
property JsonObject sizes: JsonObject {
readonly property int tabIndicatorHeight: 3
readonly property int tabIndicatorSpacing: 5
readonly property int infoWidth: 200
readonly property int infoIconSize: 25
readonly property int dateTimeWidth: 110
readonly property int mediaWidth: 200
readonly property int mediaProgressSweep: 180
readonly property int mediaProgressThickness: 8
readonly property int resourceProgessThickness: 10
readonly property int weatherWidth: 250
readonly property int mediaCoverArtSize: 150
readonly property int mediaVisualiserSize: 80
readonly property int resourceSize: 200
}
}

View File

@@ -1,15 +0,0 @@
import Quickshell.Io
JsonObject {
property int maxShown: 8
property int maxWallpapers: 9 // Warning: even numbers look bad
property string actionPrefix: ">"
property bool enableDangerousActions: false // Allow actions that can cause losing data, like shutdown, reboot and logout
property JsonObject sizes: JsonObject {
property int itemWidth: 600
property int itemHeight: 57
property int wallpaperWidth: 280
property int wallpaperHeight: 200
}
}

View File

@@ -1,15 +0,0 @@
import Quickshell.Io
JsonObject {
property bool expire: true
property int defaultExpireTimeout: 3000
property real clearThreshold: 0.3
property int expandThreshold: 20
property bool actionOnClick: false
property JsonObject sizes: JsonObject {
property int width: 400
property int image: 41
property int badge: 20
}
}

View File

@@ -1,10 +0,0 @@
import Quickshell.Io
JsonObject {
property int hideDelay: 2000
property JsonObject sizes: JsonObject {
property int sliderWidth: 30
property int sliderHeight: 150
}
}

View File

@@ -1,9 +0,0 @@
import Quickshell.Io
JsonObject {
property int dragThreshold: 30
property JsonObject sizes: JsonObject {
property int button: 80
}
}

View File

@@ -1,65 +0,0 @@
import "root:/widgets"
import "root:/services"
import Quickshell
import Quickshell.Io
Scope {
id: root
property bool launcherInterrupted
CustomShortcut {
name: "showall"
description: "Toggle launcher, dashboard and osd"
onPressed: {
const v = Visibilities.getForActive();
v.launcher = v.dashboard = v.osd = !(v.launcher || v.dashboard || v.osd);
}
}
CustomShortcut {
name: "session"
description: "Toggle session menu"
onPressed: {
const visibilities = Visibilities.getForActive();
visibilities.session = !visibilities.session;
}
}
CustomShortcut {
name: "launcher"
description: "Toggle launcher"
onPressed: root.launcherInterrupted = false
onReleased: {
if (!root.launcherInterrupted) {
const visibilities = Visibilities.getForActive();
visibilities.launcher = !visibilities.launcher;
}
root.launcherInterrupted = false;
}
}
CustomShortcut {
name: "launcherInterrupt"
description: "Interrupt launcher keybind"
onPressed: root.launcherInterrupted = true
}
IpcHandler {
target: "drawers"
function toggle(drawer: string): void {
if (list().split("\n").includes(drawer)) {
const visibilities = Visibilities.getForActive();
visibilities[drawer] = !visibilities[drawer];
} else {
console.warn(`[IPC] Drawer "${drawer}" does not exist`);
}
}
function list(): string {
const visibilities = Visibilities.getForActive();
return Object.keys(visibilities).filter(k => typeof visibilities[k] === "boolean").join("\n");
}
}
}

View File

@@ -1,26 +0,0 @@
import "root:/widgets"
import Quickshell
import Quickshell.Wayland
Variants {
model: Quickshell.screens
StyledWindow {
id: win
required property ShellScreen modelData
screen: modelData
name: "background"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Background
color: "black"
anchors.top: true
anchors.bottom: true
anchors.left: true
anchors.right: true
Wallpaper {}
}
}

View File

@@ -1,71 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Item {
id: root
property string source: Wallpapers.current
property Image current: one
anchors.fill: parent
onSourceChanged: {
if (current === one)
two.update();
else
one.update();
}
Img {
id: one
}
Img {
id: two
}
component Img: CachingImage {
id: img
function update(): void {
if (path === root.source)
root.current = this;
else
path = root.source;
}
anchors.fill: parent
opacity: 0
scale: Wallpapers.showPreview ? 1 : 0.8
onStatusChanged: {
if (status === Image.Ready)
root.current = this;
}
states: State {
name: "visible"
when: root.current === img
PropertyChanges {
img.opacity: 1
img.scale: 1
}
}
transitions: Transition {
NumberAnimation {
target: img
properties: "opacity,scale"
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}

View File

@@ -1,174 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import "root:/modules/bar/popouts" as BarPopouts
import "components"
import "components/workspaces"
import Quickshell
import QtQuick
Item {
id: root
required property ShellScreen screen
required property BarPopouts.Wrapper popouts
function checkPopout(y: real): void {
const spacing = Appearance.spacing.small;
const aw = activeWindow.child;
const awy = activeWindow.y + aw.y;
const ty = tray.y;
const th = tray.implicitHeight;
const trayItems = tray.items;
const n = statusIconsInner.network;
const ny = statusIcons.y + statusIconsInner.y + n.y - spacing / 2;
const bls = statusIcons.y + statusIconsInner.y + statusIconsInner.bs - spacing / 2;
const ble = statusIcons.y + statusIconsInner.y + statusIconsInner.be + spacing / 2;
const b = statusIconsInner.battery;
const by = statusIcons.y + statusIconsInner.y + b.y - spacing / 2;
if (y >= awy && y <= awy + aw.implicitHeight) {
popouts.currentName = "activewindow";
popouts.currentCenter = Qt.binding(() => activeWindow.y + aw.y + aw.implicitHeight / 2);
popouts.hasCurrent = true;
} else if (y > ty && y < ty + th) {
const index = Math.floor(((y - ty) / th) * trayItems.count);
const item = trayItems.itemAt(index);
popouts.currentName = `traymenu${index}`;
popouts.currentCenter = Qt.binding(() => tray.y + item.y + item.implicitHeight / 2);
popouts.hasCurrent = true;
} else if (y >= ny && y <= ny + n.implicitHeight + spacing) {
popouts.currentName = "network";
popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + n.y + n.implicitHeight / 2);
popouts.hasCurrent = true;
} else if (y >= bls && y <= ble) {
popouts.currentName = "bluetooth";
popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + statusIconsInner.bs + (statusIconsInner.be - statusIconsInner.bs) / 2);
popouts.hasCurrent = true;
} else if (y >= by && y <= by + b.implicitHeight + spacing) {
popouts.currentName = "battery";
popouts.currentCenter = Qt.binding(() => statusIcons.y + statusIconsInner.y + b.y + b.implicitHeight / 2);
popouts.hasCurrent = true;
} else {
popouts.hasCurrent = false;
}
}
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
implicitWidth: child.implicitWidth + Config.border.thickness * 2
Item {
id: child
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
implicitWidth: Math.max(osIcon.implicitWidth, workspaces.implicitWidth, activeWindow.implicitWidth, tray.implicitWidth, clock.implicitWidth, statusIcons.implicitWidth, power.implicitWidth)
OsIcon {
id: osIcon
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Appearance.padding.large
}
StyledRect {
id: workspaces
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: osIcon.bottom
anchors.topMargin: Appearance.spacing.normal
radius: Appearance.rounding.full
color: Colours.palette.m3surfaceContainer
implicitWidth: workspacesInner.implicitWidth + Appearance.padding.small * 2
implicitHeight: workspacesInner.implicitHeight + Appearance.padding.small * 2
MouseArea {
anchors.fill: parent
anchors.leftMargin: -Config.border.thickness
anchors.rightMargin: -Config.border.thickness
onWheel: event => {
const activeWs = Hyprland.activeClient?.workspace?.name;
if (activeWs?.startsWith("special:"))
Hyprland.dispatch(`togglespecialworkspace ${activeWs.slice(8)}`);
else if (event.angleDelta.y < 0 || Hyprland.activeWsId > 1)
Hyprland.dispatch(`workspace r${event.angleDelta.y > 0 ? "-" : "+"}1`);
}
}
Workspaces {
id: workspacesInner
anchors.centerIn: parent
}
}
ActiveWindow {
id: activeWindow
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: workspaces.bottom
anchors.bottom: tray.top
anchors.margins: Appearance.spacing.large
monitor: Brightness.getMonitorForScreen(root.screen)
}
Tray {
id: tray
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: clock.top
anchors.bottomMargin: Appearance.spacing.larger
}
Clock {
id: clock
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: statusIcons.top
anchors.bottomMargin: Appearance.spacing.normal
}
StyledRect {
id: statusIcons
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: power.top
anchors.bottomMargin: Appearance.spacing.normal
radius: Appearance.rounding.full
color: Colours.palette.m3surfaceContainer
implicitHeight: statusIconsInner.implicitHeight + Appearance.padding.normal * 2
StatusIcons {
id: statusIconsInner
anchors.centerIn: parent
}
}
Power {
id: power
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Appearance.padding.large
}
}
}

View File

@@ -1,140 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import QtQuick
Item {
id: root
required property Brightness.Monitor monitor
property color colour: Colours.palette.m3primary
readonly property Item child: child
implicitWidth: child.implicitWidth
implicitHeight: child.implicitHeight
MouseArea {
anchors.top: parent.top
anchors.bottom: child.top
anchors.left: parent.left
anchors.right: parent.right
onWheel: event => {
if (event.angleDelta.y > 0)
Audio.setVolume(Audio.volume + 0.1);
else if (event.angleDelta.y < 0)
Audio.setVolume(Audio.volume - 0.1);
}
}
MouseArea {
anchors.top: child.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
onWheel: event => {
const monitor = root.monitor;
if (event.angleDelta.y > 0)
monitor.setBrightness(monitor.brightness + 0.1);
else if (event.angleDelta.y < 0)
monitor.setBrightness(monitor.brightness - 0.1);
}
}
Item {
id: child
property Item current: text1
anchors.centerIn: parent
clip: true
implicitWidth: Math.max(icon.implicitWidth, current.implicitHeight)
implicitHeight: icon.implicitHeight + current.implicitWidth + current.anchors.topMargin
MaterialIcon {
id: icon
animate: true
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
color: root.colour
anchors.horizontalCenter: parent.horizontalCenter
}
Title {
id: text1
}
Title {
id: text2
}
TextMetrics {
id: metrics
text: Hyprland.activeClient?.title ?? qsTr("Desktop")
font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono
elide: Qt.ElideRight
elideWidth: root.height - icon.height
onTextChanged: {
const next = child.current === text1 ? text2 : text1;
next.text = elidedText;
child.current = next;
}
onElideWidthChanged: child.current.text = elidedText
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}
component Title: StyledText {
id: text
anchors.horizontalCenter: icon.horizontalCenter
anchors.top: icon.bottom
anchors.topMargin: Appearance.spacing.small
font.pointSize: metrics.font.pointSize
font.family: metrics.font.family
color: root.colour
opacity: child.current === this ? 1 : 0
transform: Rotation {
angle: 90
origin.x: text.implicitHeight / 2
origin.y: text.implicitHeight / 2
}
width: implicitHeight
height: implicitWidth
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}

View File

@@ -1,33 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Column {
id: root
property color colour: Colours.palette.m3tertiary
spacing: Appearance.spacing.small
MaterialIcon {
id: icon
text: "calendar_month"
color: root.colour
anchors.horizontalCenter: parent.horizontalCenter
}
StyledText {
id: text
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: StyledText.AlignHCenter
text: Time.format("hh\nmm")
font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono
color: root.colour
}
}

View File

@@ -1,11 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
StyledText {
text: Icons.osIcon
font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono
color: Colours.palette.m3tertiary
}

View File

@@ -1,27 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
MaterialIcon {
text: "power_settings_new"
color: Colours.palette.m3error
font.bold: true
font.pointSize: Appearance.font.size.normal
StateLayer {
anchors.fill: undefined
anchors.centerIn: parent
anchors.horizontalCenterOffset: 1
implicitWidth: parent.implicitHeight + Appearance.padding.small * 2
implicitHeight: implicitWidth
radius: Appearance.rounding.full
function onClicked(): void {
const v = Visibilities.screens[QsWindow.window.screen];
v.session = !v.session;
}
}
}

View File

@@ -1,114 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell
import Quickshell.Services.UPower
import QtQuick
Item {
id: root
property color colour: Colours.palette.m3secondary
readonly property Item network: network
readonly property real bs: bluetooth.y
readonly property real be: repeater.count > 0 ? devices.y + devices.implicitHeight : bluetooth.y + bluetooth.implicitHeight
readonly property Item battery: battery
clip: true
implicitWidth: Math.max(network.implicitWidth, bluetooth.implicitWidth, devices.implicitWidth, battery.implicitWidth)
implicitHeight: network.implicitHeight + bluetooth.implicitHeight + bluetooth.anchors.topMargin + (repeater.count > 0 ? devices.implicitHeight + devices.anchors.topMargin : 0) + battery.implicitHeight + battery.anchors.topMargin
MaterialIcon {
id: network
animate: true
text: Network.active ? Icons.getNetworkIcon(Network.active.strength ?? 0) : "wifi_off"
color: root.colour
anchors.horizontalCenter: parent.horizontalCenter
}
MaterialIcon {
id: bluetooth
anchors.horizontalCenter: network.horizontalCenter
anchors.top: network.bottom
anchors.topMargin: Appearance.spacing.small
animate: true
text: Bluetooth.powered ? "bluetooth" : "bluetooth_disabled"
color: root.colour
}
Column {
id: devices
anchors.horizontalCenter: bluetooth.horizontalCenter
anchors.top: bluetooth.bottom
anchors.topMargin: Appearance.spacing.small
Repeater {
id: repeater
model: ScriptModel {
values: Bluetooth.devices.filter(d => d.connected)
}
MaterialIcon {
required property Bluetooth.Device modelData
animate: true
text: Icons.getBluetoothIcon(modelData.icon)
color: root.colour
}
}
}
MaterialIcon {
id: battery
anchors.horizontalCenter: devices.horizontalCenter
anchors.top: repeater.count > 0 ? devices.bottom : bluetooth.bottom
anchors.topMargin: Appearance.spacing.small
animate: true
text: {
if (!UPower.displayDevice.isLaptopBattery) {
if (PowerProfiles.profile === PowerProfile.PowerSaver)
return "energy_savings_leaf";
if (PowerProfiles.profile === PowerProfile.Performance)
return "rocket_launch";
return "balance";
}
const perc = UPower.displayDevice.percentage;
const charging = !UPower.onBattery;
if (perc === 1)
return charging ? "battery_charging_full" : "battery_full";
let level = Math.floor(perc * 7);
if (charging && (level === 4 || level === 1))
level--;
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
}
color: !UPower.onBattery || UPower.displayDevice.percentage > 0.2 ? root.colour : Colours.palette.m3error
fill: 1
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}

View File

@@ -1,56 +0,0 @@
import "root:/config"
import Quickshell.Services.SystemTray
import QtQuick
Item {
id: root
readonly property Repeater items: items
clip: true
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
Column {
id: layout
spacing: Appearance.spacing.small
add: Transition {
NumberAnimation {
properties: "scale"
from: 0
to: 1
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
Repeater {
id: items
model: SystemTray.items
TrayItem {}
}
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}

View File

@@ -1,48 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/config"
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.SystemTray
import QtQuick
MouseArea {
id: root
required property SystemTrayItem modelData
acceptedButtons: Qt.LeftButton | Qt.RightButton
implicitWidth: Appearance.font.size.small * 2
implicitHeight: Appearance.font.size.small * 2
onClicked: event => {
if (event.button === Qt.LeftButton)
modelData.activate();
else if (modelData.hasMenu)
menu.open();
}
// TODO custom menu
QsMenuAnchor {
id: menu
menu: root.modelData.menu
anchor.window: this.QsWindow.window
}
IconImage {
id: icon
source: {
let icon = root.modelData.icon;
if (icon.includes("?path=")) {
const [name, path] = icon.split("?path=");
icon = `file://${path}/${name.slice(name.lastIndexOf("/") + 1)}`;
}
return icon;
}
asynchronous: true
anchors.fill: parent
}
}

View File

@@ -1,111 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Effects
StyledRect {
id: root
required property list<Workspace> workspaces
required property Item mask
required property real maskWidth
required property real maskHeight
required property int groupOffset
readonly property int currentWsIdx: Hyprland.activeWsId - 1 - groupOffset
property real leading: getWsY(currentWsIdx)
property real trailing: getWsY(currentWsIdx)
property real currentSize: workspaces[currentWsIdx]?.size ?? 0
property real offset: Math.min(leading, trailing)
property real size: {
const s = Math.abs(leading - trailing) + currentSize;
if (Config.bar.workspaces.activeTrail && lastWs > currentWsIdx)
return Math.min(getWsY(lastWs) + (workspaces[lastWs]?.size ?? 0) - offset, s);
return s;
}
property int cWs
property int lastWs
function getWsY(idx: int): real {
let y = 0;
for (let i = 0; i < idx; i++)
y += workspaces[i]?.size ?? 0;
return y;
}
onCurrentWsIdxChanged: {
lastWs = cWs;
cWs = currentWsIdx;
}
clip: true
x: 1
y: offset + 1
implicitWidth: Config.bar.sizes.innerHeight - 2
implicitHeight: size - 2
radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0
color: Colours.palette.m3primary
StyledRect {
id: base
visible: false
anchors.fill: parent
color: Colours.palette.m3onPrimary
}
MultiEffect {
source: base
maskSource: root.mask
maskEnabled: true
maskSpreadAtMin: 1
maskThresholdMin: 0.5
x: 0
y: -parent.offset
implicitWidth: root.maskWidth
implicitHeight: root.maskHeight
anchors.horizontalCenter: parent.horizontalCenter
}
Behavior on leading {
enabled: Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on trailing {
enabled: Config.bar.workspaces.activeTrail
Anim {
duration: Appearance.anim.durations.normal * 2
}
}
Behavior on currentSize {
enabled: Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on offset {
enabled: !Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on size {
enabled: !Config.bar.workspaces.activeTrail
Anim {}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}

View File

@@ -1,99 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
Item {
id: root
required property list<Workspace> workspaces
required property var occupied
required property int groupOffset
property list<var> pills: []
onOccupiedChanged: {
let count = 0;
const start = groupOffset;
const end = start + Config.bar.workspaces.shown;
for (const [ws, occ] of Object.entries(occupied)) {
if (ws > start && ws <= end && occ) {
if (!occupied[ws - 1]) {
if (pills[count])
pills[count].start = ws;
else
pills.push(pillComp.createObject(root, {
start: ws
}));
count++;
}
if (!occupied[ws + 1])
pills[count - 1].end = ws;
}
}
if (pills.length > count)
pills.splice(count, pills.length - count).forEach(p => p.destroy());
}
Repeater {
model: ScriptModel {
values: root.pills.filter(p => p)
}
StyledRect {
id: rect
required property var modelData
readonly property Workspace start: root.workspaces[modelData.start - 1 - root.groupOffset] ?? null
readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null
color: Colours.alpha(Colours.palette.m3surfaceContainerHigh, true)
radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0
x: start?.x ?? 0
y: start?.y ?? 0
implicitWidth: Config.bar.sizes.innerHeight
implicitHeight: end?.y + end?.height - start?.y
anchors.horizontalCenter: parent.horizontalCenter
scale: 0
Component.onCompleted: scale = 1
Behavior on scale {
Anim {
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
Behavior on x {
Anim {}
}
Behavior on y {
Anim {}
}
}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
component Pill: QtObject {
property int start
property int end
}
Component {
id: pillComp
Pill {}
}
}

View File

@@ -1,93 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell
import QtQuick
import QtQuick.Layouts
Item {
id: root
required property int index
required property var occupied
required property int groupOffset
readonly property bool isWorkspace: true // Flag for finding workspace children
// Unanimated prop for others to use as reference
readonly property real size: childrenRect.height + (hasWindows ? Appearance.padding.normal : 0)
readonly property int ws: groupOffset + index + 1
readonly property bool isOccupied: occupied[ws] ?? false
readonly property bool hasWindows: isOccupied && Config.bar.workspaces.showWindows
Layout.preferredWidth: childrenRect.width
Layout.preferredHeight: size
StyledText {
id: indicator
readonly property string label: Config.bar.workspaces.label || root.ws
readonly property string occupiedLabel: Config.bar.workspaces.occupiedLabel || label
readonly property string activeLabel: Config.bar.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
animate: true
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label
color: Config.bar.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant
horizontalAlignment: StyledText.AlignHCenter
verticalAlignment: StyledText.AlignVCenter
width: Config.bar.sizes.innerHeight
height: Config.bar.sizes.innerHeight
}
Loader {
id: windows
active: Config.bar.workspaces.showWindows
asynchronous: true
anchors.horizontalCenter: indicator.horizontalCenter
anchors.top: indicator.bottom
sourceComponent: Column {
spacing: Appearance.spacing.small
add: Transition {
Anim {
properties: "scale"
from: 0
to: 1
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
Repeater {
model: ScriptModel {
values: Hyprland.clients.filter(c => c.workspace?.id === root.ws)
}
MaterialIcon {
required property Hyprland.Client modelData
text: Icons.getAppCategoryIcon(modelData.wmClass, "terminal")
color: Colours.palette.m3onSurfaceVariant
}
}
}
}
Behavior on Layout.preferredWidth {
Anim {}
}
Behavior on Layout.preferredHeight {
Anim {}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}

View File

@@ -1,75 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Layouts
Item {
id: root
readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace).sort((w1, w2) => w1.ws - w2.ws)
readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => {
acc[curr.id] = curr.lastIpcObject.windows > 0;
return acc;
}, {})
readonly property int groupOffset: Math.floor((Hyprland.activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
ColumnLayout {
id: layout
spacing: 0
layer.enabled: true
layer.smooth: true
Repeater {
model: Config.bar.workspaces.shown
Workspace {
occupied: root.occupied
groupOffset: root.groupOffset
}
}
}
Loader {
active: Config.bar.workspaces.occupiedBg
asynchronous: true
z: -1
anchors.fill: parent
sourceComponent: OccupiedBg {
workspaces: root.workspaces
occupied: root.occupied
groupOffset: root.groupOffset
}
}
Loader {
active: Config.bar.workspaces.activeIndicator
asynchronous: true
sourceComponent: ActiveIndicator {
workspaces: root.workspaces
mask: layout
maskWidth: root.width
maskHeight: root.height
groupOffset: root.groupOffset
}
}
MouseArea {
anchors.fill: parent
onPressed: event => {
const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1;
if (Hyprland.activeWsId !== ws)
Hyprland.dispatch(`workspace ${ws}`);
}
}
}

View File

@@ -1,75 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell.Widgets
import Quickshell.Wayland
import QtQuick
Item {
id: root
implicitWidth: Hyprland.activeClient ? child.implicitWidth : -Appearance.padding.large * 2
implicitHeight: child.implicitHeight
Column {
id: child
anchors.centerIn: parent
spacing: Appearance.spacing.normal
Row {
id: detailsRow
spacing: Appearance.spacing.normal
IconImage {
id: icon
implicitSize: details.implicitHeight
source: Icons.getAppIcon(Hyprland.activeClient?.wmClass ?? "", "image-missing")
}
Column {
id: details
StyledText {
text: Hyprland.activeClient?.title ?? ""
font.pointSize: Appearance.font.size.normal
elide: Text.ElideRight
width: preview.implicitWidth - icon.implicitWidth - detailsRow.spacing
}
StyledText {
text: Hyprland.activeClient?.wmClass ?? ""
color: Colours.palette.m3onSurfaceVariant
elide: Text.ElideRight
width: preview.implicitWidth - icon.implicitWidth - detailsRow.spacing
}
}
}
ClippingWrapperRectangle {
color: "transparent"
radius: Appearance.rounding.small
ScreencopyView {
id: preview
captureSource: Hyprland.activeClient ? ToplevelManager.activeToplevel : null
live: visible
constraintSize.width: Config.bar.sizes.windowPreviewSize
constraintSize.height: Config.bar.sizes.windowPreviewSize
}
}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}

View File

@@ -1,74 +0,0 @@
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Shapes
ShapePath {
id: root
required property Wrapper wrapper
required property bool invertBottomRounding
readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
property real ibr: invertBottomRounding ? -1 : 1
strokeWidth: -1
fillColor: Config.border.colour
PathArc {
relativeX: root.roundingX
relativeY: root.rounding
radiusX: Math.min(root.rounding, root.wrapper.width)
radiusY: root.rounding
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: root.wrapper.width - root.roundingX * 2
relativeY: 0
}
PathArc {
relativeX: root.roundingX
relativeY: root.rounding
radiusX: Math.min(root.rounding, root.wrapper.width)
radiusY: root.rounding
}
PathLine {
relativeX: 0
relativeY: root.wrapper.height - root.rounding * 2
}
PathArc {
relativeX: -root.roundingX * root.ibr
relativeY: root.rounding
radiusX: Math.min(root.rounding, root.wrapper.width)
radiusY: root.rounding
direction: root.ibr < 0 ? PathArc.Counterclockwise : PathArc.Clockwise
}
PathLine {
relativeX: -(root.wrapper.width - root.roundingX - root.roundingX * root.ibr)
relativeY: 0
}
PathArc {
relativeX: -root.roundingX
relativeY: root.rounding
radiusX: Math.min(root.rounding, root.wrapper.width)
radiusY: root.rounding
direction: PathArc.Counterclockwise
}
Behavior on fillColor {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on ibr {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}

View File

@@ -1,235 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell.Services.UPower
import QtQuick
Column {
id: root
spacing: Appearance.spacing.normal
width: Config.bar.sizes.batteryWidth
StyledText {
text: UPower.displayDevice.isLaptopBattery ? qsTr("Remaining: %1%").arg(Math.round(UPower.displayDevice.percentage * 100)) : qsTr("No battery detected")
}
StyledText {
function formatSeconds(s: int, fallback: string): string {
const day = Math.floor(s / 86400);
const hr = Math.floor(s / 3600) % 60;
const min = Math.floor(s / 60) % 60;
let comps = [];
if (day > 0)
comps.push(`${day} days`);
if (hr > 0)
comps.push(`${hr} hours`);
if (min > 0)
comps.push(`${min} mins`);
return comps.join(", ") || fallback;
}
text: UPower.displayDevice.isLaptopBattery ? qsTr("Time %1: %2").arg(UPower.onBattery ? "remaining" : "until charged").arg(UPower.onBattery ? formatSeconds(UPower.displayDevice.timeToEmpty, "Calculating...") : formatSeconds(UPower.displayDevice.timeToFull, "Fully charged!")) : qsTr("Power profile: %1").arg(PowerProfile.toString(PowerProfiles.profile))
}
Loader {
anchors.horizontalCenter: parent.horizontalCenter
active: PowerProfiles.degradationReason !== PerformanceDegradationReason.None
asynchronous: true
height: active ? (item?.implicitHeight ?? 0) : 0
sourceComponent: StyledRect {
implicitWidth: child.implicitWidth + Appearance.padding.normal * 2
implicitHeight: child.implicitHeight + Appearance.padding.smaller * 2
color: Colours.palette.m3error
radius: Appearance.rounding.normal
Column {
id: child
anchors.centerIn: parent
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
MaterialIcon {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -font.pointSize / 10
text: "warning"
color: Colours.palette.m3onError
}
StyledText {
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Performance Degraded")
color: Colours.palette.m3onError
font.family: Appearance.font.family.mono
font.weight: 500
}
MaterialIcon {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -font.pointSize / 10
text: "warning"
color: Colours.palette.m3onError
}
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Reason: %1").arg(PerformanceDegradationReason.toString(PowerProfiles.degradationReason))
color: Colours.palette.m3onError
}
}
}
}
StyledRect {
id: profiles
property string current: {
const p = PowerProfiles.profile;
if (p === PowerProfile.PowerSaver)
return saver.icon;
if (p === PowerProfile.Performance)
return perf.icon;
return balance.icon;
}
anchors.horizontalCenter: parent.horizontalCenter
implicitWidth: saver.implicitHeight + balance.implicitHeight + perf.implicitHeight + Appearance.padding.normal * 2 + Appearance.spacing.large * 2
implicitHeight: Math.max(saver.implicitHeight, balance.implicitHeight, perf.implicitHeight) + Appearance.padding.small * 2
color: Colours.palette.m3surfaceContainer
radius: Appearance.rounding.full
StyledRect {
id: indicator
color: Colours.palette.m3primary
radius: Appearance.rounding.full
state: profiles.current
states: [
State {
name: saver.icon
Fill {
item: saver
}
},
State {
name: balance.icon
Fill {
item: balance
}
},
State {
name: perf.icon
Fill {
item: perf
}
}
]
transitions: Transition {
AnchorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}
Profile {
id: saver
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.small
profile: PowerProfile.PowerSaver
icon: "energy_savings_leaf"
}
Profile {
id: balance
anchors.centerIn: parent
profile: PowerProfile.Balanced
icon: "balance"
}
Profile {
id: perf
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.small
profile: PowerProfile.Performance
icon: "rocket_launch"
}
}
component Fill: AnchorChanges {
required property Item item
target: indicator
anchors.left: item.left
anchors.right: item.right
anchors.top: item.top
anchors.bottom: item.bottom
}
component Profile: Item {
required property string icon
required property int profile
implicitWidth: icon.implicitHeight + Appearance.padding.small * 2
implicitHeight: icon.implicitHeight + Appearance.padding.small * 2
StateLayer {
radius: Appearance.rounding.full
color: profiles.current === parent.icon ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
function onClicked(): void {
PowerProfiles.profile = parent.profile;
}
}
MaterialIcon {
id: icon
anchors.centerIn: parent
text: parent.icon
font.pointSize: Appearance.font.size.large
color: profiles.current === text ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
fill: profiles.current === text ? 1 : 0
Behavior on fill {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}
}

View File

@@ -1,18 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Column {
id: root
spacing: Appearance.spacing.normal
StyledText {
text: qsTr("Bluetooth %1").arg(Bluetooth.powered ? "enabled" : "disabled")
}
StyledText {
text: Bluetooth.devices.some(d => d.connected) ? qsTr("Connected to: %1").arg(Bluetooth.devices.filter(d => d.connected).map(d => d.alias).join(", ")) : qsTr("No devices connected")
}
}

View File

@@ -1,175 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Services.SystemTray
import QtQuick
Item {
id: root
required property ShellScreen screen
property string currentName
property real currentCenter
property bool hasCurrent
anchors.centerIn: parent
implicitWidth: hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0
implicitHeight: (content.children.find(c => c.shouldBeActive)?.implicitHeight ?? 0) + Appearance.padding.large * 2
Item {
id: content
anchors.fill: parent
anchors.margins: Appearance.padding.large
clip: true
Popout {
name: "activewindow"
source: "ActiveWindow.qml"
}
Popout {
name: "network"
source: "Network.qml"
}
Popout {
name: "bluetooth"
source: "Bluetooth.qml"
}
Popout {
name: "battery"
source: "Battery.qml"
}
Repeater {
model: ScriptModel {
values: [...SystemTray.items.values]
}
Popout {
id: trayMenu
required property SystemTrayItem modelData
required property int index
name: `traymenu${index}`
sourceComponent: trayMenuComp
Connections {
target: root
function onHasCurrentChanged(): void {
if (root.hasCurrent && trayMenu.shouldBeActive) {
trayMenu.sourceComponent = null;
trayMenu.sourceComponent = trayMenuComp;
}
}
}
Component {
id: trayMenuComp
TrayMenu {
popouts: root
trayItem: trayMenu.modelData.menu
}
}
}
}
}
Behavior on implicitWidth {
Anim {
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
enabled: root.implicitWidth > 0
Anim {
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on currentCenter {
enabled: root.implicitWidth > 0
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
component Popout: Loader {
id: popout
required property string name
property bool shouldBeActive: root.currentName === name
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
opacity: 0
scale: 0.8
active: false
asynchronous: true
states: State {
name: "active"
when: popout.shouldBeActive
PropertyChanges {
popout.active: true
popout.opacity: 1
popout.scale: 1
}
}
transitions: [
Transition {
from: "active"
to: ""
SequentialAnimation {
Anim {
properties: "opacity,scale"
duration: Appearance.anim.durations.small
}
PropertyAction {
target: popout
property: "active"
}
}
},
Transition {
from: ""
to: "active"
SequentialAnimation {
PropertyAction {
target: popout
property: "active"
}
Anim {
properties: "opacity,scale"
}
}
}
]
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}

View File

@@ -1,22 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Column {
id: root
spacing: Appearance.spacing.normal
StyledText {
text: qsTr("Connected to: %1").arg(Network.active?.ssid ?? "None")
}
StyledText {
text: qsTr("Strength: %1/100").arg(Network.active?.strength ?? 0)
}
StyledText {
text: qsTr("Frequency: %1 MHz").arg(Network.active?.frequency ?? 0)
}
}

View File

@@ -1,237 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Widgets
import QtQuick
import QtQuick.Controls
StackView {
id: root
required property Item popouts
required property QsMenuHandle trayItem
implicitWidth: currentItem.implicitWidth
implicitHeight: currentItem.implicitHeight
initialItem: SubMenu {
handle: root.trayItem
}
pushEnter: Anim {}
pushExit: Anim {}
popEnter: Anim {}
popExit: Anim {}
component Anim: Transition {
NumberAnimation {
duration: 0
}
}
component SubMenu: Column {
id: menu
required property QsMenuHandle handle
property bool isSubMenu
property bool shown
padding: Appearance.padding.smaller
spacing: Appearance.spacing.small
opacity: shown ? 1 : 0
scale: shown ? 1 : 0.8
Component.onCompleted: shown = true
StackView.onActivating: shown = true
StackView.onDeactivating: shown = false
StackView.onRemoved: destroy()
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on scale {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
QsMenuOpener {
id: menuOpener
menu: menu.handle
}
Repeater {
model: menuOpener.children
StyledRect {
id: item
required property QsMenuEntry modelData
implicitWidth: Config.bar.sizes.trayMenuWidth
implicitHeight: modelData.isSeparator ? 1 : children.implicitHeight
radius: Appearance.rounding.full
color: modelData.isSeparator ? Colours.palette.m3outlineVariant : "transparent"
Loader {
id: children
anchors.left: parent.left
anchors.right: parent.right
active: !item.modelData.isSeparator
asynchronous: true
sourceComponent: Item {
implicitHeight: label.implicitHeight
StateLayer {
anchors.margins: -Appearance.padding.small / 2
anchors.leftMargin: -Appearance.padding.smaller
anchors.rightMargin: -Appearance.padding.smaller
radius: item.radius
disabled: !item.modelData.enabled
function onClicked(): void {
const entry = item.modelData;
if (entry.hasChildren)
root.push(subMenuComp.createObject(null, {
handle: entry,
isSubMenu: true
}));
else {
item.modelData.triggered();
root.popouts.hasCurrent = false;
}
}
}
Loader {
id: icon
anchors.left: parent.left
active: item.modelData.icon !== ""
asynchronous: true
sourceComponent: IconImage {
implicitSize: label.implicitHeight
source: item.modelData.icon
}
}
StyledText {
id: label
anchors.left: icon.right
anchors.leftMargin: icon.active ? Appearance.spacing.smaller : 0
text: labelMetrics.elidedText
color: item.modelData.enabled ? Colours.palette.m3onSurface : Colours.palette.m3outline
}
TextMetrics {
id: labelMetrics
text: item.modelData.text
font.pointSize: label.font.pointSize
font.family: label.font.family
elide: Text.ElideRight
elideWidth: Config.bar.sizes.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + Appearance.spacing.normal : 0)
}
Loader {
id: expand
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
active: item.modelData.hasChildren
asynchronous: true
sourceComponent: MaterialIcon {
text: "chevron_right"
color: item.modelData.enabled ? Colours.palette.m3onSurface : Colours.palette.m3outline
}
}
}
}
}
}
Loader {
active: menu.isSubMenu
asynchronous: true
sourceComponent: Item {
implicitWidth: back.implicitWidth
implicitHeight: back.implicitHeight + Appearance.spacing.small / 2
Item {
anchors.bottom: parent.bottom
implicitWidth: back.implicitWidth
implicitHeight: back.implicitHeight
StyledRect {
anchors.fill: parent
anchors.margins: -Appearance.padding.small / 2
anchors.leftMargin: -Appearance.padding.smaller
anchors.rightMargin: -Appearance.padding.smaller * 2
radius: Appearance.rounding.full
color: Colours.palette.m3secondaryContainer
StateLayer {
radius: parent.radius
color: Colours.palette.m3onSecondaryContainer
function onClicked(): void {
root.pop();
}
}
}
Row {
id: back
anchors.verticalCenter: parent.verticalCenter
MaterialIcon {
anchors.verticalCenter: parent.verticalCenter
text: "chevron_left"
color: Colours.palette.m3onSecondaryContainer
}
StyledText {
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Back")
color: Colours.palette.m3onSecondaryContainer
}
}
}
}
}
}
Component {
id: subMenuComp
SubMenu {}
}
}

View File

@@ -1,25 +0,0 @@
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
Item {
id: root
required property ShellScreen screen
property alias currentName: content.currentName
property alias currentCenter: content.currentCenter
property alias hasCurrent: content.hasCurrent
visible: width > 0 && height > 0
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
Content {
id: content
screen: root.screen
}
}

View File

@@ -1,69 +0,0 @@
import QtQuick
import QtQuick.Shapes
import "root:/config"
import "root:/services"
ShapePath {
id: root
required property Wrapper wrapper
readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1
fillColor: Config.border.colour
PathArc {
relativeX: root.rounding
relativeY: root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
}
PathLine {
relativeX: 0
relativeY: root.wrapper.height - root.roundingY * 2
}
PathArc {
relativeX: root.rounding
relativeY: root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: root.wrapper.width - root.rounding * 2
relativeY: 0
}
PathArc {
relativeX: root.rounding
relativeY: -root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: 0
relativeY: -(root.wrapper.height - root.roundingY * 2)
}
PathArc {
relativeX: root.rounding
relativeY: -root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
}
Behavior on fillColor {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}

View File

@@ -1,123 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Widgets
import QtQuick
Item {
id: root
required property PersistentProperties visibilities
readonly property real nonAnimWidth: view.implicitWidth + viewWrapper.anchors.margins * 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
implicitWidth: nonAnimWidth
implicitHeight: tabs.implicitHeight + tabs.anchors.topMargin + view.implicitHeight + viewWrapper.anchors.margins * 2
Tabs {
id: tabs
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: Appearance.padding.normal
anchors.margins: Appearance.padding.large
nonAnimWidth: root.nonAnimWidth
currentIndex: view.currentIndex
}
ClippingRectangle {
id: viewWrapper
anchors.top: tabs.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: Appearance.padding.large
radius: Appearance.rounding.normal
color: "transparent"
Flickable {
id: view
readonly property int currentIndex: tabs.currentIndex
readonly property Item currentItem: row.children[currentIndex]
anchors.fill: parent
flickableDirection: Flickable.HorizontalFlick
implicitWidth: currentItem.implicitWidth
implicitHeight: currentItem.implicitHeight
contentX: currentItem.x
contentWidth: row.implicitWidth
contentHeight: row.implicitHeight
onContentXChanged: {
if (!moving)
return;
const x = contentX - currentItem.x;
if (x > currentItem.implicitWidth / 2)
tabs.bar.incrementCurrentIndex();
else if (x < -currentItem.implicitWidth / 2)
tabs.bar.decrementCurrentIndex();
}
onDragEnded: {
const x = contentX - currentItem.x;
if (x > currentItem.implicitWidth / 10)
tabs.bar.incrementCurrentIndex();
else if (x < -currentItem.implicitWidth / 10)
tabs.bar.decrementCurrentIndex();
else
contentX = Qt.binding(() => currentItem.x);
}
Row {
id: row
Dash {
shouldUpdate: visible && this === view.currentItem
}
Media {
shouldUpdate: visible && this === view.currentItem
visibilities: root.visibilities
}
Performance {}
}
Behavior on contentX {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}

View File

@@ -1,86 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import "dash"
import QtQuick.Layouts
GridLayout {
id: root
required property bool shouldUpdate
rowSpacing: Appearance.spacing.normal
columnSpacing: Appearance.spacing.normal
Rect {
Layout.column: 2
Layout.columnSpan: 3
Layout.preferredWidth: user.implicitWidth
Layout.preferredHeight: user.implicitHeight
User {
id: user
}
}
Rect {
Layout.row: 0
Layout.columnSpan: 2
Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
Layout.fillHeight: true
Weather {}
}
Rect {
Layout.row: 1
Layout.preferredWidth: dateTime.implicitWidth
Layout.fillHeight: true
DateTime {
id: dateTime
}
}
Rect {
Layout.row: 1
Layout.column: 1
Layout.columnSpan: 3
Layout.fillWidth: true
Layout.preferredHeight: calendar.implicitHeight
Calendar {
id: calendar
}
}
Rect {
Layout.row: 1
Layout.column: 4
Layout.preferredWidth: resources.implicitWidth
Layout.fillHeight: true
Resources {
id: resources
}
}
Rect {
Layout.row: 0
Layout.column: 5
Layout.rowSpan: 2
Layout.preferredWidth: media.implicitWidth
Layout.fillHeight: true
Media {
id: media
shouldUpdate: root.shouldUpdate
}
}
component Rect: StyledRect {
radius: Appearance.rounding.small
color: Colours.palette.m3surfaceContainer
}
}

View File

@@ -1,594 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Mpris
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
Item {
id: root
required property bool shouldUpdate
required property PersistentProperties visibilities
property real playerProgress: {
const active = Players.active;
return active?.length ? active.position / active.length : 0;
}
function lengthStr(length: int): string {
if (length < 0)
return "-1:-1";
return `${Math.floor(length / 60)}:${Math.floor(length % 60).toString().padStart(2, "0")}`;
}
implicitWidth: cover.implicitWidth + Config.dashboard.sizes.mediaVisualiserSize * 2 + details.implicitWidth + details.anchors.leftMargin + bongocat.implicitWidth + bongocat.anchors.leftMargin * 2 + Appearance.padding.large * 2
implicitHeight: Math.max(cover.implicitHeight + Config.dashboard.sizes.mediaVisualiserSize * 2, details.implicitHeight, bongocat.implicitHeight) + Appearance.padding.large * 2
Behavior on playerProgress {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: Players.active?.positionChanged()
}
Connections {
target: Cava
function onValuesChanged(): void {
if (root.shouldUpdate)
visualiser.requestPaint();
}
}
Canvas {
id: visualiser
readonly property real centerX: width / 2
readonly property real centerY: height / 2
readonly property real innerX: cover.implicitWidth / 2 + Appearance.spacing.small
readonly property real innerY: cover.implicitHeight / 2 + Appearance.spacing.small
property color colour: Colours.palette.m3primary
anchors.fill: cover
anchors.margins: -Config.dashboard.sizes.mediaVisualiserSize
onColourChanged: requestPaint()
onPaint: {
const ctx = getContext("2d");
ctx.reset();
const values = Cava.values;
const len = values.length;
ctx.strokeStyle = colour;
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round";
const size = Config.dashboard.sizes.mediaVisualiserSize;
const cx = centerX;
const cy = centerY;
const rx = innerX + ctx.lineWidth / 2;
const ry = innerY + ctx.lineWidth / 2;
for (let i = 0; i < len; i++) {
const v = Math.max(1, Math.min(100, values[i]));
const angle = i * 2 * Math.PI / len;
const magnitude = v / 100 * size;
const cos = Math.cos(angle);
const sin = Math.sin(angle);
ctx.moveTo(cx + rx * cos, cy + ry * sin);
ctx.lineTo(cx + (rx + magnitude) * cos, cy + (ry + magnitude) * sin);
}
ctx.stroke();
}
Behavior on colour {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
StyledClippingRect {
id: cover
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.large + Config.dashboard.sizes.mediaVisualiserSize
implicitWidth: Config.dashboard.sizes.mediaCoverArtSize
implicitHeight: Config.dashboard.sizes.mediaCoverArtSize
color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full
MaterialIcon {
anchors.centerIn: parent
text: "art_track"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: (parent.width * 0.4) || 1
}
Image {
id: image
anchors.fill: parent
source: Players.active?.trackArtUrl ?? ""
asynchronous: true
fillMode: Image.PreserveAspectCrop
sourceSize.width: width
sourceSize.height: height
}
}
Column {
id: details
anchors.verticalCenter: parent.verticalCenter
anchors.left: visualiser.right
anchors.leftMargin: Appearance.spacing.normal
spacing: Appearance.spacing.small
StyledText {
id: title
anchors.horizontalCenter: parent.horizontalCenter
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.normal
width: parent.implicitWidth
elide: Text.ElideRight
}
StyledText {
id: album
anchors.horizontalCenter: parent.horizontalCenter
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album")
color: Colours.palette.m3outline
font.pointSize: Appearance.font.size.small
width: parent.implicitWidth
elide: Text.ElideRight
}
StyledText {
id: artist
anchors.horizontalCenter: parent.horizontalCenter
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackArtist ?? qsTr("No media")) || qsTr("Unknown artist")
color: Colours.palette.m3secondary
width: parent.implicitWidth
elide: Text.ElideRight
}
Row {
id: controls
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
Control {
icon: "skip_previous"
canUse: Players.active?.canGoPrevious ?? false
function onClicked(): void {
Players.active?.previous();
}
}
Control {
icon: Players.active?.isPlaying ? "pause" : "play_arrow"
canUse: Players.active?.canTogglePlaying ?? false
primary: true
function onClicked(): void {
Players.active?.togglePlaying();
}
}
Control {
icon: "skip_next"
canUse: Players.active?.canGoNext ?? false
function onClicked(): void {
Players.active?.next();
}
}
}
Slider {
id: slider
implicitWidth: controls.implicitWidth * 1.5
implicitHeight: Appearance.padding.normal * 3
value: root.playerProgress
onMoved: {
const active = Players.active;
if (active?.canSeek && active?.positionSupported)
active.position = value * active.length;
}
background: Item {
StyledRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.topMargin: slider.implicitHeight / 3
anchors.bottomMargin: slider.implicitHeight / 3
implicitWidth: slider.handle.x - slider.implicitHeight / 6
color: Colours.palette.m3primary
radius: Appearance.rounding.full
topRightRadius: slider.implicitHeight / 15
bottomRightRadius: slider.implicitHeight / 15
}
StyledRect {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.topMargin: slider.implicitHeight / 3
anchors.bottomMargin: slider.implicitHeight / 3
implicitWidth: parent.width - slider.handle.x - slider.handle.implicitWidth - slider.implicitHeight / 6
color: Colours.palette.m3surfaceContainer
radius: Appearance.rounding.full
topLeftRadius: slider.implicitHeight / 15
bottomLeftRadius: slider.implicitHeight / 15
}
}
handle: StyledRect {
id: rect
x: slider.visualPosition * slider.availableWidth
implicitWidth: slider.implicitHeight / 4.5
implicitHeight: slider.implicitHeight
color: Colours.palette.m3primary
radius: Appearance.rounding.full
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onPressed: event => event.accepted = false
}
}
}
Item {
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: Math.max(position.implicitHeight, length.implicitHeight)
StyledText {
id: position
anchors.left: parent.left
text: root.lengthStr(Players.active?.position ?? -1)
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.small
}
StyledText {
id: length
anchors.right: parent.right
text: root.lengthStr(Players.active?.length ?? -1)
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.small
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
Control {
icon: "flip_to_front"
canUse: Players.active?.canRaise ?? false
fontSize: Appearance.font.size.larger
padding: Appearance.padding.small
fill: false
color: Colours.palette.m3surfaceContainer
function onClicked(): void {
Players.active?.raise();
root.visibilities.dashboard = false;
}
}
MouseArea {
id: playerSelector
property bool expanded
anchors.verticalCenter: parent.verticalCenter
implicitWidth: slider.implicitWidth / 2
implicitHeight: currentPlayer.implicitHeight + Appearance.padding.small * 2
cursorShape: Qt.PointingHandCursor
onClicked: expanded = !expanded
RectangularShadow {
anchors.fill: playerSelectorBg
opacity: playerSelector.expanded ? 1 : 0
radius: playerSelectorBg.radius
color: Colours.palette.m3shadow
blur: 5
spread: 0
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
StyledRect {
id: playerSelectorBg
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
implicitHeight: playersWrapper.implicitHeight + Appearance.padding.small * 2
color: Colours.palette.m3secondaryContainer
radius: Appearance.rounding.normal
Item {
id: playersWrapper
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: Appearance.padding.small
clip: true
implicitHeight: playerSelector.expanded && Players.list.length > 1 ? players.implicitHeight : currentPlayer.implicitHeight
Column {
id: players
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
spacing: Appearance.spacing.small
Repeater {
model: Players.list.filter(p => p !== Players.active)
Row {
id: player
required property MprisPlayer modelData
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
IconImage {
id: playerIcon
source: Icons.getAppIcon(player.modelData.identity, "image-missing")
implicitSize: Math.round(identity.implicitHeight * 0.9)
}
StyledText {
id: identity
text: identityMetrics.elidedText
color: Colours.palette.m3onSecondaryContainer
TextMetrics {
id: identityMetrics
text: player.modelData.identity
font.family: identity.font.family
font.pointSize: identity.font.pointSize
elide: Text.ElideRight
elideWidth: playerSelector.implicitWidth - playerIcon.implicitWidth - player.spacing - Appearance.padding.smaller * 2
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Players.manualActive = player.modelData;
playerSelector.expanded = false;
}
}
}
}
}
Item {
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: 1
StyledRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: -Appearance.padding.normal
color: Colours.palette.m3secondary
implicitHeight: 1
}
}
Row {
id: currentPlayer
anchors.horizontalCenter: parent.horizontalCenter
spacing: Appearance.spacing.small
IconImage {
id: currentIcon
source: Icons.getAppIcon(Players.active?.identity ?? "", "multimedia-player")
implicitSize: Math.round(currentIdentity.implicitHeight * 0.9)
}
StyledText {
id: currentIdentity
animate: true
text: currentIdentityMetrics.elidedText
color: Colours.palette.m3onSecondaryContainer
TextMetrics {
id: currentIdentityMetrics
text: Players.active?.identity ?? "No players"
font.family: currentIdentity.font.family
font.pointSize: currentIdentity.font.pointSize
elide: Text.ElideRight
elideWidth: playerSelector.implicitWidth - currentIcon.implicitWidth - currentPlayer.spacing - Appearance.padding.smaller * 2
}
}
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}
}
}
Control {
icon: "delete"
canUse: Players.active?.canQuit ?? false
fontSize: Appearance.font.size.larger
padding: Appearance.padding.small
fill: false
color: Colours.palette.m3surfaceContainer
function onClicked(): void {
Players.active?.quit();
}
}
}
}
Item {
id: bongocat
anchors.verticalCenter: parent.verticalCenter
anchors.left: details.right
anchors.leftMargin: Appearance.spacing.normal
implicitWidth: visualiser.width
implicitHeight: visualiser.height
AnimatedImage {
anchors.centerIn: parent
width: visualiser.width * 0.75
height: visualiser.height * 0.75
playing: root.shouldUpdate && (Players.active?.isPlaying ?? false)
speed: BeatDetector.bpm / 300
source: "root:/assets/bongocat.gif"
asynchronous: true
fillMode: AnimatedImage.PreserveAspectFit
}
}
component Control: StyledRect {
id: control
required property string icon
required property bool canUse
property int fontSize: Appearance.font.size.extraLarge
property int padding
property bool fill: true
property bool primary
function onClicked(): void {
}
implicitWidth: Math.max(icon.implicitWidth, icon.implicitHeight) + padding * 2
implicitHeight: implicitWidth
radius: Appearance.rounding.full
color: primary && canUse ? Colours.palette.m3primary : "transparent"
StateLayer {
disabled: !control.canUse
radius: parent.radius
color: control.primary ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
function onClicked(): void {
control.onClicked();
}
}
MaterialIcon {
id: icon
anchors.centerIn: parent
anchors.verticalCenterOffset: font.pointSize * 0.05
animate: true
fill: control.fill ? 1 : 0
text: control.icon
color: control.canUse ? control.primary ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface : Colours.palette.m3outline
font.pointSize: control.fontSize
}
}
}

View File

@@ -1,230 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Row {
id: root
spacing: Appearance.spacing.large * 3
padding: Appearance.padding.large
leftPadding: padding * 2
rightPadding: padding * 3
Resource {
value1: Math.min(1, SystemUsage.gpuTemp / 90)
value2: SystemUsage.gpuPerc
label1: `${Math.ceil(SystemUsage.gpuTemp)}°C`
label2: `${Math.round(SystemUsage.gpuPerc * 100)}%`
sublabel1: qsTr("GPU temp")
sublabel2: qsTr("Usage")
}
Resource {
primary: true
value1: Math.min(1, SystemUsage.cpuTemp / 90)
value2: SystemUsage.cpuPerc
label1: `${Math.ceil(SystemUsage.cpuTemp)}°C`
label2: `${Math.round(SystemUsage.cpuPerc * 100)}%`
sublabel1: qsTr("CPU temp")
sublabel2: qsTr("Usage")
}
Resource {
value1: SystemUsage.memPerc
value2: SystemUsage.storagePerc
label1: {
const fmt = SystemUsage.formatKib(SystemUsage.memUsed);
return `${+fmt.value.toFixed(1)}${fmt.unit}`;
}
label2: {
const fmt = SystemUsage.formatKib(SystemUsage.storageUsed);
return `${Math.floor(fmt.value)}${fmt.unit}`;
}
sublabel1: qsTr("Memory")
sublabel2: qsTr("Storage")
}
component Resource: Item {
id: res
required property real value1
required property real value2
required property string sublabel1
required property string sublabel2
required property string label1
required property string label2
property bool primary
readonly property real primaryMult: primary ? 1.2 : 1
readonly property real thickness: Config.dashboard.sizes.resourceProgessThickness * primaryMult
property color fg1: Colours.palette.m3primary
property color fg2: Colours.palette.m3secondary
property color bg1: Colours.palette.m3primaryContainer
property color bg2: Colours.palette.m3secondaryContainer
anchors.verticalCenter: parent.verticalCenter
implicitWidth: Config.dashboard.sizes.resourceSize * primaryMult
implicitHeight: Config.dashboard.sizes.resourceSize * primaryMult
onValue1Changed: canvas.requestPaint()
onValue2Changed: canvas.requestPaint()
onFg1Changed: canvas.requestPaint()
onFg2Changed: canvas.requestPaint()
onBg1Changed: canvas.requestPaint()
onBg2Changed: canvas.requestPaint()
Column {
anchors.centerIn: parent
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: res.label1
font.pointSize: Appearance.font.size.extraLarge * res.primaryMult
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: res.sublabel1
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.smaller * res.primaryMult
}
}
Column {
anchors.horizontalCenter: parent.right
anchors.top: parent.verticalCenter
anchors.horizontalCenterOffset: -res.thickness / 2
anchors.topMargin: res.thickness / 2 + Appearance.spacing.small
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: res.label2
font.pointSize: Appearance.font.size.smaller * res.primaryMult
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
text: res.sublabel2
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.small * res.primaryMult
}
}
Canvas {
id: canvas
readonly property real centerX: width / 2
readonly property real centerY: height / 2
readonly property real arc1Start: degToRad(45)
readonly property real arc1End: degToRad(220)
readonly property real arc2Start: degToRad(230)
readonly property real arc2End: degToRad(360)
function degToRad(deg: int): real {
return deg * Math.PI / 180;
}
anchors.fill: parent
onPaint: {
const ctx = getContext("2d");
ctx.reset();
ctx.lineWidth = res.thickness;
ctx.lineCap = "round";
const radius = (Math.min(width, height) - ctx.lineWidth) / 2;
const cx = centerX;
const cy = centerY;
const a1s = arc1Start;
const a1e = arc1End;
const a2s = arc2Start;
const a2e = arc2End;
ctx.beginPath();
ctx.arc(cx, cy, radius, a1s, a1e, false);
ctx.strokeStyle = res.bg1;
ctx.stroke();
ctx.beginPath();
ctx.arc(cx, cy, radius, a1s, (a1e - a1s) * res.value1 + a1s, false);
ctx.strokeStyle = res.fg1;
ctx.stroke();
ctx.beginPath();
ctx.arc(cx, cy, radius, a2s, a2e, false);
ctx.strokeStyle = res.bg2;
ctx.stroke();
ctx.beginPath();
ctx.arc(cx, cy, radius, a2s, (a2e - a2s) * res.value2 + a2s, false);
ctx.strokeStyle = res.fg2;
ctx.stroke();
}
}
Behavior on value1 {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on value2 {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on fg1 {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on fg2 {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on bg1 {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on bg2 {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}

View File

@@ -1,250 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell.Widgets
import QtQuick
import QtQuick.Controls
Item {
id: root
required property real nonAnimWidth
property alias currentIndex: bar.currentIndex
readonly property TabBar bar: bar
implicitHeight: bar.implicitHeight + indicator.implicitHeight + indicator.anchors.topMargin + separator.implicitHeight
TabBar {
id: bar
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
background: null
Tab {
iconName: "dashboard"
text: qsTr("Dashboard")
}
Tab {
iconName: "queue_music"
text: qsTr("Media")
}
Tab {
iconName: "speed"
text: qsTr("Performance")
}
// Tab {
// iconName: "workspaces"
// text: qsTr("Workspaces")
// }
}
Item {
id: indicator
anchors.top: bar.bottom
anchors.topMargin: Config.dashboard.sizes.tabIndicatorSpacing
implicitWidth: bar.currentItem.implicitWidth
implicitHeight: Config.dashboard.sizes.tabIndicatorHeight
x: {
const tab = bar.currentItem;
const width = (root.nonAnimWidth - Config.dashboard.sizes.tabIndicatorSpacing * (bar.count - 1) * 2) / bar.count;
return width * tab.TabBar.index + (width - tab.implicitWidth) / 2;
}
clip: true
StyledRect {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: parent.implicitHeight * 2
color: Colours.palette.m3primary
radius: Appearance.rounding.full
}
Behavior on x {
Anim {}
}
Behavior on implicitWidth {
Anim {}
}
}
StyledRect {
id: separator
anchors.top: indicator.bottom
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: 1
color: Colours.palette.m3outlineVariant
}
component Tab: TabButton {
id: tab
required property string iconName
readonly property bool current: TabBar.tabBar.currentItem === this
background: null
contentItem: MouseArea {
id: mouse
implicitWidth: Math.max(icon.width, label.width)
implicitHeight: icon.height + label.height
cursorShape: Qt.PointingHandCursor
onPressed: ({
x,
y
}) => {
tab.TabBar.tabBar.setCurrentIndex(tab.TabBar.index);
const stateY = stateWrapper.y;
rippleAnim.x = x;
rippleAnim.y = y - stateY;
const dist = (ox, oy) => ox * ox + oy * oy;
const stateEndY = stateY + stateWrapper.height;
rippleAnim.radius = Math.sqrt(Math.max(dist(0, stateY), dist(0, stateEndY), dist(width, stateY), dist(width, stateEndY)));
rippleAnim.restart();
}
onWheel: event => {
if (event.angleDelta.y < 0)
tab.TabBar.tabBar.incrementCurrentIndex();
else if (event.angleDelta.y > 0)
tab.TabBar.tabBar.decrementCurrentIndex();
}
SequentialAnimation {
id: rippleAnim
property real x
property real y
property real radius
PropertyAction {
target: ripple
property: "x"
value: rippleAnim.x
}
PropertyAction {
target: ripple
property: "y"
value: rippleAnim.y
}
PropertyAction {
target: ripple
property: "opacity"
value: 0.1
}
ParallelAnimation {
Anim {
target: ripple
properties: "implicitWidth,implicitHeight"
from: 0
to: rippleAnim.radius * 2
duration: Appearance.anim.durations.large
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
Anim {
target: ripple
property: "opacity"
to: 0
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
}
ClippingRectangle {
id: stateWrapper
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
implicitHeight: parent.height + Config.dashboard.sizes.tabIndicatorSpacing * 2
color: "transparent"
radius: Appearance.rounding.small
StyledRect {
id: stateLayer
anchors.fill: parent
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurface
opacity: mouse.pressed ? 0.1 : tab.hovered ? 0.08 : 0
Behavior on opacity {
Anim {}
}
}
StyledRect {
id: ripple
radius: Appearance.rounding.full
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurface
opacity: 0
transform: Translate {
x: -ripple.width / 2
y: -ripple.height / 2
}
}
}
MaterialIcon {
id: icon
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: label.top
text: tab.iconName
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
fill: tab.current ? 1 : 0
font.pointSize: Appearance.font.size.large
Behavior on fill {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
StyledText {
id: label
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
text: tab.text
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
}
}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}

View File

@@ -1,55 +0,0 @@
import QtQuick
import Quickshell
import "root:/config"
Item {
id: root
required property PersistentProperties visibilities
visible: height > 0
implicitHeight: 0
implicitWidth: content.implicitWidth
states: State {
name: "visible"
when: root.visibilities.dashboard
PropertyChanges {
root.implicitHeight: content.implicitHeight
}
}
transitions: [
Transition {
from: ""
to: "visible"
NumberAnimation {
target: root
property: "implicitHeight"
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
}
},
Transition {
from: "visible"
to: ""
NumberAnimation {
target: root
property: "implicitHeight"
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
]
Content {
id: content
visibilities: root.visibilities
}
}

View File

@@ -1,72 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Controls
Column {
id: root
anchors.left: parent.left
anchors.right: parent.right
padding: Appearance.padding.large
spacing: Appearance.spacing.small
DayOfWeekRow {
id: days
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: parent.padding
delegate: StyledText {
required property var model
horizontalAlignment: Text.AlignHCenter
text: model.shortName
font.family: Appearance.font.family.sans
font.weight: 500
}
}
MonthGrid {
id: grid
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: parent.padding
spacing: 3
delegate: Item {
id: day
required property var model
implicitWidth: implicitHeight
implicitHeight: text.implicitHeight + Appearance.padding.small * 2
StyledRect {
anchors.centerIn: parent
implicitWidth: parent.implicitHeight
implicitHeight: parent.implicitHeight
radius: Appearance.rounding.full
color: model.today ? Colours.palette.m3primary : "transparent"
StyledText {
id: text
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
text: grid.locale.toString(day.model.date, "d")
color: day.model.today ? Colours.palette.m3onPrimary : day.model.month === grid.month ? Colours.palette.m3onSurfaceVariant : Colours.palette.m3outline
}
}
}
}
}

View File

@@ -1,71 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Item {
id: root
anchors.top: parent.top
anchors.bottom: parent.bottom
implicitWidth: Config.dashboard.sizes.dateTimeWidth
StyledText {
id: hours
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: (root.height - (hours.implicitHeight + sep.implicitHeight + sep.anchors.topMargin + mins.implicitHeight + mins.anchors.topMargin + date.implicitHeight + date.anchors.topMargin)) / 2
horizontalAlignment: Text.AlignHCenter
text: Time.format("HH")
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
}
StyledText {
id: sep
anchors.left: parent.left
anchors.right: parent.right
anchors.top: hours.bottom
anchors.topMargin: -font.pointSize * 0.5
horizontalAlignment: Text.AlignHCenter
text: "•••"
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.extraLarge * 0.9
}
StyledText {
id: mins
anchors.left: parent.left
anchors.right: parent.right
anchors.top: sep.bottom
anchors.topMargin: -sep.font.pointSize * 0.45
horizontalAlignment: Text.AlignHCenter
text: Time.format("mm")
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
}
StyledText {
id: date
anchors.left: parent.left
anchors.right: parent.right
anchors.top: mins.bottom
anchors.topMargin: Appearance.spacing.normal
horizontalAlignment: Text.AlignHCenter
text: Time.format("ddd, d")
color: Colours.palette.m3tertiary
font.pointSize: Appearance.font.size.normal
font.weight: 500
}
}

View File

@@ -1,262 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Io
import Quickshell.Widgets
import QtQuick
import QtQuick.Shapes
Item {
id: root
required property bool shouldUpdate
property real playerProgress: {
const active = Players.active;
return active?.length ? active.position / active.length : 0;
}
anchors.top: parent.top
anchors.bottom: parent.bottom
implicitWidth: Config.dashboard.sizes.mediaWidth
Behavior on playerProgress {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: Players.active?.positionChanged()
}
Shape {
preferredRendererType: Shape.CurveRenderer
ShapePath {
fillColor: "transparent"
strokeColor: Colours.palette.m3surfaceContainerHigh
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
sweepAngle: Config.dashboard.sizes.mediaProgressSweep
}
Behavior on strokeColor {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
ShapePath {
fillColor: "transparent"
strokeColor: Colours.palette.m3primary
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
sweepAngle: Config.dashboard.sizes.mediaProgressSweep * root.playerProgress
}
Behavior on strokeColor {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}
StyledClippingRect {
id: cover
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Appearance.padding.large + Config.dashboard.sizes.mediaProgressThickness + Appearance.spacing.small
implicitHeight: width
color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full
MaterialIcon {
anchors.centerIn: parent
text: "art_track"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: (parent.width * 0.4) || 1
}
Image {
id: image
anchors.fill: parent
source: Players.active?.trackArtUrl ?? ""
asynchronous: true
fillMode: Image.PreserveAspectCrop
sourceSize.width: width
sourceSize.height: height
}
}
StyledText {
id: title
anchors.top: cover.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Appearance.spacing.normal
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.normal
width: parent.implicitWidth - Appearance.padding.large * 2
elide: Text.ElideRight
}
StyledText {
id: album
anchors.top: title.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Appearance.spacing.small
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album")
color: Colours.palette.m3outline
font.pointSize: Appearance.font.size.small
width: parent.implicitWidth - Appearance.padding.large * 2
elide: Text.ElideRight
}
StyledText {
id: artist
anchors.top: album.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Appearance.spacing.small
animate: true
horizontalAlignment: Text.AlignHCenter
text: (Players.active?.trackArtist ?? qsTr("No media")) || qsTr("Unknown artist")
color: Colours.palette.m3secondary
width: parent.implicitWidth - Appearance.padding.large * 2
elide: Text.ElideRight
}
Row {
id: controls
anchors.top: artist.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Appearance.spacing.smaller
spacing: Appearance.spacing.small
Control {
icon: "skip_previous"
canUse: Players.active?.canGoPrevious ?? false
function onClicked(): void {
Players.active?.previous();
}
}
Control {
icon: Players.active?.isPlaying ? "pause" : "play_arrow"
canUse: Players.active?.canTogglePlaying ?? false
function onClicked(): void {
Players.active?.togglePlaying();
}
}
Control {
icon: "skip_next"
canUse: Players.active?.canGoNext ?? false
function onClicked(): void {
Players.active?.next();
}
}
}
AnimatedImage {
id: bongocat
anchors.top: controls.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: Appearance.spacing.small
anchors.bottomMargin: Appearance.padding.large
anchors.margins: Appearance.padding.large * 2
playing: root.shouldUpdate && (Players.active?.isPlaying ?? false)
speed: BeatDetector.bpm / 300
source: "root:/assets/bongocat.gif"
asynchronous: true
fillMode: AnimatedImage.PreserveAspectFit
}
component Control: StyledRect {
id: control
required property string icon
required property bool canUse
function onClicked(): void {
}
implicitWidth: Math.max(icon.implicitHeight, icon.implicitHeight) + Appearance.padding.small
implicitHeight: implicitWidth
StateLayer {
disabled: !control.canUse
radius: Appearance.rounding.full
function onClicked(): void {
control.onClicked();
}
}
MaterialIcon {
id: icon
anchors.centerIn: parent
anchors.verticalCenterOffset: font.pointSize * 0.05
animate: true
text: control.icon
color: control.canUse ? Colours.palette.m3onSurface : Colours.palette.m3outline
font.pointSize: Appearance.font.size.large
}
}
}

View File

@@ -1,85 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Controls
Row {
id: root
anchors.top: parent.top
anchors.bottom: parent.bottom
padding: Appearance.padding.large
spacing: Appearance.spacing.normal
Resource {
icon: "memory"
value: SystemUsage.cpuPerc
colour: Colours.palette.m3primary
}
Resource {
icon: "memory_alt"
value: SystemUsage.memPerc
colour: Colours.palette.m3secondary
}
Resource {
icon: "hard_disk"
value: SystemUsage.storagePerc
colour: Colours.palette.m3tertiary
}
component Resource: Item {
id: res
required property string icon
required property real value
required property color colour
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: Appearance.padding.large
implicitWidth: icon.implicitWidth
StyledRect {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: icon.top
anchors.bottomMargin: Appearance.spacing.small
implicitWidth: Config.dashboard.sizes.resourceProgessThickness
color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full
StyledRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
implicitHeight: res.value * parent.height
color: res.colour
radius: Appearance.rounding.full
}
}
MaterialIcon {
id: icon
anchors.bottom: parent.bottom
text: res.icon
color: res.colour
}
Behavior on value {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}

View File

@@ -1,117 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import "root:/utils"
import Quickshell
import Quickshell.Io
import QtQuick
Row {
id: root
padding: Appearance.padding.large
spacing: Appearance.spacing.normal
StyledClippingRect {
implicitWidth: info.implicitHeight
implicitHeight: info.implicitHeight
radius: Appearance.rounding.large
color: Colours.palette.m3surfaceContainerHigh
MaterialIcon {
anchors.centerIn: parent
text: "person"
fill: 1
font.pointSize: (info.implicitHeight / 2) || 1
}
CachingImage {
anchors.fill: parent
path: `${Paths.home}/.face`
}
}
Column {
id: info
anchors.verticalCenter: parent.verticalCenter
spacing: Appearance.spacing.normal
InfoLine {
icon: Icons.osIcon
text: Icons.osName
colour: Colours.palette.m3primary
}
InfoLine {
icon: "select_window_2"
text: Quickshell.env("XDG_CURRENT_DESKTOP") || Quickshell.env("XDG_SESSION_DESKTOP")
colour: Colours.palette.m3secondary
}
InfoLine {
icon: "timer"
text: uptimeProc.uptime
colour: Colours.palette.m3tertiary
Timer {
running: true
repeat: true
interval: 15000
onTriggered: uptimeProc.running = true
}
Process {
id: uptimeProc
property string uptime
running: true
command: ["uptime", "-p"]
stdout: StdioCollector {
onStreamFinished: uptimeProc.uptime = text.trim()
}
}
}
}
component InfoLine: Item {
id: line
required property string icon
required property string text
required property color colour
implicitWidth: icon.implicitWidth + text.width + text.anchors.leftMargin
implicitHeight: Math.max(icon.implicitHeight, text.implicitHeight)
MaterialIcon {
id: icon
anchors.left: parent.left
anchors.leftMargin: (Config.dashboard.sizes.infoIconSize - implicitWidth) / 2
text: line.icon
color: line.colour
font.pointSize: Appearance.font.size.normal
font.variableAxes: ({
FILL: 1
})
}
StyledText {
id: text
anchors.verticalCenter: icon.verticalCenter
anchors.left: icon.right
anchors.leftMargin: icon.anchors.leftMargin
text: `: ${line.text}`
font.pointSize: Appearance.font.size.normal
width: Config.dashboard.sizes.infoWidth
elide: Text.ElideRight
}
}
}

View File

@@ -1,63 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import "root:/utils"
import QtQuick
Item {
id: root
anchors.centerIn: parent
implicitWidth: icon.implicitWidth + info.implicitWidth + info.anchors.leftMargin
onVisibleChanged: {
if (visible)
Weather.reload();
}
MaterialIcon {
id: icon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
animate: true
text: Weather.icon || "cloud_alert"
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge * 2
font.variableAxes: ({
opsz: Appearance.font.size.extraLarge * 1.2
})
}
Column {
id: info
anchors.verticalCenter: parent.verticalCenter
anchors.left: icon.right
anchors.leftMargin: Appearance.spacing.large
spacing: Appearance.spacing.small
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: `${Weather.temperature}°C`
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
}
StyledText {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
text: Weather.description || qsTr("No weather")
elide: Text.ElideRight
width: Math.min(implicitWidth, root.parent.width - icon.implicitWidth - info.anchors.leftMargin - Appearance.padding.large * 2)
}
}
}

View File

@@ -1,66 +0,0 @@
import "root:/services"
import "root:/config"
import "root:/modules/osd" as Osd
import "root:/modules/notifications" as Notifications
import "root:/modules/session" as Session
import "root:/modules/launcher" as Launcher
import "root:/modules/dashboard" as Dashboard
import "root:/modules/bar/popouts" as BarPopouts
import QtQuick
import QtQuick.Shapes
Shape {
id: root
required property Panels panels
required property Item bar
anchors.fill: parent
anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth
preferredRendererType: Shape.CurveRenderer
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
Osd.Background {
wrapper: panels.osd
startX: root.width - panels.session.width
startY: (root.height - wrapper.height) / 2 - rounding
}
Notifications.Background {
wrapper: panels.notifications
startX: root.width
startY: 0
}
Session.Background {
wrapper: panels.session
startX: root.width
startY: (root.height - wrapper.height) / 2 - rounding
}
Launcher.Background {
wrapper: panels.launcher
startX: (root.width - wrapper.width) / 2 - rounding
startY: root.height
}
Dashboard.Background {
wrapper: panels.dashboard
startX: (root.width - wrapper.width) / 2 - rounding
startY: 0
}
BarPopouts.Background {
wrapper: panels.popouts
invertBottomRounding: wrapper.y + wrapper.height + 1 >= root.height
startX: 0
startY: wrapper.y - rounding
}
}

View File

@@ -1,47 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
import QtQuick.Effects
Item {
id: root
required property Item bar
anchors.fill: parent
StyledRect {
id: rect
anchors.fill: parent
color: Colours.alpha(Config.border.colour, false)
visible: false
}
Item {
id: mask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
anchors.margins: Config.border.thickness
anchors.leftMargin: root.bar.implicitWidth
radius: Config.border.rounding
}
}
MultiEffect {
anchors.fill: parent
maskEnabled: true
maskInverted: true
maskSource: mask
source: rect
maskThresholdMin: 0.5
maskSpreadAtMin: 1
}
}

View File

@@ -1,147 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import "root:/modules/bar"
import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
import QtQuick
import QtQuick.Effects
Variants {
model: Quickshell.screens
Scope {
id: scope
required property ShellScreen modelData
Exclusions {
screen: scope.modelData
bar: bar
}
StyledWindow {
id: win
screen: scope.modelData
name: "drawers"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
mask: Region {
x: bar.implicitWidth
y: Config.border.thickness
width: win.width - bar.implicitWidth - Config.border.thickness
height: win.height - Config.border.thickness * 2
intersection: Intersection.Xor
regions: regions.instances
}
anchors.top: true
anchors.bottom: true
anchors.left: true
anchors.right: true
Variants {
id: regions
model: panels.children
Region {
required property Item modelData
x: modelData.x + bar.implicitWidth
y: modelData.y + Config.border.thickness
width: modelData.width
height: modelData.height
intersection: Intersection.Subtract
}
}
HyprlandFocusGrab {
active: visibilities.launcher || visibilities.session
windows: [win]
onCleared: {
visibilities.launcher = false;
visibilities.session = false;
}
}
StyledRect {
anchors.fill: parent
opacity: visibilities.session ? 0.5 : 0
color: Colours.palette.m3scrim
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
Item {
id: background
anchors.fill: parent
visible: false
Border {
bar: bar
}
Backgrounds {
panels: panels
bar: bar
}
}
MultiEffect {
anchors.fill: source
source: background
shadowEnabled: true
blurMax: 15
shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
}
PersistentProperties {
id: visibilities
property bool osd
property bool session
property bool launcher
property bool dashboard
Component.onCompleted: Visibilities.screens[scope.modelData] = this
}
Interactions {
screen: scope.modelData
popouts: panels.popouts
visibilities: visibilities
panels: panels
bar: bar
Panels {
id: panels
screen: scope.modelData
visibilities: visibilities
bar: bar
}
}
Bar {
id: bar
screen: scope.modelData
popouts: panels.popouts
}
}
}
}

View File

@@ -1,37 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/config"
import Quickshell
import QtQuick
Scope {
id: root
required property ShellScreen screen
required property Item bar
ExclusionZone {
anchors.left: true
exclusiveZone: root.bar.implicitWidth
}
ExclusionZone {
anchors.top: true
}
ExclusionZone {
anchors.right: true
}
ExclusionZone {
anchors.bottom: true
}
component ExclusionZone: StyledWindow {
screen: root.screen
name: "border-exclusion"
exclusiveZone: Config.border.thickness
mask: Region {}
}
}

View File

@@ -1,160 +0,0 @@
import "root:/services"
import "root:/config"
import "root:/modules/bar/popouts" as BarPopouts
import "root:/modules/osd" as Osd
import Quickshell
import QtQuick
MouseArea {
id: root
required property ShellScreen screen
required property BarPopouts.Wrapper popouts
required property PersistentProperties visibilities
required property Panels panels
required property Item bar
property bool osdHovered
property point dragStart
property bool dashboardShortcutActive
property bool osdShortcutActive
function withinPanelHeight(panel: Item, x: real, y: real): bool {
const panelY = Config.border.thickness + panel.y;
return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
}
function inRightPanel(panel: Item, x: real, y: real): bool {
return x > bar.implicitWidth + panel.x && withinPanelHeight(panel, x, y);
}
function inTopPanel(panel: Item, x: real, y: real): bool {
const panelX = bar.implicitWidth + panel.x;
return y < Config.border.thickness + panel.y + panel.height && x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding;
}
anchors.fill: parent
hoverEnabled: true
onPressed: event => dragStart = Qt.point(event.x, event.y)
onContainsMouseChanged: {
if (!containsMouse) {
// Only hide if not activated by shortcut
if (!osdShortcutActive) {
visibilities.osd = false;
osdHovered = false;
}
if (!dashboardShortcutActive) {
visibilities.dashboard = false;
}
popouts.hasCurrent = false;
}
}
onPositionChanged: ({
x,
y
}) => {
// Show osd on hover
const showOsd = inRightPanel(panels.osd, x, y);
// Always update visibility based on hover if not in shortcut mode
if (!osdShortcutActive) {
visibilities.osd = showOsd;
osdHovered = showOsd;
} else if (showOsd) {
// If hovering over OSD area while in shortcut mode, transition to hover control
osdShortcutActive = false;
osdHovered = true;
}
// Show/hide session on drag
if (pressed && withinPanelHeight(panels.session, x, y)) {
const dragX = x - dragStart.x;
if (dragX < -Config.session.dragThreshold)
visibilities.session = true;
else if (dragX > Config.session.dragThreshold)
visibilities.session = false;
}
// Show dashboard on hover
const showDashboard = inTopPanel(panels.dashboard, x, y);
// Always update visibility based on hover if not in shortcut mode
if (!dashboardShortcutActive) {
visibilities.dashboard = showDashboard;
} else if (showDashboard) {
// If hovering over dashboard area while in shortcut mode, transition to hover control
dashboardShortcutActive = false;
}
// Show popouts on hover
const popout = panels.popouts;
if (x < bar.implicitWidth + popout.width) {
if (x < bar.implicitWidth)
// Handle like part of bar
bar.checkPopout(y);
else
// Keep on hover
popouts.hasCurrent = withinPanelHeight(popout, x, y);
} else
popouts.hasCurrent = false;
}
// Monitor individual visibility changes
Connections {
target: root.visibilities
function onLauncherChanged() {
// If launcher is hidden, clear shortcut flags for dashboard and OSD
if (!root.visibilities.launcher) {
root.dashboardShortcutActive = false;
root.osdShortcutActive = false;
// Also hide dashboard and OSD if they're not being hovered
const inDashboardArea = root.inTopPanel(root.panels.dashboard, root.mouseX, root.mouseY);
const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY);
if (!inDashboardArea) {
root.visibilities.dashboard = false;
}
if (!inOsdArea) {
root.visibilities.osd = false;
root.osdHovered = false;
}
}
}
function onDashboardChanged() {
if (root.visibilities.dashboard) {
// Dashboard became visible, immediately check if this should be shortcut mode
const inDashboardArea = root.inTopPanel(root.panels.dashboard, root.mouseX, root.mouseY);
if (!inDashboardArea) {
root.dashboardShortcutActive = true;
}
} else {
// Dashboard hidden, clear shortcut flag
root.dashboardShortcutActive = false;
}
}
function onOsdChanged() {
if (root.visibilities.osd) {
// OSD became visible, immediately check if this should be shortcut mode
const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY);
if (!inOsdArea) {
root.osdShortcutActive = true;
}
} else {
// OSD hidden, clear shortcut flag
root.osdShortcutActive = false;
}
}
}
Osd.Interactions {
screen: root.screen
visibilities: root.visibilities
hovered: root.osdHovered
}
}

View File

@@ -1,93 +0,0 @@
import "root:/services"
import "root:/config"
import "root:/modules/osd" as Osd
import "root:/modules/notifications" as Notifications
import "root:/modules/session" as Session
import "root:/modules/launcher" as Launcher
import "root:/modules/dashboard" as Dashboard
import "root:/modules/bar/popouts" as BarPopouts
import Quickshell
import QtQuick
Item {
id: root
required property ShellScreen screen
required property PersistentProperties visibilities
required property Item bar
readonly property Osd.Wrapper osd: osd
readonly property Notifications.Wrapper notifications: notifications
readonly property Session.Wrapper session: session
readonly property Launcher.Wrapper launcher: launcher
readonly property Dashboard.Wrapper dashboard: dashboard
readonly property BarPopouts.Wrapper popouts: popouts
anchors.fill: parent
anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth
Component.onCompleted: Visibilities.panels[screen] = this
Osd.Wrapper {
id: osd
clip: root.visibilities.session
screen: root.screen
visibility: root.visibilities.osd
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: session.width
}
Notifications.Wrapper {
id: notifications
anchors.top: parent.top
anchors.right: parent.right
}
Session.Wrapper {
id: session
visibilities: root.visibilities
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
}
Launcher.Wrapper {
id: launcher
visibilities: root.visibilities
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
}
Dashboard.Wrapper {
id: dashboard
visibilities: root.visibilities
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
}
BarPopouts.Wrapper {
id: popouts
screen: root.screen
anchors.left: parent.left
anchors.verticalCenter: parent.top
anchors.verticalCenterOffset: {
const off = root.popouts.currentCenter - Config.border.thickness;
const diff = root.height - Math.floor(off + implicitHeight / 2);
if (diff < 0)
return off + diff;
return off;
}
}
}

View File

@@ -1,69 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
Item {
id: root
required property Actions.Action modelData
required property var list
implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left
anchors.right: parent?.right
StateLayer {
radius: Appearance.rounding.full
function onClicked(): void {
root.modelData?.onClicked(root.list);
}
}
Item {
anchors.fill: parent
anchors.leftMargin: Appearance.padding.larger
anchors.rightMargin: Appearance.padding.larger
anchors.margins: Appearance.padding.smaller
MaterialIcon {
id: icon
text: root.modelData?.icon ?? ""
font.pointSize: Appearance.font.size.extraLarge
anchors.verticalCenter: parent.verticalCenter
}
Item {
anchors.left: icon.right
anchors.leftMargin: Appearance.spacing.larger
anchors.verticalCenter: icon.verticalCenter
implicitWidth: parent.width - icon.width
implicitHeight: name.implicitHeight + desc.implicitHeight
StyledText {
id: name
text: root.modelData?.name ?? ""
font.pointSize: Appearance.font.size.normal
}
StyledText {
id: desc
text: root.modelData?.desc ?? ""
font.pointSize: Appearance.font.size.small
color: Colours.alpha(Colours.palette.m3outline, true)
elide: Text.ElideRight
width: root.width - icon.width - Appearance.rounding.normal * 2
anchors.top: name.bottom
}
}
}
}

View File

@@ -1,152 +0,0 @@
pragma Singleton
import "root:/utils/scripts/fuzzysort.js" as Fuzzy
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
id: root
readonly property list<Action> list: [
Action {
name: qsTr("Scheme")
desc: qsTr("Change the current colour scheme")
icon: "palette"
function onClicked(list: AppList): void {
root.autocomplete(list, "scheme");
}
},
Action {
name: qsTr("Wallpaper")
desc: qsTr("Change the current wallpaper")
icon: "image"
function onClicked(list: AppList): void {
root.autocomplete(list, "wallpaper");
}
},
Action {
name: qsTr("Variant")
desc: qsTr("Change the current scheme variant")
icon: "colors"
function onClicked(list: AppList): void {
root.autocomplete(list, "variant");
}
},
Action {
name: qsTr("Transparency")
desc: qsTr("Change shell transparency")
icon: "opacity"
function onClicked(list: AppList): void {
root.autocomplete(list, "transparency");
}
},
Action {
name: qsTr("Light")
desc: qsTr("Change the scheme to light mode")
icon: "light_mode"
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Colours.setMode("light");
}
},
Action {
name: qsTr("Dark")
desc: qsTr("Change the scheme to dark mode")
icon: "dark_mode"
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Colours.setMode("dark");
}
},
Action {
name: qsTr("Shutdown")
desc: qsTr("Shutdown the system")
icon: "power_settings_new"
disabled: !Config.launcher.enableDangerousActions
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["systemctl", "poweroff"]);
}
},
Action {
name: qsTr("Reboot")
desc: qsTr("Reboot the system")
icon: "cached"
disabled: !Config.launcher.enableDangerousActions
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["systemctl", "reboot"]);
}
},
Action {
name: qsTr("Logout")
desc: qsTr("Log out of the current session")
icon: "exit_to_app"
disabled: !Config.launcher.enableDangerousActions
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["sh", "-c", "(uwsm stop | grep -q 'Compositor is not running' && loginctl terminate-user $USER) || uwsm stop"]);
}
},
Action {
name: qsTr("Lock")
desc: qsTr("Lock the current session")
icon: "lock"
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["loginctl", "lock-session"]);
}
},
Action {
name: qsTr("Sleep")
desc: qsTr("Suspend then hibernate")
icon: "bedtime"
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["systemctl", "suspend-then-hibernate"]);
}
}
]
readonly property list<var> preppedActions: list.filter(a => !a.disabled).map(a => ({
name: Fuzzy.prepare(a.name),
desc: Fuzzy.prepare(a.desc),
action: a
}))
function fuzzyQuery(search: string): var {
return Fuzzy.go(search.slice(Config.launcher.actionPrefix.length), preppedActions, {
all: true,
keys: ["name", "desc"],
scoreFn: r => r[0].score > 0 ? r[0].score * 0.9 + r[1].score * 0.1 : 0
}).map(r => r.obj.action);
}
function autocomplete(list: AppList, text: string): void {
list.search.text = `${Config.launcher.actionPrefix}${text} `;
}
component Action: QtObject {
required property string name
required property string desc
required property string icon
property bool disabled
function onClicked(list: AppList): void {
}
}
}

View File

@@ -1,72 +0,0 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import Quickshell.Widgets
import QtQuick
Item {
id: root
required property DesktopEntry modelData
required property PersistentProperties visibilities
implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left
anchors.right: parent?.right
StateLayer {
radius: Appearance.rounding.full
function onClicked(): void {
Apps.launch(root.modelData);
root.visibilities.launcher = false;
}
}
Item {
anchors.fill: parent
anchors.leftMargin: Appearance.padding.larger
anchors.rightMargin: Appearance.padding.larger
anchors.margins: Appearance.padding.smaller
IconImage {
id: icon
source: Quickshell.iconPath(root.modelData?.icon, "image-missing")
implicitSize: parent.height * 0.8
anchors.verticalCenter: parent.verticalCenter
}
Item {
anchors.left: icon.right
anchors.leftMargin: Appearance.spacing.normal
anchors.verticalCenter: icon.verticalCenter
implicitWidth: parent.width - icon.width
implicitHeight: name.implicitHeight + comment.implicitHeight
StyledText {
id: name
text: root.modelData?.name ?? ""
font.pointSize: Appearance.font.size.normal
}
StyledText {
id: comment
text: (root.modelData?.comment || root.modelData?.genericName || root.modelData?.name) ?? ""
font.pointSize: Appearance.font.size.small
color: Colours.alpha(Colours.palette.m3outline, true)
elide: Text.ElideRight
width: root.width - icon.width - Appearance.rounding.normal * 2
anchors.top: name.bottom
}
}
}
}

View File

@@ -1,199 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
import QtQuick.Controls
ListView {
id: root
required property TextField search
required property PersistentProperties visibilities
property bool isAction: search.text.startsWith(Config.launcher.actionPrefix)
property bool isScheme: search.text.startsWith(`${Config.launcher.actionPrefix}scheme `)
property bool isVariant: search.text.startsWith(`${Config.launcher.actionPrefix}variant `)
function getModelValues() {
let text = search.text;
if (isScheme)
return Schemes.fuzzyQuery(text);
if (isVariant)
return M3Variants.fuzzyQuery(text);
if (isAction)
return Actions.fuzzyQuery(text);
if (text.startsWith(Config.launcher.actionPrefix))
text = search.text.slice(Config.launcher.actionPrefix.length);
return Apps.fuzzyQuery(text);
}
model: ScriptModel {
values: root.getModelValues()
onValuesChanged: root.currentIndex = 0
}
spacing: Appearance.spacing.small
orientation: Qt.Vertical
implicitHeight: (Config.launcher.sizes.itemHeight + spacing) * Math.min(Config.launcher.maxShown, count) - spacing
highlightMoveDuration: Appearance.anim.durations.normal
highlightResizeDuration: 0
highlight: StyledRect {
radius: Appearance.rounding.full
color: Colours.palette.m3onSurface
opacity: 0.08
}
delegate: {
if (isScheme)
return schemeItem;
if (isVariant)
return variantItem;
if (isAction)
return actionItem;
return appItem;
}
ScrollBar.vertical: StyledScrollBar {}
add: Transition {
Anim {
properties: "opacity,scale"
from: 0
to: 1
}
}
remove: Transition {
Anim {
properties: "opacity,scale"
from: 1
to: 0
}
}
move: Transition {
Anim {
property: "y"
}
Anim {
properties: "opacity,scale"
to: 1
}
}
addDisplaced: Transition {
Anim {
property: "y"
duration: Appearance.anim.durations.small
}
Anim {
properties: "opacity,scale"
to: 1
}
}
displaced: Transition {
Anim {
property: "y"
}
Anim {
properties: "opacity,scale"
to: 1
}
}
Component {
id: appItem
AppItem {
visibilities: root.visibilities
}
}
Component {
id: actionItem
ActionItem {
list: root
}
}
Component {
id: schemeItem
SchemeItem {
list: root
}
}
Component {
id: variantItem
VariantItem {
list: root
}
}
Behavior on isAction {
ChangeAnim {}
}
Behavior on isScheme {
ChangeAnim {}
}
Behavior on isVariant {
ChangeAnim {}
}
component ChangeAnim: SequentialAnimation {
ParallelAnimation {
Anim {
target: root
property: "opacity"
from: 1
to: 0
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.standardAccel
}
Anim {
target: root
property: "scale"
from: 1
to: 0.9
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.standardAccel
}
}
PropertyAction {}
ParallelAnimation {
Anim {
target: root
property: "opacity"
from: 0
to: 1
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
Anim {
target: root
property: "scale"
from: 0.9
to: 1
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}

View File

@@ -1,63 +0,0 @@
import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Shapes
ShapePath {
id: root
required property Wrapper wrapper
readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1
fillColor: Config.border.colour
PathArc {
relativeX: root.rounding
relativeY: -root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: 0
relativeY: -(root.wrapper.height - root.roundingY * 2)
}
PathArc {
relativeX: root.rounding
relativeY: -root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
}
PathLine {
relativeX: root.wrapper.width - root.rounding * 2
relativeY: 0
}
PathArc {
relativeX: root.rounding
relativeY: root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
}
PathLine {
relativeX: 0
relativeY: root.wrapper.height - root.roundingY * 2
}
PathArc {
relativeX: root.rounding
relativeY: root.roundingY
radiusX: root.rounding
radiusY: Math.min(root.rounding, root.wrapper.height)
direction: PathArc.Counterclockwise
}
Behavior on fillColor {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}

View File

@@ -1,168 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
Item {
id: root
required property PersistentProperties visibilities
readonly property int padding: Appearance.padding.large
readonly property int rounding: Appearance.rounding.large
implicitWidth: listWrapper.width + padding * 2
implicitHeight: searchWrapper.height + listWrapper.height + padding * 2
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
Item {
id: listWrapper
implicitWidth: list.width
implicitHeight: list.height + root.padding
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: searchWrapper.top
anchors.bottomMargin: root.padding
ContentList {
id: list
visibilities: root.visibilities
search: search
padding: root.padding
rounding: root.rounding
}
}
StyledRect {
id: searchWrapper
color: Colours.alpha(Colours.palette.m3surfaceContainer, true)
radius: Appearance.rounding.full
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: root.padding
implicitHeight: Math.max(searchIcon.implicitHeight, search.implicitHeight, clearIcon.implicitHeight)
MaterialIcon {
id: searchIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: root.padding
text: "search"
color: Colours.palette.m3onSurfaceVariant
}
StyledTextField {
id: search
anchors.left: searchIcon.right
anchors.right: clearIcon.left
anchors.leftMargin: Appearance.spacing.small
anchors.rightMargin: Appearance.spacing.small
topPadding: Appearance.padding.larger
bottomPadding: Appearance.padding.larger
placeholderText: qsTr("Type \"%1\" for commands").arg(Config.launcher.actionPrefix)
background: null
onAccepted: {
const currentItem = list.currentList?.currentItem;
if (currentItem) {
if (list.showWallpapers) {
Wallpapers.setWallpaper(currentItem.modelData.path);
root.visibilities.launcher = false;
} else if (text.startsWith(Config.launcher.actionPrefix)) {
currentItem.modelData.onClicked(list.currentList);
} else {
Apps.launch(currentItem.modelData);
root.visibilities.launcher = false;
}
}
}
Keys.onUpPressed: list.currentList?.decrementCurrentIndex()
Keys.onDownPressed: list.currentList?.incrementCurrentIndex()
Keys.onEscapePressed: root.visibilities.launcher = false
Connections {
target: root.visibilities
function onLauncherChanged(): void {
if (root.visibilities.launcher)
search.forceActiveFocus();
else {
search.text = "";
const current = list.currentList;
if (current)
current.currentIndex = 0;
}
}
}
}
MaterialIcon {
id: clearIcon
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: root.padding
width: search.text ? implicitWidth : implicitWidth / 2
opacity: {
if (!search.text)
return 0;
if (mouse.pressed)
return 0.7;
if (mouse.hovered)
return 0.8;
return 1;
}
text: "close"
color: Colours.palette.m3onSurfaceVariant
MouseArea {
id: mouse
property bool hovered
anchors.fill: parent
hoverEnabled: true
cursorShape: search.text ? Qt.PointingHandCursor : undefined
onEntered: hovered = true
onExited: hovered = false
onClicked: search.text = ""
}
Behavior on width {
NumberAnimation {
duration: Appearance.anim.durations.small
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.small
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}
}

View File

@@ -1,189 +0,0 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
import QtQuick.Controls
Item {
id: root
required property PersistentProperties visibilities
required property TextField search
required property int padding
required property int rounding
readonly property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `)
property var currentList
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
clip: true
state: showWallpapers ? "wallpapers" : "apps"
states: [
State {
name: "apps"
PropertyChanges {
root.currentList: appList.item
root.implicitWidth: Config.launcher.sizes.itemWidth
root.implicitHeight: Math.max(empty.implicitHeight, appList.implicitHeight)
appList.active: true
}
AnchorChanges {
anchors.left: root.parent.left
anchors.right: root.parent.right
}
},
State {
name: "wallpapers"
PropertyChanges {
root.currentList: wallpaperList.item
root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth, wallpaperList.implicitWidth)
root.implicitHeight: Config.launcher.sizes.wallpaperHeight
wallpaperList.active: true
}
}
]
transitions: Transition {
SequentialAnimation {
NumberAnimation {
target: root
property: "opacity"
from: 1
to: 0
duration: Appearance.anim.durations.small
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
PropertyAction {
targets: [appList, wallpaperList]
properties: "active"
}
ParallelAnimation {
NumberAnimation {
target: root
properties: "implicitWidth,implicitHeight"
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
NumberAnimation {
target: root
property: "opacity"
from: 0
to: 1
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
}
Loader {
id: appList
active: false
asynchronous: true
anchors.left: parent.left
anchors.right: parent.right
sourceComponent: AppList {
search: root.search
visibilities: root.visibilities
}
}
Loader {
id: wallpaperList
active: false
asynchronous: true
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
sourceComponent: WallpaperList {
search: root.search
visibilities: root.visibilities
}
}
Item {
id: empty
opacity: root.currentList?.count === 0 ? 1 : 0
scale: root.currentList?.count === 0 ? 1 : 0.5
implicitWidth: icon.width + text.width + Appearance.spacing.small
implicitHeight: icon.height
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
MaterialIcon {
id: icon
text: "manage_search"
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.extraLarge
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
id: text
anchors.left: icon.right
anchors.leftMargin: Appearance.spacing.small
anchors.verticalCenter: parent.verticalCenter
text: qsTr("No results")
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.larger
font.weight: 500
}
Behavior on opacity {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on scale {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasizedDecel
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasizedDecel
}
}
}

View File

@@ -1,91 +0,0 @@
pragma Singleton
import "root:/utils/scripts/fuzzysort.js" as Fuzzy
import "root:/config"
import Quickshell
import QtQuick
Singleton {
id: root
readonly property list<Variant> list: [
Variant {
variant: "vibrant"
icon: "sentiment_very_dissatisfied"
name: "Vibrant"
description: "A high chroma palette. The primary palette's chroma is at maximum."
},
Variant {
variant: "tonalspot"
icon: "android"
name: "Tonal Spot"
description: "Default for Material theme colours. A pastel palette with a low chroma."
},
Variant {
variant: "expressive"
icon: "compare_arrows"
name: "Expressive"
description: "A medium chroma palette. The primary palette's hue is different from the seed colour, for variety."
},
Variant {
variant: "fidelity"
icon: "compare"
name: "Fidelity"
description: "Matches the seed colour, even if the seed colour is very bright (high chroma)."
},
Variant {
variant: "content"
icon: "sentiment_calm"
name: "Content"
description: "Almost identical to fidelity."
},
Variant {
variant: "fruitsalad"
icon: "nutrition"
name: "Fruit Salad"
description: "A playful theme - the seed colour's hue does not appear in the theme."
},
Variant {
variant: "rainbow"
icon: "looks"
name: "Rainbow"
description: "A playful theme - the seed colour's hue does not appear in the theme."
},
Variant {
variant: "neutral"
icon: "contrast"
name: "Neutral"
description: "Close to grayscale, a hint of chroma."
},
Variant {
variant: "monochrome"
icon: "filter_b_and_w"
name: "Monochrome"
description: "All colours are grayscale, no chroma."
}
]
readonly property list<var> preppedVariants: list.map(v => ({
name: Fuzzy.prepare(v.variant),
variant: v
}))
function fuzzyQuery(search: string): var {
return Fuzzy.go(search.slice(`${Config.launcher.actionPrefix}variant `.length), preppedVariants, {
all: true,
key: "name"
}).map(r => r.obj.variant);
}
component Variant: QtObject {
required property string variant
required property string icon
required property string name
required property string description
function onClicked(list: AppList): void {
list.visibilities.launcher = false;
Quickshell.execDetached(["caelestia", "scheme", "set", "-v", variant]);
}
}
}

Some files were not shown because too many files have changed in this diff Show More