From 43ae60d979c666ce06810998208334afd6d95278 Mon Sep 17 00:00:00 2001 From: ulve Date: Wed, 3 Jun 2026 10:05:15 +0200 Subject: [PATCH] almost usable --- config/foot/foot.ini | 2 + config/sway/config | 34 +++++---- config/waybar/config | 32 ++++++++ config/waybar/style.css | 50 +++++++++++++ configuration.nix | 2 + home.nix | 159 +++++++++++++++++++++++++++------------- 6 files changed, 212 insertions(+), 67 deletions(-) create mode 100644 config/foot/foot.ini create mode 100644 config/waybar/config create mode 100644 config/waybar/style.css diff --git a/config/foot/foot.ini b/config/foot/foot.ini new file mode 100644 index 0000000..fd19a66 --- /dev/null +++ b/config/foot/foot.ini @@ -0,0 +1,2 @@ +[main] +font=JetBrainsMono Nerd Font:size=14 diff --git a/config/sway/config b/config/sway/config index 65a85a7..67fe90a 100644 --- a/config/sway/config +++ b/config/sway/config @@ -12,6 +12,8 @@ set $menu wmenu-run exec "foot --server" +output * bg ~/Pictures/henri.jpg fill + input type:keyboard { xkb_layout "se" xkb_variant "nodeadkeys" @@ -31,6 +33,8 @@ bindsym $mod+shift+q exec wlogout bindsym $mod+Return exec $term bindsym $mod+q kill bindsym $mod+d exec $menu +bindsym $mod+space floating toggle +bindsym $mod+Shift+r reload bindsym $mod+Alt+h splith bindsym $mod+Alt+v splitv @@ -41,6 +45,11 @@ bindsym $mod+$down focus down bindsym $mod+$up focus up bindsym $mod+$right focus right +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + bindsym $mod+1 workspace number 1 bindsym $mod+2 workspace number 2 bindsym $mod+3 workspace number 3 @@ -72,20 +81,13 @@ mode "resize" { bindsym $mod+r mode "resize" gaps inner 10 -bar { - position top - - # When the status_command prints a new line to stdout, swaybar updates. - # The default just shows the current date and time. - status_command while date +'%y-%m-%d (%a w%V) %H:%M'; do sleep 1; done - - colors { - statusline $white - background $black - urgent_workspace $red $black $red - focused_workspace $black $black $red - inactive_workspace $black $black $white - } -} +exec_always pkill waybar; waybar -bindsym $mod+Shift+s exec 'grim -l 0 -g "$(slurp)" - wl-copy' +bindsym $mod+Shift+s exec 'grim -l 0 -g "$(slurp)" - | wl-copy' +bindsym $mod+Alt+s exec 'mkdir -p ~/Pictures/Screenshots && grim -l 0 -g "$(slurp)" ~/Pictures/Screenshots/$(date +"%Y-%m-%d_%H-%M-%S").png' + +exec swayidle -w \ + timeout 300 'swaylock -f -c 1a1b26' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 1a1b26' diff --git a/config/waybar/config b/config/waybar/config new file mode 100644 index 0000000..b3c057b --- /dev/null +++ b/config/waybar/config @@ -0,0 +1,32 @@ +{ + "layer": "top", + "position": "top", + "height": 24, + "modules-left": ["sway/workspaces"], + "modules-center": ["clock"], + "modules-right": ["cpu", "battery"], + + "sway/workspaces": { + "disable-scroll": true + }, + + "clock": { + "format": "{:%y-%m-%d (%a w%V) %H:%M}", + "interval": 60 + }, + + "cpu": { + "format": "CPU {usage}%", + "interval": 2 + }, + + "battery": { + "format": "󰁹 {capacity}%", + "format-charging": "󱐋 {capacity}%", + "format-full": "󰁹 FULL", + "states": { + "warning": 30, + "critical": 15 + } + } +} diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..07fb30c --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,50 @@ +* { + font-family: JetBrainsMono Nerd Font; + font-size: 13px; + border: none; + border-radius: 0; + min-height: 0; +} + +window#waybar { + background: #0a0a0a; + color: #f3eeea; +} + +#workspaces button { + color: #f3eeea; + background: transparent; + padding: 0 4px; +} + +#workspaces button.focused { + color: #cd0a00; +} + +#workspaces button:hover { + color: #cd0a00; + background: transparent; + box-shadow: none; +} + +#clock { + color: #f3eeea; +} + +#cpu { + color: #f3eeea; + padding: 0 8px; +} + +#battery { + color: #f3eeea; + padding: 0 8px; +} + +#battery.warning { + color: #cd0a00; +} + +#battery.critical { + color: #cd0a00; +} diff --git a/configuration.nix b/configuration.nix index 09b09d1..60edc17 100644 --- a/configuration.nix +++ b/configuration.nix @@ -80,6 +80,8 @@ programs.zsh.enable = true; + security.pam.services.swaylock = {}; + programs.firefox.enable = true; programs.sway = { enable = true; diff --git a/home.nix b/home.nix index 37b34a4..969cc99 100644 --- a/home.nix +++ b/home.nix @@ -1,25 +1,11 @@ {config, pkgs, ...}: { + # ── Identity ──────────────────────────────────────────────────────────────── home.username = "ulve"; home.homeDirectory = "/home/ulve"; - programs.git = { - enable = true; - settings.user.name = "ulve"; - settings.user.email = "johansson.olov@gmail.com"; - delta.enable = true; - }; - - programs.eza = { - enable = true; - enableZshIntegration = true; - git = true; - icons = "auto"; - }; - - programs.bat = { - enable = true; - }; home.stateVersion = "26.05"; + + # ── Shell ─────────────────────────────────────────────────────────────────── programs.bash = { enable = true; shellAliases = { @@ -28,26 +14,36 @@ }; }; - programs.zoxide = { - enable = true; - enableZshIntegration = true; - options = [ "--cmd z" ]; - }; - - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - programs.zsh = { enable = true; shellAliases = { n = "nvim"; rebuild = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles"; + tree = "eza --tree --level=2"; + }; + history = { + size = 10000; + save = 10000; + ignoreDups = true; + share = true; + extended = true; }; initContent = '' - bindkey "^[[A" history-search-backward - bindkey "^[[B" history-search-forward + autoload -Uz up-line-or-beginning-search down-line-or-beginning-search + zle -N up-line-or-beginning-search + zle -N down-line-or-beginning-search + bindkey "^[[A" up-line-or-beginning-search + bindkey "^[[B" down-line-or-beginning-search + bindkey "^[OA" up-line-or-beginning-search + bindkey "^[OB" down-line-or-beginning-search + + function y() { + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd + command yazi "$@" --cwd-file="$tmp" + IFS= read -r -d "" cwd < "$tmp" + [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd" + rm -f -- "$tmp" + } ''; }; @@ -95,6 +91,46 @@ }; }; + # ── CLI tools ──────────────────────────────────────────────────────────────── + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + + programs.zoxide = { + enable = true; + enableZshIntegration = true; + options = [ "--cmd z" ]; + }; + + programs.eza = { + enable = true; + enableZshIntegration = true; + git = true; + icons = "auto"; + }; + + programs.bat = { + enable = true; + }; + + home.sessionVariables = { + _ZO_FZF_OPTS = "--preview 'eza --tree --level=2 --color=always {2..}' --preview-window=right:40%"; + }; + + # ── Git ───────────────────────────────────────────────────────────────────── + programs.git = { + enable = true; + settings.user.name = "ulve"; + settings.user.email = "johansson.olov@gmail.com"; + }; + + programs.delta = { + enable = true; + enableGitIntegration = true; + }; + + # ── SSH ───────────────────────────────────────────────────────────────────── programs.ssh = { enable = true; enableDefaultConfig = false; @@ -105,38 +141,62 @@ }; }; + # ── Config files ───────────────────────────────────────────────────────────── xdg.configFile."qtile".source = ./config/qtile; xdg.configFile."nvim" = { source = config.lib.file.mkOutOfStoreSymlink "/home/ulve/nixos-dotfiles/config/dottily"; }; xdg.configFile."sway".source = ./config/sway; + xdg.configFile."waybar".source = ./config/waybar; + xdg.configFile."foot".source = ./config/foot; + # ── Packages ───────────────────────────────────────────────────────────────── home.packages = with pkgs; [ + # general claude-code # ai coding assistant + brave # browser + fastfetch # vanity + jq # json processor + powershell # yes + teams-for-linux # teams + + # desktop / wayland wl-clipboard # wayland copy utils slurp # select region in wayland for copy grim # grab images from wayland - brave # browser - fastfetch # vanity wlogout # logout menu - foot # terminal wmenu # dynamic menu + swaylock # lock screen + swayidle # idle management (dims/locks/sleeps) + waybar # status bar with left/center/right sections + + telegram-desktop # Messaging + signal-desktop # Messaging + + # terminal + foot # terminal + tmux # terminal multiplexer btop # resource monitor htop # process viewer - tmux # terminal multiplexer - neovim # editor fd # fast find alternative ripgrep # fast grep alternative - gcc # c compiler (also needed by treesitter) - nodejs # javascript runtime - powershell # yes - teams-for-linux # teams + + # file managers yazi # terminal file manager thunar # gui file manager + # editors + neovim # editor + + # compilers / runtimes + gcc # c compiler (also needed by treesitter) + nodejs # javascript runtime + go # go toolchain (needed by gopls + revive) + dotnet-sdk # .net sdk (c#) + + # nvim: lsp servers tree-sitter # parser generator (nvim) nil # language server for nix - nixpkgs-fmt # nix code formatter lua-language-server # lsp: lua pyright # lsp: python bash-language-server # lsp: bash @@ -145,21 +205,18 @@ omnisharp-roslyn # lsp: c# efm-langserver # lsp: general purpose (runs linters/formatters) + # nvim: formatters and linters + nixpkgs-fmt # formatter: nix stylua # formatter: lua - lua54Packages.luacheck # linter: lua black # formatter: python - python3Packages.flake8 # linter: python prettierd # formatter: js/ts/html/css/json (daemon) - eslint_d # linter: js/ts (daemon) fixjson # formatter: json - shellcheck # linter: bash/sh - shfmt # formatter: bash/sh gofumpt # formatter: go (stricter gofmt) - go # go toolchain (needed by gopls + revive) + shfmt # formatter: bash/sh + lua54Packages.luacheck # linter: lua + python3Packages.flake8 # linter: python + eslint_d # linter: js/ts (daemon) + shellcheck # linter: bash/sh revive # linter: go - - dotnet-sdk # .net sdk (c#) - jq # json processor ]; - -} +}