Compare commits

...

8 commits

Author SHA1 Message Date
Schrottkatze 867514362a
improve workspace selector styling 2024-09-02 22:07:47 +02:00
Schrottkatze 37a4235e5c
add gui workspace switching 2024-09-02 20:40:47 +02:00
Schrottkatze a9525ec467
add workspace monitor to bottom bar and remove waybar 2024-09-02 20:33:22 +02:00
Schrottkatze 089740ffaf
remove some unused software 2024-09-02 19:17:58 +02:00
Schrottkatze c01c5da7c4
add Departure Mono font 2024-09-02 19:14:45 +02:00
Schrottkatze e920f9c206
add frequently used programs 2024-09-02 19:08:10 +02:00
Schrottkatze 47ba1e5796
fix broken/deprecated things 2024-09-02 19:07:58 +02:00
Schrottkatze 6aab08ec9b
do more bar things 2024-09-02 19:07:19 +02:00
17 changed files with 237 additions and 81 deletions

63
Cargo.lock generated
View file

@ -109,6 +109,15 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
[[package]]
name = "bar-ws-monitor"
version = "0.1.0"
dependencies = [
"serde",
"serde_json",
"swayipc",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -782,6 +791,38 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad"
dependencies = [
"itoa",
"memchr",
"ryu",
"serde",
]
[[package]] [[package]]
name = "signal-hook" name = "signal-hook"
version = "0.3.17" version = "0.3.17"
@ -862,6 +903,28 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "swayipc"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daa5d19f881f372e225095e297072e2e3ee1c4e9e3a46cafe5f5cf70f1313f29"
dependencies = [
"serde",
"serde_json",
"swayipc-types",
]
[[package]]
name = "swayipc-types"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e487a656336f74341c70a73a289f68d9ba3cab579ba776352ea0c6cdf603fcda"
dependencies = [
"serde",
"serde_json",
"thiserror",
]
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.60" version = "2.0.60"

View file

@ -1,5 +1,5 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = [ members = [ "programs/bar-ws-monitor",
"programs/jrnl" "programs/jrnl"
] ]

View file

@ -42,8 +42,6 @@ with builtins; {
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
veracrypt
htmlq htmlq
prusa-slicer prusa-slicer
@ -62,21 +60,14 @@ with builtins; {
jdk11 jdk11
jdk jdk
libsecret libsecret
gh
nix-prefetch-scripts
fzf fzf
glab
ripgrep ripgrep
sl
lolcat
appimage-run appimage-run
git-crypt git-crypt
file file
whois whois
p7zip p7zip
file file
nmap
cmatrix
tree tree
socat socat
smartmontools smartmontools
@ -90,6 +81,10 @@ with builtins; {
libjxl libjxl
s10e-jrnl s10e-jrnl
ungoogled-chromium
scc
speedtest-rs
]; ];
}; };

View file

@ -1,17 +1,12 @@
{ {
"nodes": { "nodes": {
"crane": { "crane": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1724537630, "lastModified": 1725125250,
"narHash": "sha256-gpqINM71zp3kw5XYwUXa84ZtPnCmLLnByuFoYesT1bY=", "narHash": "sha256-CB20rDD5eHikF6mMTTJdwPP1qvyoiyyw1RDUzwIaIF8=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "3e08f4b1fc9aaede5dd511d8f5f4ef27501e49b0", "rev": "96fd12c7100e9e05fa1a0a5bd108525600ce282f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -28,11 +23,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1724567349, "lastModified": 1725258763,
"narHash": "sha256-w2G1EJlGvgRSC1OAm2147mCzlt6ZOWIiqX/TSJUgrGE=", "narHash": "sha256-7s5RfYlTljWnKGkK4hOMJCJ0sNQoLYjMxezX3Vijy/0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "71fe264f6e208831aa0e7e54ad557a283c375014", "rev": "0774f58cf1025bbb713971deecc7f07c856be6ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,11 +99,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1724401716, "lastModified": 1724856988,
"narHash": "sha256-LXTYUVhv6Kz9Iy9DxXSI0J+2/hunUj2fj0Kvw2eDarQ=", "narHash": "sha256-JBLe2CxAhG+J8+x8qmbzkGHNYmGcSiuY2QO4Zhb72lI=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "620dfceb849d6b68d41d4f7678bb4675009fef4d", "rev": "1b5295a3f3d7cccd96eed5bfd394807a4dae87fc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -124,11 +119,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724435763, "lastModified": 1725180166,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -205,11 +200,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1724224976, "lastModified": 1725103162,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -235,11 +230,11 @@
}, },
"nixpkgs-unstable-small": { "nixpkgs-unstable-small": {
"locked": { "locked": {
"lastModified": 1724558323, "lastModified": 1725274606,
"narHash": "sha256-uPXidysk1BXSayGzpxDW8JUgGvLWS+L1CTlBV3xcQB4=", "narHash": "sha256-xXINAjCR8eTmp3AxZTk/PIH9nNoFNN0OM7MUw6eB7oQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ba0c72cea47a45556ccd5bc566433bd1242a0f93", "rev": "66a352a3f27a2eb2f27e42a13c6fe245d3be2b98",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -265,11 +260,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1724480527, "lastModified": 1725191098,
"narHash": "sha256-C+roFDGk6Bn/C58NGpyt7cneLCetdRMUfFTkm3O4zWM=", "narHash": "sha256-YH0kH5CSOnAuPUB1BUzUqvnKiv5SgDhfMNjrkki9Ahk=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "74a6427861eb8d1e3b7c6090b2c2890ff4c53e0e", "rev": "779d9eee2ea403da447278a7007c9627c8878856",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -27,9 +27,6 @@
}; };
crane = { crane = {
url = "github:ipetkov/crane"; url = "github:ipetkov/crane";
inputs = {
nixpkgs.follows = "nixpkgs";
};
}; };
fenix = { fenix = {
url = "github:nix-community/fenix"; url = "github:nix-community/fenix";
@ -55,7 +52,7 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
pkgs-stable = nixpkgs-stable.legacyPackages.${system}; pkgs-stable = nixpkgs-stable.legacyPackages.${system};
pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages.${system}; pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages.${system};
crane-lib = crane.lib.${system}; crane-lib = crane.mkLib nixpkgs.legacyPackages.${system};
rs-toolchain = with fenix.packages.${system}; rs-toolchain = with fenix.packages.${system};
combine [ combine [
complete.toolchain complete.toolchain

View file

@ -42,7 +42,7 @@
systemd.services."ModemManager".wantedBy = ["multi-user.target"]; systemd.services."ModemManager".wantedBy = ["multi-user.target"];
environment.variables = { environment.variables = {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl"); VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl");
S10E_JRNL_FILE_LOC = "/home/jade/Docs/jrnl.md"; S10E_JRNL_FILE_LOC = "/home/jade/Docs/jrnl.md";
}; };

View file

@ -0,0 +1,59 @@
(defwindow bottomBar
:monitor 0
:stacking "fg"
:wm-ignore true
:exclusive true
:geometry (geometry
:width "100%"
:height "32px"
:anchor "bottom center")
(bottomBar))
(defwidget bottomBar []
(overlay
:class "bottomBar"
(centerbox
(box
:halign "start"
(workspaceWidget)
)
(box
:halign "center"
(label :text "mid")
)
(box
:halign "end"
(label :text "right")
)
)
(box
:class "lesbianFlag"
:height 1
( flagEl :flipped true :color "#D52D00")
( flagEl :flipped true :color "#EF7627")
( flagEl :flipped true :color "#FF9A56")
( flagEl :flipped true :color "#FFFFFF")
( flagEl :flipped true :color "#D162A4")
( flagEl :flipped true :color "#B55690")
( flagEl :flipped true :color "#A30262")
)
)
)
(defwidget workspaceWidget []
(box
:class "workspaces"
(for workspace in workspaces
(button
:class "${workspace.urgent ? "urgent" : ""} ${workspace.focused ? "focused" : 0}"
:onclick "swaymsg workspace ${workspace.name}"
(label :text "${workspace.name}")
)
)
)
)
(deflisten workspaces
:initial "[]"
"bar-ws-monitor"
)

View file

@ -1,7 +1,20 @@
.topbar { .topBar {
margin-bottom: 2px; margin-bottom: 2px;
} }
label { label {
font: 14pt "FiraCode Nerd Font"; font: 14pt "FiraCode Nerd Font";
} }
.workspaces button {
border: 0px;
background-color: #282828;
}
.workspaces button.urgent {
background-color: #cc241d;
}
.workspaces button.focused {
background-color: #504935;
}

View file

@ -1 +1,2 @@
(include "topBar/topBar.yuck") (include "topBar/topBar.yuck")
(include "bottomBar/bottomBar.yuck")

View file

@ -5,7 +5,6 @@
(defwindow topBar (defwindow topBar
:monitor 0 :monitor 0
:stacking "fg" :stacking "fg"
:windowtype "normal"
:wm-ignore true :wm-ignore true
:exclusive true :exclusive true
:geometry (geometry :geometry (geometry
@ -46,11 +45,11 @@
(box (box
:class "transFlag" :class "transFlag"
:height 1 :height 1
( flagEl :color "#5BCEFA") ( flagEl :flipped false :color "#5BCEFA")
( flagEl :color "#F5A9B8") ( flagEl :flipped false :color "#F5A9B8")
( flagEl :color "#FFFFFF") ( flagEl :flipped false :color "#FFFFFF")
( flagEl :color "#F5A9B8") ( flagEl :flipped false :color "#F5A9B8")
( flagEl :color "#5BCEFA") ( flagEl :flipped false :color "#5BCEFA")
) )
) )
) )

View file

@ -1,6 +1,6 @@
(defwidget flagEl [color] (defwidget flagEl [color ?flipped]
(box (box
:style "border-bottom: 3px solid ${color}" :style "border-${flipped ? "top" : "bottom"}: 3px solid ${color}"
:halign "fill" :halign "fill"
) )
) )

View file

@ -13,6 +13,7 @@
# sway = { # sway = {
# default = ["wlr"]; # default = ["wlr"];
# }; # };
config.common.default = "*";
}; };
services.swayidle = { services.swayidle = {
@ -25,22 +26,6 @@
]; ];
}; };
programs.waybar = {
enable = true;
systemd = {
enable = true;
target = "sway-session.target";
};
settings = {
interactiveBar = {
layer = "top";
position = "bottom";
modules-left = ["sway/workspaces" "sway/mode"];
modules-right = ["wlr/taskbar"];
};
};
};
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
systemd = { systemd = {
@ -79,7 +64,7 @@
}; };
startup = [ startup = [
{ {
command = "eww open topBar"; command = "eww open topBar; eww open bottomBar";
} }
{ {
command = "pkill nm-applet; sleep 1 && nm-applet"; command = "pkill nm-applet; sleep 1 && nm-applet";

View file

@ -30,14 +30,6 @@ in
./x.nix ./x.nix
]; ];
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
programs.seahorse.enable = true; programs.seahorse.enable = true;
security.pam.services.jade.enableGnomeKeyring = true; security.pam.services.jade.enableGnomeKeyring = true;
@ -124,11 +116,7 @@ in
jellyfin-media-player jellyfin-media-player
# from environment.systemPackages cleanup # from environment.systemPackages cleanup
xdotool
xorg.xwininfo
gparted gparted
# uhk-agent
cool-retro-term
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
virt-manager virt-manager
ddccontrol-db ddccontrol-db

View file

@ -14,6 +14,7 @@
libertine libertine
inter inter
b612 b612
departure-mono
]; ];
fonts.fontDir.enable = true; fonts.fontDir.enable = true;
} }

View file

@ -20,8 +20,6 @@ in
signal-desktop signal-desktop
mumble mumble
element-desktop element-desktop
# nheko
# iamb
]; ];
}; };
}; };

View file

@ -0,0 +1,9 @@
[package]
name = "bar-ws-monitor"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = { version = "1.0.209", features = [ "derive" ] }
serde_json = "1.0.127"
swayipc = "3.0.2"

View file

@ -0,0 +1,53 @@
use core::panic;
use serde::Serialize;
use swayipc::{Connection, Event, EventType, Fallible, Workspace, WorkspaceChange};
fn main() -> Fallible<()> {
let mut con = Connection::new()?;
let mut workspaces: Vec<WsData> = con
.get_workspaces()?
.into_iter()
.map(|ws| ws.into())
.collect();
println!("{}", serde_json::ser::to_string(&workspaces).unwrap());
for ev in con.subscribe([EventType::Workspace])? {
// the lazy/ugly solution!
// we create a new connection and request workspaces again and again and again
// TODO: properly handle events one by one
let mut con = Connection::new()?;
workspaces = con
.get_workspaces()?
.into_iter()
.map(|ws| ws.into())
.collect();
println!("{}", serde_json::ser::to_string(&workspaces).unwrap());
}
Ok(())
}
#[derive(Debug, Serialize)]
struct WsData {
name: String,
focused: bool,
urgent: bool,
}
impl From<Workspace> for WsData {
fn from(
Workspace {
name,
focused,
urgent,
..
}: Workspace,
) -> Self {
WsData {
name,
focused,
urgent,
}
}
}