Skip to content

Commit

Permalink
feat: go back to OG 2022 rice
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed Feb 24, 2024
1 parent c089f18 commit 257b5bb
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 461 deletions.
1 change: 1 addition & 0 deletions home/packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{pkgs, ...}: {
nixpkgs.config.allowUnfree = false;
home.packages = with pkgs; [
waybar
ledger-live-desktop
ledger_agent
tdesktop
Expand Down
1 change: 1 addition & 0 deletions home/rice/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
./dunst.nix
./gtk.nix
./hyprland
./waybar
];
}
2 changes: 1 addition & 1 deletion home/rice/foot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
uri-characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+=\"'()[]";
};
colors = with theme.colors; {
alpha = "1.0";
alpha = "0.75";
foreground = text;
background = base;

Expand Down
16 changes: 1 addition & 15 deletions home/rice/hyprland/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ in {

decoration = {
# fancy corners
rounding = 0;
rounding = 7;

# blur
blur = {
Expand Down Expand Up @@ -141,20 +141,6 @@ in {
"eDP-1,1920x1080,0x0,1"
"DP-2,1920x1080@144,0x-1080,1"
];
"plugin:borders-plus-plus" = {
add_borders = 1; # 0 - 9

# you can add up to 9 borders
"col.border_1" = "rgb(${theme.colors.base})";
"col.border_2" = "rgb(${theme.colors.base})";

# -1 means "default" as in the one defined in general:border_size
border_size_1 = 10;
border_size_2 = -1;

# makes outer edges match rounding of the parent. Turn on / off to better understand. Default = on.
natural_rounding = "yes";
};
};
};
}
10 changes: 0 additions & 10 deletions home/rice/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ in {
"systemctl --user start hyprland-session.target"
];
};
plugins = with inputs.hyprland-plugins.packages.${pkgs.system}; [
(borders-plus-plus.overrideAttrs (_: {
patchPhase = ''
runHook prePatch
sed -i '/addNotification/d' main.cpp
sed -i '/CColor/d' main.cpp
runHook postPatch
'';
}))
];
};

services = {
Expand Down
282 changes: 97 additions & 185 deletions home/rice/waybar/default.nix
Original file line number Diff line number Diff line change
@@ -1,219 +1,131 @@
{
pkgs,
lib,
config,
theme,
...
}: let
mullvad-status =
pkgs.writeShellScriptBin "mullvad-status"
''
#!/bin/sh
mullvad status | awk '{print $1;}'
{ pkgs, lib, ... }:
with lib;
let
waybar-wttr = pkgs.stdenv.mkDerivation {
name = "waybar-wttr";
buildInputs = [
(pkgs.python39.withPackages
(pythonPackages: with pythonPackages; [ requests ]))
];
unpackPhase = "true";
installPhase = ''
mkdir -p $out/bin
cp ${./waybar-wttr.py} $out/bin/waybar-wttr
chmod +x $out/bin/waybar-wttr
'';
};

in {
xdg.configFile."waybar/style.css".text = import ./style.nix {inherit theme;};
programs.waybar = {
enable = true;
package = pkgs.waybar;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 38;
spacing = 6;
fixed-center = false;
margin-left = null;
margin-top = null;
margin-bottom = null;
margin-right = null;
exclusive = true;
modules-left = [
"custom/search"
"hyprland/workspaces"
"custom/lock"
"backlight"
"battery"
];
modules-right = ["cpu" "memory" "custom/weather" "pulseaudio" "network" "clock" "custom/power"];
"hyprland/workspaces" = {

xdg.configFile."waybar/style.css".text = import ./style.nix;
home.packages = [ waybar-wttr ];
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "left";
width = 57;
spacing = 7;
modules-left = [
"custom/search"
"hyprland/workspaces"
"custom/lock"
"custom/weather"
"backlight"
"battery"
];
modules-center = [ ];
modules-right = [ "pulseaudio" "network" "clock" "custom/power" ];
"hyprland/workspaces" = {
on-click = "activate";
format = "{icon}";
active-only = false;
format-icons = {
"1" = "󰪃";
"2" = "󰩾";
"3" = "󰪁";
"4" = "󰪂";
"5" = "󰪇";
"6" = "󰪆";
"7" = "󰩽";
"8" = "󰩿";
"9" = "󰪄";
"10" = "󰪈";
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = "";
};

persistent_workspaces = {
"*" = 5;
};
};
"custom/search" = {
format = " ";
tooltip = false;
on-click = "sh -c 'run-as-service $(tofi-drun)'";
};
};
"custom/search" = {
format = " ";
tooltip = false;
on-click = "killall rofi || rofi -show drun";
};

"custom/weather" = let
weather = pkgs.stdenv.mkDerivation {
name = "waybar-wttr";
buildInputs = [
(pkgs.python39.withPackages
(pythonPackages: with pythonPackages; [requests pyquery]))
];
unpackPhase = "true";
installPhase = ''
mkdir -p $out/bin
cp ${./weather.py} $out/bin/weather
chmod +x $out/bin/weather
'';
"custom/weather" = {
format = "{}";
tooltip = true;
interval = 3600;
exec = "waybar-wttr";
return-type = "json";
};
in {
format = "{}";
tooltip = true;
interval = 30;
exec = "${weather}/bin/weather";
return-type = "json";
};
"custom/crypto" = let
crypto = pkgs.stdenv.mkDerivation {
name = "waybar-wttr";
buildInputs = [
(pkgs.python39.withPackages
(pythonPackages: with pythonPackages; [requests]))
];
unpackPhase = "true";
installPhase = ''
mkdir -p $out/bin
cp ${./crypto.py} $out/bin/crypto
chmod +x $out/bin/crypto
'';
"custom/lock" = {
tooltip = false;
on-click = "sh -c '(sleep 0.5s; swaylock)' & disown";
format = "";
};
in {
format = "{}";
tooltip = true;
interval = 30;
exec = "${crypto}/bin/crypto";
return-type = "json";
};
"custom/vpn" = {
format = " VPN {}";
tooltip = true;
interval = 1;
exec = "${lib.getBin mullvad-status}/mullvad-status";
};
"custom/lock" = {
tooltip = false;
on-click = "sh -c '(sleep 0.5s; ${pkgs.gtklock}/bin/gtklock)' & disown";
format = "";
};
"custom/swallow" = {
tooltip = false;
on-click = let
hyprctl = config.wayland.windowManager.hyprland.package + "/bin/hyprctl";
notify-send = pkgs.libnotify + "/bin/notify-send";
rg = pkgs.ripgrep + "/bin/rg";
in
pkgs.writeShellScript "waybar-swallow" ''
#!/bin/sh
if ${hyprctl} getoption misc:enable_swallow | ${rg}/bin/rg -q "int: 1"; then
${hyprctl} keyword misc:enable_swallow false >/dev/null &&
${notify-send} "Hyprland" "Turned off swallowing"
else
${hyprctl} keyword misc:enable_swallow true >/dev/null &&
${notify-send} "Hyprland" "Turned on swallowing"
fi
'';
format = "󰘻";
};
"custom/power" = {
tooltip = false;
# TODO
format = "󰐥";
};
clock = {
format = "{:%H:%M}";
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#f5c2e7'><b>{}</b></span>";
days = "<span color='#cdd6f4'><b>{}</b></span>";
weeks = "<span color='#cba6f7'><b>T{:%U}</b></span>";
weekdays = "<span color='#eba0ac'><b>{}</b></span>";
today = "<span color='#a6e3a1'><b><u>{}</u></b></span>";
};
actions = {
on-click-right = "mode";
on-click-forward = "tz_up";
on-click-backward = "tz_down";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
"custom/power" = {
tooltip = false;
on-click = "wlogout &";
format = "";
};
};
backlight = {
format = "{icon} {percent}%";
format-icons = ["" "" "" "" "" "" "" "" ""];
};
memory = {
interval = 2;
format = " {}%";
max-length = 10;
};
cpu = {
interval = 2;
format = "󰍛 {}%";
max-length = 10;
};
battery = {
clock = {
format = ''
{:%H
%M}'';
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
backlight = {
format = "{icon}";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}% 󱐋{power}";
format-charging = "󰚥{icon} {capacity}% 󱐋{power}";
format-alt = "{icon} {capacity}%";
format = "{icon}";
format-charging = "{icon}\n󰚥";
tooltip-format = "{timeTo} {capacity}% 󱐋{power}";
format-icons = ["󰂃" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
network = let
nm-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
in {
format-wifi = "󰤨 {signalStrength}%";
format-ethernet = "󰈀";
format-alt = "󱛇";
format-disconnected = "󰤭";
tooltip-format = "{ipaddr}/{ifname} via {gwaddr} ({signalStrength}%)";
on-click-right = "${nm-editor}";
};
pulseaudio = {
network = {
format-wifi = "󰤨";
format-ethernet = "󰤨";
format-alt = "󰤨";
format-disconnected = "󰤭";
tooltip-format =
"{ipaddr}/{ifname} via {gwaddr} ({signalStrength}%)";
};
pulseaudio = {
scroll-step = 5;
tooltip = true;
tooltip-format = "{volume}% {format_source}";
on-click = "${pkgs.killall}/bin/killall pavucontrol || ${pkgs.pavucontrol}/bin/pavucontrol";
format = "{icon} {volume}%";
format = " {icon}\n{volume}%";
format-bluetooth = "󰂯 {icon} {volume}%";
format-muted = "󰝟 ";
format-icons = {
default = ["" "" " "];
};
};
};

};
};
};

}
Binary file added home/rice/waybar/sakura.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 257b5bb

Please sign in to comment.