From f32827833d487c13476b6b3a27bf02e04cdf340c Mon Sep 17 00:00:00 2001 From: joy Date: Tue, 2 Jul 2024 22:10:44 +0200 Subject: [PATCH] update --- flake.lock | 47 +++++++-- flake.nix | 1 + home/ags/default.nix | 8 ++ home/default.nix | 18 ++-- home/hyprland/default.nix | 213 +++++++++++++++++++------------------- home/waybar/cmus.sh | 21 ++++ home/waybar/default.nix | 91 ++++++++++++++-- home/waybar/nohup.out | 39 +++++++ 8 files changed, 313 insertions(+), 125 deletions(-) create mode 100644 home/ags/default.nix create mode 100755 home/waybar/cmus.sh create mode 100644 home/waybar/nohup.out diff --git a/flake.lock b/flake.lock index 95bdf46..424901e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "ags": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1718921313, + "narHash": "sha256-TFJah1RW5qnYW7kajjAFPAS5j/0q0R3vz9zPjrRA0Mc=", + "owner": "Aylur", + "repo": "ags", + "rev": "646d5ad073ff7f8b1d50cfbd40f5b8a250fcd59d", + "type": "github" + }, + "original": { + "owner": "Aylur", + "repo": "ags", + "type": "github" + } + }, "base16-schemes": { "flake": false, "locked": { @@ -57,15 +75,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719915469, - "narHash": "sha256-dNQPEges+os5o3SpV3gkIJk2wNX+eIzv6D48S3WxBRo=", - "owner": "nixos", + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "88d829e52cfbeee71d81704ce28f5b439f6dea16", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -85,11 +104,27 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1719915469, + "narHash": "sha256-dNQPEges+os5o3SpV3gkIJk2wNX+eIzv6D48S3WxBRo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "88d829e52cfbeee71d81704ce28f5b439f6dea16", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { + "ags": "ags", "home-manager": "home-manager", "nix-colors": "nix-colors", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index 23124ad..b00faf2 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; nix-colors.url = "github:misterio77/nix-colors"; + ags.url = "github:Aylur/ags"; home-manager = { url = "github:nix-community/home-manager"; diff --git a/home/ags/default.nix b/home/ags/default.nix new file mode 100644 index 0000000..a2e7f65 --- /dev/null +++ b/home/ags/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: + +{ + + programs.ags { + enable = true; + }; +} diff --git a/home/default.nix b/home/default.nix index 843c9cd..5eeace4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,14 +3,16 @@ { imports = [ ./rofi - ./waybar - ./alacritty - ./hyprland - ./zsh - ./gtk - ./git - inputs.nix-colors.homeManagerModules.default - ]; + ./waybar + ./alacritty + ./hyprland + ./zsh + ./gtk + ./git + ./ags + inputs.nix-colors.homeManagerModules.default + inputs.ags.homeManagerModules.default + ]; home.username = "joy"; home.homeDirectory = "/home/joy"; diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 989c54a..77907bb 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -1,5 +1,7 @@ { config, lib, pkgs, ... }: + { + home.packages = with pkgs; [ rofi-wayland pavucontrol @@ -17,125 +19,128 @@ enable = true; settings = { - "$mod" = "SUPER"; + "$mod" = "SUPER"; + dwindle = { + pseudotile = true; + preserve_split = true; + }; - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - monitor = "DP-1,2560x1440@165.00Hz,0x0,1,bitdepth,10"; + monitor = "DP-1,2560x1440@165.00Hz,0x0,1,bitdepth,10"; - env = [ - "HYPRCURSOR_THEME = Bibata-Modern-Ice" - "HYPRCURSOR_SIZE = 24" - ]; + env = [ + "HYPRCURSOR_THEME = Bibata-Modern-Ice" + "HYPRCURSOR_SIZE = 24" + ]; - exec-once = [ - "lxqt-policykit-agent &" - "swww init &" - "swww img ~/nix/home/hyprland/wallpaper.png &" - "waybar &" - "wl-paste --type text --watch cliphist store" - "wl-paste --type image --watch cliphist store" - "screen -dmS cmus cmus &" + exec-once = [ + "lxqt-policykit-agent &" + "swww init &" + "swww img ~/nix/home/hyprland/wallpaper.png &" + "waybar &" + "wl-paste --type text --watch cliphist store" + "wl-paste --type image --watch cliphist store" + "screen -dmS cmus cmus &" ]; - bind = [ + bind = [ - # launch Apps - "$mod, TAB, exec, alacritty" - "$mod, E, exec, nemo" - "$mod, S, exec, brave" - "$mod, X, exec, keepassxc" - "$mod, D, exec, alacritty -e screen -r cmus" - "$mod, F, exec, freetube" - "$mod, M, exec, thunderbird" - "$mod, C, exec, hyprpicker -a" - "$mod, A, exec, rofi -show drun" - "$mod+Shift, Z, exec, grim - | swappy -f -" - "$mod, Z, exec, sh ~/nix/home/hyprland/screen.sh" - "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + # launch Apps + "$mod, TAB, exec, alacritty" + "$mod, E, exec, nemo" + "$mod, S, exec, brave" + "$mod, X, exec, keepassxc" + "$mod, D, exec, alacritty -e screen -r cmus" + "$mod, F, exec, freetube" + "$mod, M, exec, thunderbird" + "$mod, C, exec, hyprpicker -a" + "$mod, A, exec, rofi -show drun" + "$mod+Shift, Z, exec, grim - | swappy -f -" + "$mod, Z, exec, sh ~/nix/home/hyprland/screen.sh" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" - # controles - "$mod, Q, killactive" - "$mod, W, togglefloating" - "$mod, R, togglesplit" - "$mod, L, exec, amixer -q sset Master 5%+" - "$mod, K, exec, amixer -q sset Master 5%-" - "$mod+shift, Y, exec, systemctl suspend" - "$mod+shift, M, exit, hyprland" + # controles + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, R, togglesplit" + "$mod, L, exec, amixer -q sset Master 5%+" + "$mod, K, exec, amixer -q sset Master 5%-" + "$mod+shift, Y, exec, systemctl suspend" + "$mod+shift, M, exit, hyprland" + + # cmus + "$mod, P, exec, cmus-remote --pause" + "$mod, comma, exec, cmus-remote --prev" + "$mod, period, exec, cmus-remote --next" + "$mod, equal, exec, cmus-remote -v +5%" + "$mod, minus, exec, cmus-remote -v -5%" - # mocp - "$mod, P, exec, cmus-remote --pause" - "$mod, comma, exec, cmus-remote --prev" - "$mod, period, exec, cmus-remote --next" - "$mod, equal, exec, cmus-remote -v +5%" - "$mod, minus, exec, cmus-remote -v -5%" + # Move focus + "$mod, Return, fullscreen" + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" - # Move focus with mainMod + arrow keys - "$mod, Return, fullscreen" - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" + # Switch workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" - # Switch workspaces with mainMod + [0-9] - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - "$mod+Shift, 1, movetoworkspace, 1" - "$mod+Shift, 2, movetoworkspace, 2" - "$mod+Shift, 3, movetoworkspace, 3" - "$mod+Shift, 4, movetoworkspace, 4" - "$mod+Shift, 5, movetoworkspace, 5" - "$mod+Shift, 6, movetoworkspace, 6" - "$mod+Shift, 7, movetoworkspace, 7" - "$mod+Shift, 8, movetoworkspace, 8" - "$mod+Shift, 9, movetoworkspace, 9" - "$mod+Shift, 0, movetoworkspace, 10" - ]; + # Move active window to a workspace + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + ]; - bindm= [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; + bindm= [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; - general = { - gaps_in = 1; - gaps_out = 1; - border_size = 2; - allow_tearing = false; - layout = "dwindle"; + general = { + gaps_in = 0; + gaps_out = 0; + border_size = 3; + "col.active_border" = "0xFFEBDBB2"; + "col.inactive_border" = "0xFF363537"; + allow_tearing = false; + layout = "dwindle"; + }; + + misc ={ + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + decoration = { + rounding = 0; + }; + + input = { + kb_layout = "us,de"; + kb_variant = ",qwerty"; + kb_options = "grp:alt_shift_toggle"; + }; + }; - - misc ={ - disable_hyprland_logo = true; - disable_splash_rendering = true; - }; - - decoration = { - rounding = 0; - }; - - input = { - kb_layout = "us,de"; - kb_variant = ",qwerty"; - kb_options = "grp:alt_shift_toggle"; - }; - + }; -}; + } diff --git a/home/waybar/cmus.sh b/home/waybar/cmus.sh new file mode 100755 index 0000000..ce58ec8 --- /dev/null +++ b/home/waybar/cmus.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Fetch the status of cmus +status=$(cmus-remote -Q) + +if [[ $? -ne 0 ]]; then + echo "No song playing" + exit 1 +fi + +# Extract artist, album, and title information +artist=$(echo "$status" | grep 'tag artist' | cut -d ' ' -f 3-) +title=$(echo "$status" | grep 'tag title' | cut -d ' ' -f 3-) + +# Display the song information +if [ -n "$artist" ] && [ -n "$title" ]; then + echo "$artist - $title" +else + echo "No song playing" +fi + diff --git a/home/waybar/default.nix b/home/waybar/default.nix index ceb6137..b4ebdab 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -25,7 +25,6 @@ clock = { actions = { - on-click-backward = "tz_down"; on-click-forward = "tz_up"; on-click-right = "mode"; on-scroll-down = "shift_down"; @@ -68,7 +67,7 @@ window#waybar { * Workspaces * ----------------------------------------------------- */ #workspaces { - background: #fb4934; + background: #458588; margin: 5px 3px 5px 12px; padding: 0px 1px; border-radius: 15px; @@ -83,14 +82,92 @@ window#waybar { border-radius: 15px; border: 0px; color: #15161e; - background-color: #fb4934; + background-color: #458588; opacity: 0.5; transition: all 0.3s ease-in-out; } #workspaces button.active { color: #15161e; - background: #fb4934; + +* { + border: none; + border-radius: 0px; + font-family: "Inconsolata"; + font-size: 16px; + min-height: 0; + color: #ebdbb2; +} + +window#waybar { + border-bottom-style: inset; + border-bottom: 4px solid #689d6a; + background: #1d2021; +} + +#workspaces, #clock, #custom-music, #window { + font-weight: 800; +} + +/* Workspace Buttons */ +#workspaces button label{ + color: #689d6a; +} +#workspaces button.focused label { + color: #1d2021; +} +#workspaces button.focused { + background: #689d6a; +} + +#mode { + background-color: #cc241d; + color: white; +} + +#clock, #battery, #cpu, #memory, #network, #pulseaudio, #tray, #mode, #idle_inhibitor { + padding: 0 5px; + margin: 0 10px; +} + + +#idle_inhibitor { + padding: 0 10px; +} + +#idle_inhibitor.activated { + background-color: #689d6a; + color: #1d2021; +} + + +#custom-music { + color: #b8bb26; + margin: 0 15px; + padding: 0 20px; + border-bottom: 4px solid #b8bb26; + +} + +#clock { + margin: 0; + color: #fabd2f; + border-bottom: 4px solid #fabd2f; +} + + +#network.disconnected { + color: #cc241d; + border-bottom: 4px solid #cc241d; +} + + +#pulseaudio.muted { + padding: 0 20px; + color: #cc241d; + border-bottom: 4px solid #cc241d; +} + background: #458588; border-radius: 15px; min-width: 40px; transition: all 0.3s ease-in-out; @@ -99,7 +176,7 @@ window#waybar { #workspaces button:hover { color: #15161e; - background: #fb4934; + background: #458588; border-radius: 15px; opacity: 1.0; } @@ -146,7 +223,7 @@ tooltip label { } #clock { color: #15161e; - background: #fabd2f; + background: #458588; border-radius: 15px; margin: 5px; padding: 2px 10px; @@ -194,7 +271,7 @@ tooltip label { #pulseaudio { color: #15161e; - background: #83a598; + background: #458588; border-radius: 15px; margin: 5px; padding: 2px 10px; diff --git a/home/waybar/nohup.out b/home/waybar/nohup.out new file mode 100644 index 0000000..6bdc2d2 --- /dev/null +++ b/home/waybar/nohup.out @@ -0,0 +1,39 @@ +[2024-07-02 21:51:16.844] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 21:51:16.845] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop +[2024-07-02 21:51:16.845] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 21:51:16.848] [info] Hyprland IPC starting +[2024-07-02 21:51:16.849] [info] Loading persistent workspaces from Hyprland workspace rules +sh: line 1: /home/joy/nix/home/waybar/cmus.sh: cannot execute: required file not found +[2024-07-02 21:51:16.855] [error] cmus stopped unexpectedly, is it endless? +[2024-07-02 21:51:16.867] [warning] Requested height: 14 is less than the minimum height: 27 required by the modules +[2024-07-02 21:51:16.867] [info] Bar configured (width: 2560, height: 27) for output: DP-1 +[2024-07-02 21:51:52.625] [info] Reloading... +[2024-07-02 21:51:52.628] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 21:51:52.628] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 21:51:52.633] [info] Reloading... +[2024-07-02 21:51:52.635] [info] Loading persistent workspaces from Hyprland workspace rules + +(waybar:29756): GLib-GIO-WARNING **: 21:51:52.644: Invalid id -1200428736 passed to g_bus_unwatch_name() + +(waybar:29756): GLib-GIO-CRITICAL **: 21:51:52.644: g_dbus_interface_skeleton_unexport: assertion 'interface_->priv->connections != NULL' failed +[2024-07-02 21:51:52.645] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 21:51:52.645] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 21:51:52.648] [info] Loading persistent workspaces from Hyprland workspace rules +[2024-07-02 21:51:52.655] [warning] Requested height: 14 is less than the minimum height: 37 required by the modules +[2024-07-02 21:51:52.655] [info] Bar configured (width: 2560, height: 37) for output: DP-1 +[2024-07-02 21:52:00.848] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 21:52:00.850] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop +[2024-07-02 21:52:00.850] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 21:52:00.853] [info] Hyprland IPC starting +[2024-07-02 21:52:00.854] [info] Loading persistent workspaces from Hyprland workspace rules +[2024-07-02 21:52:00.868] [warning] Requested height: 14 is less than the minimum height: 42 required by the modules +[2024-07-02 21:52:00.868] [info] Bar configured (width: 2560, height: 42) for output: DP-1 +[2024-07-02 22:00:47.199] [info] Reloading... +[2024-07-02 22:00:47.203] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 22:00:47.204] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 22:00:47.212] [info] Reloading... +[2024-07-02 22:00:47.212] [error] style.css:45:0Expected semicolon +[2024-07-02 22:01:22.256] [info] Using configuration file /home/joy/.config/waybar/config +[2024-07-02 22:01:22.257] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop +[2024-07-02 22:01:22.257] [info] Using CSS file /home/joy/.config/waybar/style.css +[2024-07-02 22:01:22.257] [error] style.css:45:0Expected semicolon