my nixos dotfiles :3 codeberg.org/koibtw/dotfiles
dotfiles neovim nixos catppuccin linux

quickshell: init; waybar: nuke

Changed files
+232 -191
doc
external
config
home
doc/preview.webp

This is a binary file and will not be displayed.

+58
external/config/quickshell/Modules/Bar/Bar.qml
··· 1 + import QtQuick 2 + import QtQuick.Layouts 3 + import Quickshell 4 + 5 + PanelWindow { 6 + anchors { 7 + top: true 8 + left: true 9 + right: true 10 + } 11 + 12 + implicitHeight: 30 13 + color: colBase 14 + 15 + Workspaces { 16 + anchors { 17 + verticalCenter: parent.verticalCenter 18 + left: parent.left 19 + leftMargin: 10 20 + } 21 + } 22 + 23 + Music { 24 + anchors.centerIn: parent 25 + } 26 + 27 + RowLayout { 28 + anchors { 29 + verticalCenter: parent.verticalCenter 30 + right: parent.right 31 + rightMargin: 10 32 + } 33 + 34 + Txt { 35 + id: timeTxt 36 + text: Qt.formatDateTime(new Date(), "hh:mm AP") 37 + 38 + Timer { 39 + interval: 10000 40 + running: true 41 + repeat: true 42 + onTriggered: timeTxt.text = Qt.formatDateTime(new Date(), "hh:mm AP") 43 + } 44 + } 45 + Spacer {} 46 + Txt { 47 + id: dateTxt 48 + text: Qt.formatDateTime(new Date(), "yyyy-MM-dd") 49 + 50 + Timer { 51 + interval: 600000 52 + running: true 53 + repeat: true 54 + onTriggered: dateTxt.text = Qt.formatDateTime(new Date(), "yyyy-MM-dd") 55 + } 56 + } 57 + } 58 + }
+45
external/config/quickshell/Modules/Bar/Music.qml
··· 1 + import QtQuick 2 + import QtQuick.Layouts 3 + import Quickshell.Io 4 + 5 + RowLayout { 6 + Txt { 7 + id: musicArtistTxt 8 + } 9 + Txt { 10 + text: if (musicArtistTxt.text !== "" && musicTitleTxt.text !== "") { 11 + " 󰎇 "; 12 + } else { 13 + ""; 14 + } 15 + color: colOverlay 16 + } 17 + Txt { 18 + id: musicTitleTxt 19 + } 20 + 21 + Process { 22 + id: musicProc 23 + running: true 24 + command: ["playerctl", "metadata", "--format", "{{ artist }} || {{ title }}"] 25 + stdout: StdioCollector { 26 + onStreamFinished: { 27 + let parts = this.text.trim().split(" || "); 28 + if (parts.length === 2) { 29 + musicArtistTxt.text = parts[0]; 30 + musicTitleTxt.text = parts[1]; 31 + } else { 32 + musicArtistTxt.text = ""; 33 + musicTitleTxt.text = ""; 34 + } 35 + } 36 + } 37 + } 38 + 39 + Timer { 40 + interval: 5000 41 + running: true 42 + repeat: true 43 + onTriggered: musicProc.running = true 44 + } 45 + }
+9
external/config/quickshell/Modules/Bar/Spacer.qml
··· 1 + import QtQuick 2 + import QtQuick.Layouts 3 + 4 + Rectangle { 5 + Layout.preferredWidth: 2 6 + Layout.preferredHeight: 20 7 + Layout.margins: 4 8 + color: colOverlay 9 + }
+7
external/config/quickshell/Modules/Bar/Txt.qml
··· 1 + import QtQuick 2 + 3 + Text { 4 + color: colText 5 + font.family: fontFamily 6 + font.pixelSize: fontSize 7 + }
+17
external/config/quickshell/Modules/Bar/Workspaces.qml
··· 1 + import QtQuick 2 + import QtQuick.Layouts 3 + 4 + RowLayout { 5 + spacing: 20 6 + Repeater { 7 + model: wmWSC 8 + Txt { 9 + text: "" 10 + color: if (index + 1 === wmWSA) { 11 + colAccent; 12 + } else { 13 + colOverlay; 14 + } 15 + } 16 + } 17 + }
+15
external/config/quickshell/Services/Niri/Niri.qml
··· 1 + import Quickshell 2 + import Quickshell.Io 3 + 4 + import "niri.mjs" as Niri 5 + 6 + Process { 7 + id: niriEventStream 8 + running: true 9 + command: ["niri", "msg", "--json", "event-stream"] 10 + stdout: SplitParser { 11 + onRead: data => { 12 + Niri.handleEvent(data, root); 13 + } 14 + } 15 + }
+6
external/config/quickshell/Services/Niri/niri.mjs
··· 1 + export const handleEvent = (evRaw, ns) => { 2 + const ev = JSON.parse(evRaw); 3 + 4 + if (ev.WorkspacesChanged) ns.wmWSC = ev.WorkspacesChanged.workspaces.filter(w => w.name).length; 5 + else if (ev.WorkspaceActivated) ns.wmWSA = ev.WorkspaceActivated.id; 6 + };
+31
external/config/quickshell/shell.qml
··· 1 + import QtQuick 2 + import Quickshell 3 + 4 + import "Modules/Bar" 5 + import "Services/Niri" 6 + 7 + ShellRoot { 8 + id: root 9 + 10 + property color colBase: "#1e1e2e" 11 + property color colText: "#cdd6f4" 12 + property color colOverlay: "#6c7086" 13 + property color colAccent: "#b4befe" 14 + property color colSecond: "#cba6f7" 15 + 16 + property string fontFamily: "FiraCode Nerd Font" 17 + property int fontSize: 14 18 + 19 + property int wmWSC 20 + property int wmWSA 21 + 22 + LazyLoader { 23 + active: true 24 + component: Niri {} 25 + } 26 + 27 + LazyLoader { 28 + active: true 29 + component: Bar {} 30 + } 31 + }
-1
flake.nix
··· 59 59 }; 60 60 61 61 mkDesktopHost = name: mkHost name [ ./modules/desktop ]; 62 - mkServerHost = name: mkHost name; 63 62 in 64 63 { 65 64 nixosConfigurations = {
+29
formatter.nix
··· 3 3 pkgs.treefmt.withConfig { 4 4 runtimeInputs = with pkgs; [ 5 5 nixfmt-rfc-style 6 + js-beautify 6 7 shfmt 8 + kdePackages.qtdeclarative 7 9 ]; 8 10 9 11 settings = { ··· 16 18 includes = [ "*.nix" ]; 17 19 }; 18 20 21 + js-beautify = { 22 + command = "js-beautify"; 23 + options = [ 24 + "--replace" 25 + "--editorconfig" 26 + "--jslint-happy" 27 + "--max-preserve-newlines" 28 + "2" 29 + ]; 30 + includes = [ 31 + "*.js" 32 + "*.mjs" 33 + "*.css" 34 + ]; 35 + }; 36 + 19 37 shfmt = { 20 38 command = "shfmt"; 21 39 options = [ "-w" ]; ··· 24 42 "*.bash" 25 43 # "*.zsh" # https://github.com/mvdan/sh/issues/120 26 44 ]; 45 + }; 46 + 47 + qmlformat = { 48 + command = "qmlformat"; 49 + options = [ 50 + "--inplace" 51 + "--sort-imports" 52 + "--indent-width" 53 + "2" 54 + ]; 55 + includes = [ "*.qml" ]; 27 56 }; 28 57 }; 29 58 };
+1 -1
home/modules/programs/default.nix
··· 14 14 ./rofi.nix 15 15 ./kitty.nix 16 16 ./dunst.nix 17 - ./waybar.nix 17 + ./quickshell.nix 18 18 19 19 ./vesktop.nix 20 20 ./chromium.nix
+6
home/modules/programs/quickshell.nix
··· 1 + { 2 + programs.quickshell = { 3 + enable = true; 4 + systemd.enable = true; 5 + }; 6 + }
-180
home/modules/programs/waybar.nix
··· 1 - { pkgs, ... }: 2 - 3 - let 4 - catppuccin = pkgs.fetchurl { 5 - url = "https://raw.githubusercontent.com/catppuccin/waybar/refs/tags/v1.1/themes/mocha.css"; 6 - sha256 = "puMFl8zIKOiYhE6wzqnffXOHn/VnKmpVDzrMJMk+3Rc="; 7 - }; 8 - in 9 - { 10 - programs.waybar = { 11 - enable = true; 12 - 13 - settings = { 14 - mainBar = { 15 - layer = "top"; 16 - position = "top"; 17 - width = 1920; 18 - 19 - modules-left = [ 20 - "hyprland/workspaces" 21 - "niri/workspaces" 22 - ]; 23 - modules-center = [ "custom/music" ]; 24 - modules-right = [ 25 - "tray" 26 - "battery" 27 - "clock" 28 - ]; 29 - 30 - "hyprland/workspaces" = { 31 - disable-scroll = true; 32 - sort-by-name = true; 33 - format = " {icon} "; 34 - format-icons = { 35 - "default" = ""; 36 - "9" = "󰓇"; 37 - "10" = ""; 38 - }; 39 - }; 40 - 41 - "niri/workspaces" = { 42 - disable-scroll = true; 43 - sort-by-name = true; 44 - persistent-only = true; 45 - persistent-workspaces = { 46 - "1" = [ ]; 47 - "2" = [ ]; 48 - "3" = [ ]; 49 - "4" = [ ]; 50 - }; 51 - format = "{icon}"; 52 - format-icons = { 53 - "default" = "  "; 54 - "social" = "  "; 55 - "5" = ""; 56 - }; 57 - }; 58 - 59 - "custom/music" = { 60 - escape = true; 61 - interval = 10; 62 - tooltop = false; 63 - exec = "playerctl metadata --format '{{ artist }}  {{ title }}'"; 64 - on-click = "playerctl play-pause"; 65 - max-length = 100; 66 - }; 67 - 68 - tray = { 69 - icon-size = 18; 70 - spacing = 10; 71 - }; 72 - 73 - battery = { 74 - states = { 75 - warning = 30; 76 - critical = 15; 77 - }; 78 - format = "{icon}"; 79 - format-charging = "󰂄"; 80 - format-plugged = "󱟢"; 81 - format-alt = "{icon}"; 82 - format-icons = [ 83 - "󰁺" 84 - "󰁻" 85 - "󰁼" 86 - "󰁽" 87 - "󰁾" 88 - "󰁿" 89 - "󰂀" 90 - "󰂁" 91 - "󰂂" 92 - "󰁹" 93 - ]; 94 - }; 95 - 96 - clock = { 97 - timezone = "Europe/Warsaw"; 98 - format = "{:%H:%M}"; 99 - tooltip-format = "<big>{:%B %d}</big>\n<tt><small>{calendar}</small></tt>"; 100 - }; 101 - }; 102 - }; 103 - 104 - style = '' 105 - @import "${catppuccin}"; 106 - 107 - * { 108 - font-family: 'Fira Code Nerd Font', monospace; 109 - font-size: 14px; 110 - border: none; 111 - border-radius: 0; 112 - min-height: 0; 113 - } 114 - 115 - #waybar { 116 - background: transparent; 117 - color: @lavender; 118 - } 119 - 120 - #workspaces { 121 - background-color: @base; 122 - border: 2px solid @lavender; 123 - } 124 - 125 - #workspaces button { 126 - padding: 5px; 127 - margin: 0; 128 - color: @lavender; 129 - } 130 - 131 - #workspaces button#niri-workspace-5 { 132 - font-size: 0px; 133 - border: none; 134 - padding: 0px; 135 - margin: 0px; 136 - min-width: 0px; 137 - min-height: 0px; 138 - } 139 - 140 - #workspaces button.active { 141 - color: @mauve; 142 - } 143 - 144 - #custom-music, 145 - #tray, 146 - #clock, 147 - #battery { 148 - border: 2px solid @lavender; 149 - background-color: @base; 150 - padding: 0 5px; 151 - } 152 - 153 - #tray { 154 - border-right: none; 155 - } 156 - 157 - #clock { 158 - border-left: none; 159 - } 160 - 161 - #battery { 162 - border-left: none; 163 - border-right: none; 164 - color: @teal; 165 - } 166 - 167 - #battery.charging { 168 - color: @teal; 169 - } 170 - 171 - #battery.warning:not(.charging) { 172 - color: @red; 173 - } 174 - 175 - #custom-music { 176 - color: @mauve; 177 - } 178 - ''; 179 - }; 180 - }
+8 -9
home/modules/programs/zsh.nix
··· 1 - { pkgs, config, ... }: 1 + { pkgs, ... }: 2 2 3 + let 4 + external = ../../../external/zsh; 5 + in 3 6 { 4 7 programs.zsh = { 5 8 enable = true; ··· 55 58 gmain = "if ! git checkout --track origin/main; then if ! git checkout main; then git checkout master; fi; fi"; 56 59 }; 57 60 58 - envExtra = '' 59 - export DOTFILES="${config.home.homeDirectory}/dotfiles" 60 - ''; 61 - 62 61 initContent = '' 63 62 export GPG_TTY=$(tty) 64 63 65 - . "$DOTFILES/external/zsh/keymap.zsh" 66 - . "$DOTFILES/external/zsh/prompt.zsh" 67 - . "$DOTFILES/external/zsh/functions.zsh" 64 + ${builtins.readFile (external + "/keymap.zsh")} 65 + ${builtins.readFile (external + "/prompt.zsh")} 66 + ${builtins.readFile (external + "/functions.zsh")} 68 67 69 68 ff 70 69 ''; 71 70 72 71 profileExtra = '' 73 - . "$DOTFILES/external/zsh/profile.zsh" 72 + ${builtins.readFile (external + "/profile.zsh")} 74 73 ''; 75 74 }; 76 75 }