From 683bd41f4fa1b325ff70c467ff0fa39d282e0801 Mon Sep 17 00:00:00 2001 From: crurak Date: Sat, 5 Aug 2023 17:34:22 +0200 Subject: [PATCH] enable nix gc daily --- home/default.nix | 2 + home/hyprland.nix | 3 +- home/librewolf.nix | 2 +- home/waybar.nix | 429 +++++++++++++++++++++++++++++++++++++++++++ modules/default.nix | 1 + modules/nix.nix | 15 +- modules/packages.nix | 1 + modules/waybar.nix | 3 + 8 files changed, 450 insertions(+), 6 deletions(-) create mode 100644 home/waybar.nix create mode 100644 modules/waybar.nix diff --git a/home/default.nix b/home/default.nix index ca1c3c1..0301485 100644 --- a/home/default.nix +++ b/home/default.nix @@ -6,6 +6,8 @@ ./git.nix ./hyprland.nix ./kitty.nix + ./librewolf.nix ./neovim.nix + ./waybar.nix ]; } diff --git a/home/hyprland.nix b/home/hyprland.nix index 8bc7900..b85895a 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -6,7 +6,7 @@ in { general { gaps_in = 0 gaps_out = -1 - boarder_size = 0 + border_size = 0 layout = master } @@ -35,5 +35,6 @@ in { $SUPER = ${modifier}; bind = $SUPER, Q, exec, kitty + bind = $SUPER, F, exec, librewolf ''; } diff --git a/home/librewolf.nix b/home/librewolf.nix index 866c4ae..188c4ae 100644 --- a/home/librewolf.nix +++ b/home/librewolf.nix @@ -4,6 +4,6 @@ settings = { "ui.use_activity_cursor" = true; - } + }; }; } diff --git a/home/waybar.nix b/home/waybar.nix new file mode 100644 index 0000000..6deae20 --- /dev/null +++ b/home/waybar.nix @@ -0,0 +1,429 @@ +{ + + xdg.configFile."waybar/config".text = /* json */ '' + +{ + "layer": "top", + "position": "bottom", + "height": 35, + "spacing": 4, + "margin-top": 0, + "margin-bottom":0, + + // Choose the order of the modules + + "modules-left":[ "custom/launcher", "wlr/taskbar"], + "modules-center":["custom/media"], + "modules-right":["backlight", "battery", "battery#bat2", "idle_inhibitor", "custom/updater", "pulseaudio", "custom/snip", "custom/wallpaper", "tray", "clock", "custom/power"], + // Modules configuration + + "wlr/taskbar": { + "format": "{icon}", + "icon-size": 20, + "icon-theme": "Star", + "tooltip-format": "{title}", + "on-click": "activate", + "on-click-middle": "close", + "on-click-right": "minimize" + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": " {name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "sway/language": { + "format": " {}", + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "icon-size": 20, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{icon}", + "format-icons": ["", ""], + "on-click": "bash $HOME/.config/system_scripts/brightness up", + "on-click-right": "bash $HOME/.config/system_scripts/brightness down", + "on-scroll-up": "", + "on-scroll-down": "" + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "CMB1" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "Connected  ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}", + "on-click-right": "bash ~/.config/rofi/wifi_menu/rofi_wifi_menu" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon}", + "format-bluetooth": "{volume}% {icon}", + "format-bluetooth-muted": "{icon} {format_source}", + "format-muted": "{format_source}", + "format-source": "", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "bash $HOME/.config/system_scripts/volume up", + "on-click-right": "bash $HOME/.config/system_scripts/volume down", + "on-scroll-up": "", + "on-scroll-down": "" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 30, + "format-icons": { + "spotify": " ", + "default": "" + }, + "escape": true, + "exec": "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null", + "on-click": "playerctl play-pause" + }, + "custom/launcher":{ + "format": "", + "on-click": "wofi --show drun", + "on-click-right": "killall wofi" + }, + "custom/power":{ + "format": " ", + "on-click": "nwg-bar", + "on-click-right": "killall nwg-bar" + }, + "custom/updater":{ + "format": "{} Updates", + "exec": "checkupdates | wc -l", + "exec-if": "[[ $(checkupdates | wc -l) != 0 ]]", + "interval": 15, + "on-click": "alacritty -e yay -Syu" + }, + "custom/snip":{ + "format": "", + "on-click": "grimshot --notify save area $HOME/Pictures/$(zenity --entry --text 'Set filename:' --entry-text '.png')" + }, + "custom/wallpaper":{ + "format": "", + "on-click": "bash ~/.config/system_scripts/pkill_bc" + } +} + ''; + xdg.configFile."waybar/style.css".text = /* css */ '' +* { + border: none; + border-radius: 0px; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Material, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + min-height: 0; + /*border-radius: 20px;*/ + +} +window#waybar { + background-image: linear-gradient(to right, #000000 0%, #434343 51%, #000000 100%); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + + +#workspaces button { + background: #1f1f1f; + color: #ffffff; + border-radius: 20px; + +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: lightblue; + color: black; + border-bottom: 3px solid #ffffff; + +} + +#workspaces button.focused { + background: #1f1f1f; +} + +#workspaces button.focused:hover { + background: lightblue; + color: black; + border-bottom: 3px solid #ffffff; + +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#custom-launcher, +#custom-power, +#custom-wallpaper, +#custom-updater, +#custom-snip, +#taskbar, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0px 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0px; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0px; +} + +#clock { + background-color: #090909; + color: #ffffff; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + color: #ffffff; +} + +#memory { + color: #ffffff; +} + +#disk { + color: #ffffff; +} + +#backlight { + background-color: #90b1b1; +} + +#pulseaudio { + color: #ffffff; + font-size: 18px; +} + +#pulseaudio.muted { + color: red; +} + +#custom-media { + color: whitesmoke; + margin: 5px; + font-size: 13px; +} + +#custom-media.custom-spotify { + background-color: #8EC5FC; + background-image: linear-gradient(to right, #434343 0%, #000000 51%, #434343 100%); + color: whitesmoke; + margin-right: 5px; +} + +#custom-media.custom-vlc { + background-color: #8EC5FC; + background-image: linear-gradient(to right, #434343 0%, #000000 51%, #434343 100%); + color: whitesmoke; + margin-right: 5px; +} + +#custom-power{ + background-image: linear-gradient(to left, #000000 0%, #000000 51%, #434343 100%); + font-size: 20px; + margin-right: 5px; + +} + +#custom-launcher{ + background-image: linear-gradient(to right, #000000 0%, #000000 51%, #434343 100%); + font-size: 20px; + margin-left: 5px; +} + +#custom-wallpaper{ + color: white; + font-size:18px; +} + +#custom-updater { + color: white; +} + +#custom-snip { + color: white; + font-size: 20px; +} + +#taskbar{ + color: white; +} + +#temperature { + color: #ffffff; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + color: #ffffff; +} + +#tray > .passive { + -gtk-icon-effect: dim; + color: #ffffff; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + color: #ffffff; +} + +#idle_inhibitor { + font-size: 18px; + +} + +#idle_inhibitor.activated { + color: #ffffff; + +} + +#language { + color: #ffffff; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0px 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + ''; +} diff --git a/modules/default.nix b/modules/default.nix index 8b58543..7ef4e59 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,5 +12,6 @@ ./system.nix ./user.nix ./timezone.nix + ./waybar.nix ]; } diff --git a/modules/nix.nix b/modules/nix.nix index da0967e..6c0957a 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,7 +1,14 @@ { - nix.settings = { - experimental-features = "nix-command flakes"; # enable flakes - substituters = [ "https://hyprland.cachix.org" ]; # pre compiled hyprland packages - trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + nix = { + settings = { + experimental-features = "nix-command flakes"; # enable flakes + substituters = [ "https://hyprland.cachix.org" ]; # pre compiled hyprland packages + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; + gc = { + automatic= true; + dates = "daily"; + options = "--delete-older-than 2d"; + }; }; } diff --git a/modules/packages.nix b/modules/packages.nix index f55c87f..051ecec 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -2,5 +2,6 @@ environment.systemPackages = with pkgs; [ git tree + wget ]; } diff --git a/modules/waybar.nix b/modules/waybar.nix new file mode 100644 index 0000000..0385e82 --- /dev/null +++ b/modules/waybar.nix @@ -0,0 +1,3 @@ +{ + programs.waybar.enable = true; +}