From 623ac4ceabda0c94f1f59cf5bdeeaa53f4cfd165 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 10 Oct 2023 20:00:04 +0100 Subject: [PATCH] Add initial ironbar config --- home/hyprland/config.nix | 4 +- home/hyprland/default.nix | 14 +- home/hyprland/ironbar/README.org | 5 + home/hyprland/ironbar/config/color.css | 314 ++++++++++++++++++ home/hyprland/ironbar/config/config.corn | 136 ++++++++ home/hyprland/ironbar/config/config.toml.bak | 22 ++ home/hyprland/ironbar/config/scripts/battery | 15 + home/hyprland/ironbar/config/scripts/cava | 3 + .../ironbar/config/scripts/get_audio_volume | 1 + home/hyprland/ironbar/config/scripts/gtk-tray | 3 + home/hyprland/ironbar/config/scripts/mem-ad | 14 + home/hyprland/ironbar/config/scripts/memory | 3 + home/hyprland/ironbar/config/scripts/music | 273 +++++++++++++++ .../ironbar/config/scripts/music_info | 104 ++++++ home/hyprland/ironbar/config/scripts/n.sh | 35 ++ home/hyprland/ironbar/config/scripts/net | 28 ++ home/hyprland/ironbar/config/scripts/pop | 89 +++++ home/hyprland/ironbar/config/scripts/ram_info | 4 + .../ironbar/config/scripts/ram_percentage | 7 + home/hyprland/ironbar/config/scripts/sys_info | 78 +++++ .../ironbar/config/scripts/traffic.sh | 50 +++ home/hyprland/ironbar/config/scripts/vol | 3 + home/hyprland/ironbar/config/scripts/volume | 3 + .../ironbar/config/scripts/volume_icon | 5 + home/hyprland/ironbar/config/scripts/weather | 165 +++++++++ home/hyprland/ironbar/config/scripts/wifi | 26 ++ home/hyprland/ironbar/config/scripts/wlr_mode | 4 + .../ironbar/config/scripts/wlr_window | 5 + .../hyprland/ironbar/config/scripts/workspace | 90 +++++ .../ironbar/config/scripts/workspace.bak | 70 ++++ .../ironbar/config/scripts/workspace_own.sh | 66 ++++ .../ironbar/config/states/clock/state.sh | 8 + .../ironbar/config/states/internet/state.sh | 8 + .../config/states/soundbar/expand_soundbar | 9 + .../config/states/soundbar/soundbar_state | 8 + .../ironbar/config/states/title/state.sh | 8 + home/hyprland/ironbar/config/style.css | 266 +++++++++++++++ home/hyprland/ironbar/default.nix | 6 + home/hyprland/rofi/default.nix | 4 + 39 files changed, 1942 insertions(+), 14 deletions(-) create mode 100644 home/hyprland/ironbar/README.org create mode 100644 home/hyprland/ironbar/config/color.css create mode 100644 home/hyprland/ironbar/config/config.corn create mode 100644 home/hyprland/ironbar/config/config.toml.bak create mode 100755 home/hyprland/ironbar/config/scripts/battery create mode 100755 home/hyprland/ironbar/config/scripts/cava create mode 100755 home/hyprland/ironbar/config/scripts/get_audio_volume create mode 100755 home/hyprland/ironbar/config/scripts/gtk-tray create mode 100755 home/hyprland/ironbar/config/scripts/mem-ad create mode 100755 home/hyprland/ironbar/config/scripts/memory create mode 100755 home/hyprland/ironbar/config/scripts/music create mode 100755 home/hyprland/ironbar/config/scripts/music_info create mode 100755 home/hyprland/ironbar/config/scripts/n.sh create mode 100755 home/hyprland/ironbar/config/scripts/net create mode 100755 home/hyprland/ironbar/config/scripts/pop create mode 100755 home/hyprland/ironbar/config/scripts/ram_info create mode 100755 home/hyprland/ironbar/config/scripts/ram_percentage create mode 100644 home/hyprland/ironbar/config/scripts/sys_info create mode 100755 home/hyprland/ironbar/config/scripts/traffic.sh create mode 100755 home/hyprland/ironbar/config/scripts/vol create mode 100755 home/hyprland/ironbar/config/scripts/volume create mode 100755 home/hyprland/ironbar/config/scripts/volume_icon create mode 100755 home/hyprland/ironbar/config/scripts/weather create mode 100755 home/hyprland/ironbar/config/scripts/wifi create mode 100755 home/hyprland/ironbar/config/scripts/wlr_mode create mode 100755 home/hyprland/ironbar/config/scripts/wlr_window create mode 100755 home/hyprland/ironbar/config/scripts/workspace create mode 100755 home/hyprland/ironbar/config/scripts/workspace.bak create mode 100755 home/hyprland/ironbar/config/scripts/workspace_own.sh create mode 100755 home/hyprland/ironbar/config/states/clock/state.sh create mode 100755 home/hyprland/ironbar/config/states/internet/state.sh create mode 100755 home/hyprland/ironbar/config/states/soundbar/expand_soundbar create mode 100755 home/hyprland/ironbar/config/states/soundbar/soundbar_state create mode 100755 home/hyprland/ironbar/config/states/title/state.sh create mode 100644 home/hyprland/ironbar/config/style.css create mode 100644 home/hyprland/ironbar/default.nix diff --git a/home/hyprland/config.nix b/home/hyprland/config.nix index 4a6fbfaf..321976f5 100644 --- a/home/hyprland/config.nix +++ b/home/hyprland/config.nix @@ -81,10 +81,10 @@ in '' } } - $layers = ^(eww-.+|waybar|bar|system-menu|anyrun|gtk-layer-shell|swaync-.+)$ + $layers = ^(eww-.+|ironbar|waybar|bar|system-menu|anyrun|gtk-layer-shell|swaync-.+)$ layerrule = blur, $layers layerrule = ignorealpha 0, $layers - layerrule = ignorealpha 0.5, ^(eww-(music|calendar)|waybar|system-menu|anyrun|swaync-.+)$ + layerrule = ignorealpha 0.5, ^(eww-(music|calendar)|ironbar|waybar|system-menu|anyrun|swaync-.+)$ layerrule = xray 1, ^(bar|gtk-layer-shell)$ animations { diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 72171b71..682950dd 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -4,23 +4,13 @@ imports = [ ./wlogout/default.nix ./waybar/default.nix + ./ironbar/default.nix ./swaync/default.nix ./rofi/default.nix ./anyrun.nix ./gtk.nix ]; - programs.rofi = { - package = pkgs.rofi-wayland; - terminal = "${pkgs.alacritty}/bin/alacritty"; - pass.extraConfig = '' - backend=wtype - clibpoard_backend=wl-clipboard - ''; - }; - services.kanshi = { - enable = true; - systemdTarget = "hyprland-session.target"; - }; + services.swayosd.enable = true; stylix.targets = { hyprland.enable = true; xresources.enable = true; diff --git a/home/hyprland/ironbar/README.org b/home/hyprland/ironbar/README.org new file mode 100644 index 00000000..534fa82b --- /dev/null +++ b/home/hyprland/ironbar/README.org @@ -0,0 +1,5 @@ +#+title: Ironbar README + +Repo: [[https://github.com/JakeStanger/ironbar][GitHub - JakeStanger/ironbar: Customisable gtk-layer-shell wlroots/sway bar w...]] + +Config initially from: [[https://gitea.com/SimplyKyle/dotfiles/src/branch/main/home/.config/ironbar][dotfiles/ironbar at main - dotfiles - Gitea: Git with a cup of tea]] diff --git a/home/hyprland/ironbar/config/color.css b/home/hyprland/ironbar/config/color.css new file mode 100644 index 00000000..a269e63c --- /dev/null +++ b/home/hyprland/ironbar/config/color.css @@ -0,0 +1,314 @@ +:root { + --ctp-latte-rosewater: #de9584; + --ctp-latte-rosewater-rgb: rgb(222, 149, 132); + --ctp-latte-rosewater-hsl: hsl(11, 58%, 69%); + --ctp-frappe-rosewater: #f2d5cf; + --ctp-frappe-rosewater-rgb: rgb(242, 213, 207); + --ctp-frappe-rosewater-hsl: hsl(10, 57%, 88%); + --ctp-macchiato-rosewater: #f4dbd6; + --ctp-macchiato-rosewater-rgb: rgb(244, 219, 214); + --ctp-macchiato-rosewater-hsl: hsl(10, 58%, 90%); + --ctp-mocha-rosewater: #f5e0dc; + --ctp-mocha-rosewater-rgb: rgb(245, 224, 220); + --ctp-mocha-rosewater-hsl: hsl(10, 56%, 91%); + --ctp-latte-flamingo: #dd7878; + --ctp-latte-flamingo-rgb: rgb(221, 120, 120); + --ctp-latte-flamingo-hsl: hsl(0, 60%, 67%); + --ctp-frappe-flamingo: #eebebe; + --ctp-frappe-flamingo-rgb: rgb(238, 190, 190); + --ctp-frappe-flamingo-hsl: hsl(0, 59%, 84%); + --ctp-macchiato-flamingo: #f0c6c6; + --ctp-macchiato-flamingo-rgb: rgb(240, 198, 198); + --ctp-macchiato-flamingo-hsl: hsl(0, 58%, 86%); + --ctp-mocha-flamingo: #f2cdcd; + --ctp-mocha-flamingo-rgb: rgb(242, 205, 205); + --ctp-mocha-flamingo-hsl: hsl(0, 59%, 88%); + --ctp-latte-pink: #ec83d0; + --ctp-latte-pink-rgb: rgb(236, 131, 208); + --ctp-latte-pink-hsl: hsl(316, 73%, 72%); + --ctp-frappe-pink: #f4b8e4; + --ctp-frappe-pink-rgb: rgb(244, 184, 228); + --ctp-frappe-pink-hsl: hsl(316, 73%, 84%); + --ctp-macchiato-pink: #f5bde6; + --ctp-macchiato-pink-rgb: rgb(245, 189, 230); + --ctp-macchiato-pink-hsl: hsl(316, 74%, 85%); + --ctp-mocha-pink: #f5c2e7; + --ctp-mocha-pink-rgb: rgb(245, 194, 231); + --ctp-mocha-pink-hsl: hsl(316, 72%, 86%); + --ctp-latte-mauve: #8839ef; + --ctp-latte-mauve-rgb: rgb(136, 57, 239); + --ctp-latte-mauve-hsl: hsl(266, 85%, 58%); + --ctp-frappe-mauve: #ca9ee6; + --ctp-frappe-mauve-rgb: rgb(202, 158, 230); + --ctp-frappe-mauve-hsl: hsl(277, 59%, 76%); + --ctp-macchiato-mauve: #c6a0f6; + --ctp-macchiato-mauve-rgb: rgb(198, 160, 246); + --ctp-macchiato-mauve-hsl: hsl(267, 83%, 80%); + --ctp-mocha-mauve: #cba6f7; + --ctp-mocha-mauve-rgb: rgb(203, 166, 247); + --ctp-mocha-mauve-hsl: hsl(267, 84%, 81%); + --ctp-latte-red: #d20f39; + --ctp-latte-red-rgb: rgb(210, 15, 57); + --ctp-latte-red-hsl: hsl(347, 87%, 44%); + --ctp-frappe-red: #e78284; + --ctp-frappe-red-rgb: rgb(231, 130, 132); + --ctp-frappe-red-hsl: hsl(359, 68%, 71%); + --ctp-macchiato-red: #ed8796; + --ctp-macchiato-red-rgb: rgb(237, 135, 150); + --ctp-macchiato-red-hsl: hsl(351, 74%, 73%); + --ctp-mocha-red: #f38ba8; + --ctp-mocha-red-rgb: rgb(243, 139, 168); + --ctp-mocha-red-hsl: hsl(343, 81%, 75%); + --ctp-latte-maroon: #e64553; + --ctp-latte-maroon-rgb: rgb(230, 69, 83); + --ctp-latte-maroon-hsl: hsl(355, 76%, 59%); + --ctp-frappe-maroon: #ea999c; + --ctp-frappe-maroon-rgb: rgb(234, 153, 156); + --ctp-frappe-maroon-hsl: hsl(358, 66%, 76%); + --ctp-macchiato-maroon: #ee99a0; + --ctp-macchiato-maroon-rgb: rgb(238, 153, 160); + --ctp-macchiato-maroon-hsl: hsl(355, 71%, 77%); + --ctp-mocha-maroon: #eba0ac; + --ctp-mocha-maroon-rgb: rgb(235, 160, 172); + --ctp-mocha-maroon-hsl: hsl(350, 65%, 77%); + --ctp-latte-peach: #fe640b; + --ctp-latte-peach-rgb: rgb(254, 100, 11); + --ctp-latte-peach-hsl: hsl(22, 99%, 52%); + --ctp-frappe-peach: #ef9f76; + --ctp-frappe-peach-rgb: rgb(239, 159, 118); + --ctp-frappe-peach-hsl: hsl(20, 79%, 70%); + --ctp-macchiato-peach: #f5a97f; + --ctp-macchiato-peach-rgb: rgb(245, 169, 127); + --ctp-macchiato-peach-hsl: hsl(21, 86%, 73%); + --ctp-mocha-peach: #fab387; + --ctp-mocha-peach-rgb: rgb(250, 179, 135); + --ctp-mocha-peach-hsl: hsl(23, 92%, 75%); + --ctp-latte-yellow: #e49320; + --ctp-latte-yellow-rgb: rgb(228, 147, 32); + --ctp-latte-yellow-hsl: hsl(35, 78%, 51%); + --ctp-frappe-yellow: #e5c890; + --ctp-frappe-yellow-rgb: rgb(229, 200, 144); + --ctp-frappe-yellow-hsl: hsl(40, 62%, 73%); + --ctp-macchiato-yellow: #eed49f; + --ctp-macchiato-yellow-rgb: rgb(238, 212, 159); + --ctp-macchiato-yellow-hsl: hsl(40, 70%, 78%); + --ctp-mocha-yellow: #f9e2af; + --ctp-mocha-yellow-rgb: rgb(249, 226, 175); + --ctp-mocha-yellow-hsl: hsl(41, 86%, 83%); + --ctp-latte-green: #40a02b; + --ctp-latte-green-rgb: rgb(64, 160, 43); + --ctp-latte-green-hsl: hsl(109, 58%, 40%); + --ctp-frappe-green: #a6d189; + --ctp-frappe-green-rgb: rgb(166, 209, 137); + --ctp-frappe-green-hsl: hsl(96, 44%, 68%); + --ctp-macchiato-green: #a6da95; + --ctp-macchiato-green-rgb: rgb(166, 218, 149); + --ctp-macchiato-green-hsl: hsl(105, 48%, 72%); + --ctp-mocha-green: #a6e3a1; + --ctp-mocha-green-rgb: rgb(166, 227, 161); + --ctp-mocha-green-hsl: hsl(115, 54%, 76%); + --ctp-latte-teal: #179299; + --ctp-latte-teal-rgb: rgb(23, 146, 153); + --ctp-latte-teal-hsl: hsl(183, 74%, 35%); + --ctp-frappe-teal: #81c8be; + --ctp-frappe-teal-rgb: rgb(129, 200, 190); + --ctp-frappe-teal-hsl: hsl(172, 39%, 65%); + --ctp-macchiato-teal: #8bd5ca; + --ctp-macchiato-teal-rgb: rgb(139, 213, 202); + --ctp-macchiato-teal-hsl: hsl(171, 47%, 69%); + --ctp-mocha-teal: #94e2d5; + --ctp-mocha-teal-rgb: rgb(148, 226, 213); + --ctp-mocha-teal-hsl: hsl(170, 57%, 73%); + --ctp-latte-sky: #04a5e5; + --ctp-latte-sky-rgb: rgb(4, 165, 229); + --ctp-latte-sky-hsl: hsl(197, 97%, 46%); + --ctp-frappe-sky: #99d1db; + --ctp-frappe-sky-rgb: rgb(153, 209, 219); + --ctp-frappe-sky-hsl: hsl(189, 48%, 73%); + --ctp-macchiato-sky: #91d7e3; + --ctp-macchiato-sky-rgb: rgb(145, 215, 227); + --ctp-macchiato-sky-hsl: hsl(189, 59%, 73%); + --ctp-mocha-sky: #89dceb; + --ctp-mocha-sky-rgb: rgb(137, 220, 235); + --ctp-mocha-sky-hsl: hsl(189, 71%, 73%); + --ctp-latte-sapphire: #209fb5; + --ctp-latte-sapphire-rgb: rgb(32, 159, 181); + --ctp-latte-sapphire-hsl: hsl(189, 70%, 42%); + --ctp-frappe-sapphire: #85c1dc; + --ctp-frappe-sapphire-rgb: rgb(133, 193, 220); + --ctp-frappe-sapphire-hsl: hsl(199, 55%, 69%); + --ctp-macchiato-sapphire: #7dc4e4; + --ctp-macchiato-sapphire-rgb: rgb(125, 196, 228); + --ctp-macchiato-sapphire-hsl: hsl(199, 66%, 69%); + --ctp-mocha-sapphire: #74c7ec; + --ctp-mocha-sapphire-rgb: rgb(116, 199, 236); + --ctp-mocha-sapphire-hsl: hsl(199, 76%, 69%); + --ctp-latte-blue: #2a6ef5; + --ctp-latte-blue-rgb: rgb(42, 110, 245); + --ctp-latte-blue-hsl: hsl(220, 91%, 56%); + --ctp-frappe-blue: #8caaee; + --ctp-frappe-blue-rgb: rgb(140, 170, 238); + --ctp-frappe-blue-hsl: hsl(222, 74%, 74%); + --ctp-macchiato-blue: #8aadf4; + --ctp-macchiato-blue-rgb: rgb(138, 173, 244); + --ctp-macchiato-blue-hsl: hsl(220, 83%, 75%); + --ctp-mocha-blue: #87b0f9; + --ctp-mocha-blue-rgb: rgb(135, 176, 249); + --ctp-mocha-blue-hsl: hsl(218, 90%, 75%); + --ctp-latte-lavender: #7287fd; + --ctp-latte-lavender-rgb: rgb(114, 135, 253); + --ctp-latte-lavender-hsl: hsl(231, 97%, 72%); + --ctp-frappe-lavender: #babbf1; + --ctp-frappe-lavender-rgb: rgb(186, 187, 241); + --ctp-frappe-lavender-hsl: hsl(239, 66%, 84%); + --ctp-macchiato-lavender: #b7bdf8; + --ctp-macchiato-lavender-rgb: rgb(183, 189, 248); + --ctp-macchiato-lavender-hsl: hsl(234, 82%, 85%); + --ctp-mocha-lavender: #b4befe; + --ctp-mocha-lavender-rgb: rgb(180, 190, 254); + --ctp-mocha-lavender-hsl: hsl(232, 97%, 85%); + --ctp-latte-text: #4c4f69; + --ctp-latte-text-rgb: rgb(76, 79, 105); + --ctp-latte-text-hsl: hsl(234, 16%, 35%); + --ctp-frappe-text: #c6ceef; + --ctp-frappe-text-rgb: rgb(198, 206, 239); + --ctp-frappe-text-hsl: hsl(228, 56%, 86%); + --ctp-macchiato-text: #c5cff5; + --ctp-macchiato-text-rgb: rgb(197, 207, 245); + --ctp-macchiato-text-hsl: hsl(228, 71%, 87%); + --ctp-mocha-text: #c6d0f5; + --ctp-mocha-text-rgb: rgb(198, 208, 245); + --ctp-mocha-text-hsl: hsl(227, 70%, 87%); + --ctp-latte-subtext1: #5c5f77; + --ctp-latte-subtext1-rgb: rgb(92, 95, 119); + --ctp-latte-subtext1-hsl: hsl(233, 13%, 41%); + --ctp-frappe-subtext1: #b5bddc; + --ctp-frappe-subtext1-rgb: rgb(181, 189, 220); + --ctp-frappe-subtext1-hsl: hsl(228, 36%, 79%); + --ctp-macchiato-subtext1: #b3bce0; + --ctp-macchiato-subtext1-rgb: rgb(179, 188, 224); + --ctp-macchiato-subtext1-hsl: hsl(228, 42%, 79%); + --ctp-mocha-subtext1: #b3bcdf; + --ctp-mocha-subtext1-rgb: rgb(179, 188, 223); + --ctp-mocha-subtext1-hsl: hsl(228, 41%, 79%); + --ctp-latte-subtext0: #6c6f85; + --ctp-latte-subtext0-rgb: rgb(108, 111, 133); + --ctp-latte-subtext0-hsl: hsl(233, 10%, 47%); + --ctp-frappe-subtext0: #a5acc9; + --ctp-frappe-subtext0-rgb: rgb(165, 172, 201); + --ctp-frappe-subtext0-hsl: hsl(228, 25%, 72%); + --ctp-macchiato-subtext0: #a1aacb; + --ctp-macchiato-subtext0-rgb: rgb(161, 170, 203); + --ctp-macchiato-subtext0-hsl: hsl(227, 29%, 71%); + --ctp-mocha-subtext0: #a1a8c9; + --ctp-mocha-subtext0-rgb: rgb(161, 168, 201); + --ctp-mocha-subtext0-hsl: hsl(229, 27%, 71%); + --ctp-latte-overlay2: #7c7f93; + --ctp-latte-overlay2-rgb: rgb(124, 127, 147); + --ctp-latte-overlay2-hsl: hsl(232, 10%, 53%); + --ctp-frappe-overlay2: #949bb7; + --ctp-frappe-overlay2-rgb: rgb(148, 155, 183); + --ctp-frappe-overlay2-hsl: hsl(228, 20%, 65%); + --ctp-macchiato-overlay2: #8f97b7; + --ctp-macchiato-overlay2-rgb: rgb(143, 151, 183); + --ctp-macchiato-overlay2-hsl: hsl(228, 22%, 64%); + --ctp-mocha-overlay2: #8e95b3; + --ctp-mocha-overlay2-rgb: rgb(142, 149, 179); + --ctp-mocha-overlay2-hsl: hsl(229, 20%, 63%); + --ctp-latte-overlay1: #8c8fa1; + --ctp-latte-overlay1-rgb: rgb(140, 143, 161); + --ctp-latte-overlay1-hsl: hsl(231, 10%, 59%); + --ctp-frappe-overlay1: #838aa4; + --ctp-frappe-overlay1-rgb: rgb(131, 138, 164); + --ctp-frappe-overlay1-hsl: hsl(227, 15%, 58%); + --ctp-macchiato-overlay1: #7d84a2; + --ctp-macchiato-overlay1-rgb: rgb(125, 132, 162); + --ctp-macchiato-overlay1-hsl: hsl(229, 17%, 56%); + --ctp-mocha-overlay1: #7b819d; + --ctp-mocha-overlay1-rgb: rgb(123, 129, 157); + --ctp-mocha-overlay1-hsl: hsl(229, 15%, 55%); + --ctp-latte-overlay0: #9ca0b0; + --ctp-latte-overlay0-rgb: rgb(156, 160, 176); + --ctp-latte-overlay0-hsl: hsl(228, 11%, 65%); + --ctp-frappe-overlay0: #737891; + --ctp-frappe-overlay0-rgb: rgb(115, 120, 145); + --ctp-frappe-overlay0-hsl: hsl(230, 12%, 51%); + --ctp-macchiato-overlay0: #6c728d; + --ctp-macchiato-overlay0-rgb: rgb(108, 114, 141); + --ctp-macchiato-overlay0-hsl: hsl(229, 13%, 49%); + --ctp-mocha-overlay0: #696d86; + --ctp-mocha-overlay0-rgb: rgb(105, 109, 134); + --ctp-mocha-overlay0-hsl: hsl(232, 12%, 47%); + --ctp-latte-surface2: #acb0be; + --ctp-latte-surface2-rgb: rgb(172, 176, 190); + --ctp-latte-surface2-hsl: hsl(227, 12%, 71%); + --ctp-frappe-surface2: #62677e; + --ctp-frappe-surface2-rgb: rgb(98, 103, 126); + --ctp-frappe-surface2-hsl: hsl(229, 13%, 44%); + --ctp-macchiato-surface2: #5a5f78; + --ctp-macchiato-surface2-rgb: rgb(90, 95, 120); + --ctp-macchiato-surface2-hsl: hsl(230, 14%, 41%); + --ctp-mocha-surface2: #565970; + --ctp-mocha-surface2-rgb: rgb(86, 89, 112); + --ctp-mocha-surface2-hsl: hsl(233, 13%, 39%); + --ctp-latte-surface1: #bcc0cc; + --ctp-latte-surface1-rgb: rgb(188, 192, 204); + --ctp-latte-surface1-hsl: hsl(225, 14%, 77%); + --ctp-frappe-surface1: #51566c; + --ctp-frappe-surface1-rgb: rgb(81, 86, 108); + --ctp-frappe-surface1-hsl: hsl(229, 14%, 37%); + --ctp-macchiato-surface1: #484c64; + --ctp-macchiato-surface1-rgb: rgb(72, 76, 100); + --ctp-macchiato-surface1-hsl: hsl(231, 16%, 34%); + --ctp-mocha-surface1: #43465a; + --ctp-mocha-surface1-rgb: rgb(67, 70, 90); + --ctp-mocha-surface1-hsl: hsl(232, 15%, 31%); + --ctp-latte-surface0: #ccd0da; + --ctp-latte-surface0-rgb: rgb(204, 208, 218); + --ctp-latte-surface0-hsl: hsl(223, 16%, 83%); + --ctp-frappe-surface0: #414559; + --ctp-frappe-surface0-rgb: rgb(65, 69, 89); + --ctp-frappe-surface0-hsl: hsl(230, 16%, 30%); + --ctp-macchiato-surface0: #363a4f; + --ctp-macchiato-surface0-rgb: rgb(54, 58, 79); + --ctp-macchiato-surface0-hsl: hsl(230, 19%, 26%); + --ctp-mocha-surface0: #313244; + --ctp-mocha-surface0-rgb: rgb(49, 50, 68); + --ctp-mocha-surface0-hsl: hsl(237, 16%, 23%); + --ctp-latte-base: #eff1f5; + --ctp-latte-base-rgb: rgb(239, 241, 245); + --ctp-latte-base-hsl: hsl(220, 23%, 95%); + --ctp-frappe-base: #303446; + --ctp-frappe-base-rgb: rgb(48, 52, 70); + --ctp-frappe-base-hsl: hsl(229, 19%, 23%); + --ctp-macchiato-base: #24273a; + --ctp-macchiato-base-rgb: rgb(36, 39, 58); + --ctp-macchiato-base-hsl: hsl(232, 23%, 18%); + --ctp-mocha-base: #1e1e2e; + --ctp-mocha-base-rgb: rgb(30, 30, 46); + --ctp-mocha-base-hsl: hsl(240, 21%, 15%); + --ctp-latte-mantle: #e6e9ef; + --ctp-latte-mantle-rgb: rgb(230, 233, 239); + --ctp-latte-mantle-hsl: hsl(220, 22%, 92%); + --ctp-frappe-mantle: #292c3c; + --ctp-frappe-mantle-rgb: rgb(41, 44, 60); + --ctp-frappe-mantle-hsl: hsl(231, 19%, 20%); + --ctp-macchiato-mantle: #1e2030; + --ctp-macchiato-mantle-rgb: rgb(30, 32, 48); + --ctp-macchiato-mantle-hsl: hsl(233, 23%, 15%); + --ctp-mocha-mantle: #181825; + --ctp-mocha-mantle-rgb: rgb(24, 24, 37); + --ctp-mocha-mantle-hsl: hsl(240, 21%, 12%); + --ctp-latte-crust: #dce0e8; + --ctp-latte-crust-rgb: rgb(220, 224, 232); + --ctp-latte-crust-hsl: hsl(220, 21%, 89%); + --ctp-frappe-crust: #232634; + --ctp-frappe-crust-rgb: rgb(35, 38, 52); + --ctp-frappe-crust-hsl: hsl(229, 20%, 17%); + --ctp-macchiato-crust: #181926; + --ctp-macchiato-crust-rgb: rgb(24, 25, 38); + --ctp-macchiato-crust-hsl: hsl(236, 23%, 12%); + --ctp-mocha-crust: #11111b; + --ctp-mocha-crust-rgb: rgb(17, 17, 27); + --ctp-mocha-crust-hsl: hsl(240, 23%, 9%); +} diff --git a/home/hyprland/ironbar/config/config.corn b/home/hyprland/ironbar/config/config.corn new file mode 100644 index 00000000..14a81baa --- /dev/null +++ b/home/hyprland/ironbar/config/config.corn @@ -0,0 +1,136 @@ +let { + $tray = { type = "tray" } + $clock = { + type = "clock" + format = "%H:%M" + format_popup = "%d/%m/%Y %H:%M:%S" + } + $custom_clock = { + type = "custom" + class = "time" + on_mouse_enter = "ironbar set clock_state true" + on_mouse_exit = "ironbar set clock_state false" + bar = [ + { + type = "label" + label = "{{date '+%H:%M'}}" + } + { + type = "label" + transition_duration = 400 + label = " {{date '+%b %d, %Y'}}" + class = "clock_date" + show_if = "#clock_state" + } + ] + } + + $window = { + type = "focused" + show_icon = true + show_title = true + icon_size = 24 + icon_theme = "Delta" + truncate = "end" + } + $cpu_sys = "{cpu_percent}% 󰻠" + + $memory_sys = "{memory_percent}% 󰍛" + + $network_sys = "{net_down:wlp6s0} Mbps" + + $SysInfo = { + type = "sys_info" + class = "ram" + format = [ $memory_sys ] + tooltip = "{{~/.config/ironbar/scripts/ram_info}} GiB" + } + + $internet = { + type = "custom" + class = "internet" + on_mouse_enter = "ironbar set wifi_state true" + on_mouse_exit = "ironbar set wifi_state false" + on_click_left = "nm-connection-editor" + bar = [ + { + type = "label" + transition_type = "slide_end" + transition_duration = 350 + label = "{{~/.config/ironbar/scripts/wifi --ESSID}} " + show_if = "#wifi_state" + } + { + type = "label" + label = "{{~/.config/ironbar/scripts/wifi --ICON}} " + } + ] + } + + + $expand_sound = { + type = "script" + mode = "poll" + interval = 100 + cmd = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; echo '';else;echo '';fi'" + on_click_left = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; ironbar set soundbar_state false;else;ironbar set soundbar_state true;fi'" + } + + $cava = { + transition_type = "slide_end" + transition_duration = 750 + name = "cava" + type = "script" + mode = "watch" + cmd = "/home/xenia/.config/ironbar/scripts/cava" + show_if = "#soundbar_state" + } + + $volume = { + transition_type = "slide_end" + transition_duration = 350 + type = "custom" + bar = [ + { + type = "slider" + class = "scale" + length = 100 + max = 100 + on_change = "!wpctl set-volume @DEFAULT_SINK@ $0%" + on_scroll_down = "wpctl set-volume @DEFAULT_SINK@ 2%-" + on_scroll_up = "wpctl set-volume @DEFAULT_SINK@ 2%+" + on_click_right = "pavucontrol" + value = "100:/home/xenia/.config/ironbar/scripts/volume" + show_if = "#soundbar_state" + tooltip = "{{/home/xenia/.config/ironbar/scripts/volume}}%" + } + ] + } + + $workspace = { + type = "workspaces" + sort = "alphanumeric" + on_scroll_up = "hyprctl dispatch workspace -1" + on_scroll_down = "hyprctl dispatch workspace +1" + name_map.1 = "󰟀" + name_map.2 = "󰳼" + name_map.3 = "󰖟" + name_map.4 = "󰃭" + name_map.5 = "󰝰" + name_map.6 = "󰲸" + name_map.7 = "󰭹" + name_map.8 = "󰢹" + name_map.9 = "󰊗" + } + + + $start = [ $workspace ] + $center = [ $window ] + $end = [ $cava $volume $expand_sound $internet $SysInfo $clock $tray ] +} +in { + position = "top" + start = $start + center = $center + end = $end +} diff --git a/home/hyprland/ironbar/config/config.toml.bak b/home/hyprland/ironbar/config/config.toml.bak new file mode 100644 index 00000000..663de444 --- /dev/null +++ b/home/hyprland/ironbar/config/config.toml.bak @@ -0,0 +1,22 @@ +position = "top" + +[[left]] +type = 'launcher' +icon_theme = 'Papirus' + +[[center]] +type = 'focused' +icon_theme = 'Papirus' + +[[right]] +type = 'tray' + +[[right]] +type = 'clock' + +[[right]] +type = 'sys-info' +format = [ + 'cpu: {cpu-percent}%', + 'memory: {memory-percent}%', +] diff --git a/home/hyprland/ironbar/config/scripts/battery b/home/hyprland/ironbar/config/scripts/battery new file mode 100755 index 00000000..3ffb8f29 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/battery @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +BAT=$(ls /sys/class/power_supply | grep BAT | head -n 1) + +battery() { + cat /sys/class/power_supply/${BAT}/capacity +} +battery_stat() { + cat /sys/class/power_supply/${BAT}/status +} + +case "$1" in + --bat) battery ;; + --bat-st) battery_stat ;; +esac diff --git a/home/hyprland/ironbar/config/scripts/cava b/home/hyprland/ironbar/config/scripts/cava new file mode 100755 index 00000000..ac16cff1 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/cava @@ -0,0 +1,3 @@ +#! /usr/bin/env bash + +printf "[general]\nframerate=160\nbars = 7\n[output]\nmethod = raw\nraw_target = /dev/stdout\ndata_format = ascii\nascii_max_range = 7\n[input]\nmethod=pulse\nsource=auto\n" | cava -p /dev/stdin | sed -u 's/;//g;s/0/▁/g;s/1/▂/g;s/2/▃/g;s/3/▄/g;s/4/▅/g;s/5/▆/g;s/6/▇/g;s/7/█/g; ' diff --git a/home/hyprland/ironbar/config/scripts/get_audio_volume b/home/hyprland/ironbar/config/scripts/get_audio_volume new file mode 100755 index 00000000..3680ecc7 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/get_audio_volume @@ -0,0 +1 @@ +wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2*100}' diff --git a/home/hyprland/ironbar/config/scripts/gtk-tray b/home/hyprland/ironbar/config/scripts/gtk-tray new file mode 100755 index 00000000..3ab0562b --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/gtk-tray @@ -0,0 +1,3 @@ +if [[ -z "$(pidof gtk-tray)" ]]; then + sh -c gtk-tray & +fi diff --git a/home/hyprland/ironbar/config/scripts/mem-ad b/home/hyprland/ironbar/config/scripts/mem-ad new file mode 100755 index 00000000..b24375c4 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/mem-ad @@ -0,0 +1,14 @@ +#!/bin/sh + + +total="$(free -m | grep Mem: | awk '{ print $2 }')" +used="$(free -m | grep Mem: | awk '{ print $3 }')" +shared="$(free -m | grep Mem: | awk '{ print $5 }')" +free=$(expr $total - $used - $shared) +true_used=$(expr $shared + $used) + +case $1 in + total) echo $total;; + used) echo $true_used;; + free) echo $free;; +esac diff --git a/home/hyprland/ironbar/config/scripts/memory b/home/hyprland/ironbar/config/scripts/memory new file mode 100755 index 00000000..217c8344 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/memory @@ -0,0 +1,3 @@ +#!/bin/sh + +printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') diff --git a/home/hyprland/ironbar/config/scripts/music b/home/hyprland/ironbar/config/scripts/music new file mode 100755 index 00000000..9a182061 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/music @@ -0,0 +1,273 @@ +#!/usr/bin/env bash + +# ╔╦╗ ╦ ╦ ╔═╗ ╦ ╔═╗ +# ║║║ ║ ║ ╚═╗ ║ ║ +# ╩ ╩ ╚═╝ ╚═╝ ╩ ╚═╝ + +# author Niraj +# github niraj998 + +# ┌─┐┌─┐┌┐┌┌─┐┬┌─┐┬ ┬┬─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐ +# │ │ ││││├┤ ││ ┬│ │├┬┘├─┤ │ ││ ││││└─┐ +# └─┘└─┘┘└┘└ ┴└─┘└─┘┴└─┴ ┴ ┴ ┴└─┘┘└┘└─┘ + +# uncomment your music players below. +# + +Control="not_MPD" +# [ -n "$(pgrep spotify)" ] && Control="spotify" +[ -n "$(pgrep brave-bin)" ] && Control="brave-bin" +# [ -n "$(pgrep rhythmbox)" ] && Control="rhythmbox" +# [ -n "$(pgrep audacious)" ] && Control="audacious" +# [ -n "$(pgrep clementine)" ] && Control="clementine" +# [ -n "$(pgrep strawberry)" ] && Control="strawberry" + +# saves covers here +Cover=/tmp/music.jpg +# if cover not found in metadata use this instead +bkpCover=~/.config/eww/music.png +# mpd music directory +mpddir="$HOME/Music/iTunes Media" + +# ┌─┐┬ ┌─┐┬ ┬┌─┐┬─┐┌─┐┌┬┐┬ ┌─┐┌─┐┬─┐┬┌─┐┌┬┐┌─┐ +# ├─┘│ ├─┤└┬┘├┤ ├┬┘│ │ │ └─┐│ ├┬┘│├─┘ │ └─┐ +# ┴ ┴─┘┴ ┴ ┴ └─┘┴└─└─┘ ┴ ┴─┘ └─┘└─┘┴└─┴┴ ┴ └─┘ + +########################## Title ########################## +title() { + title=$(playerctl metadata --format {{title}}) + [ -z "$title" ] && title="Play Something" + echo "$title" +} + +########################## Artist ########################## +artist() { + artist=$(playerctl metadata --format {{artist}}) + [ -z "$artist" ] && artist="Artist" + echo "$artist" +} + +########################## Album ########################## +album() { + album=$(playerctl metadata --format {{album}}) + [ -z "$album" ] && album="Album" + echo "$album" +} + +########################## Status ########################## +status() { + status=$(playerctl status) + [ -z "$status" ] && status="Stopped" + echo "$status" +} + +########################## Time ########################## +ctime() { + time=$(playerctl position --format "{{ duration(position) }}") + [ -z "$time" ] && time="0:00" + echo "$time" +} + +########################## Length ########################## +length() { + length=$(playerctl metadata --format "{{ duration(mpris:length) }}") + [ -z "$length" ] && length="0:00" + echo "$length" +} + +########################## trackNumber ########################## +playlist() { + playlist=$(playerctl metadata xesam:trackNumber) + [ -z "$playlist" ] && playlist="0" + echo "$playlist" +} + +########################## Cover ########################## +cover() { + albumart="$(playerctl metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')" + [ $(playerctl metadata mpris:artUrl) ] && curl -s "$albumart" --output /tmp/fuck.png || cp $bkpCover $Cover + convert /tmp/fuck.png $Cover + echo "$Cover" +} + +########################## Statusicon ########################## +statusicon() { + icon="" + [ $(playerctl status) = "Playing" ] && icon="" + [ $(playerctl status) = "Paused" ] && icon="" + echo "$icon" +} + +########################## Lyrics ########################## +lyrics() { + Title=$(playerctl metadata --format {{title}}) + Artist=$(playerctl metadata --format {{artist}}) + URL="https://api.lyrics.ovh/v1/$Artist/$Title" + lyrics=$(curl -s "$(echo "$URL" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)" | jq '.lyrics') + [ "$lyrics" = "null" ] && lyrics=$(curl -s --get "https://makeitpersonal.co/lyrics" --data-urlencode "artist=$Artist" --data-urlencode "title=$Title") + printf "$lyrics" | less +} + +# ┌┬┐┌─┐┌┬┐ ┌─┐┌─┐┬─┐┬┌─┐┌┬┐┌─┐ +# │││├─┘ ││ └─┐│ ├┬┘│├─┘ │ └─┐ +# ┴ ┴┴ ─┴┘ └─┘└─┘┴└─┴┴ ┴ └─┘ + +########################## Title ########################## +mpctitle() { + title=$(mpc -f %title% current) + [ -z "$title" ] && title="Play Something" + echo "$title" +} + +########################## Artist ########################## +mpcartist() { + artist=$(mpc -f %artist% current) + [ -z "$artist" ] && artist="Artist" + echo "$artist" +} + +########################## Album ########################## +mpcalbum() { + album=$(mpc -f %album% current) + [ -z "$album" ] && album="Album" + echo "$album" +} + +########################## Cover ########################## +mpccover() { + ffmpeg -i "$mpddir"/"$(mpc current -f %file%)" "${Cover}" -y || cp $bkpCover $Cover + echo "$Cover" && exit +} + +########################## Time ########################## +mpctime() { + time=$(mpc status %currenttime%) + [ -z "$time" ] && time="0:00" + echo "$time" +} + +########################## Length ########################## +mpclength() { + length=$(mpc status %totaltime%) + [ -z "$length" ] && length="0:00" + echo "$length" +} + +########################## Icon ########################## +mpcicon() { + status=$(mpc status | head -2 | tail -1 | cut -c2-7) + icon="" + [ "$status" = "playin" ] && icon="" + [ "$status" = "paused" ] && icon="" + echo "$icon" +} + +########################## Status ########################## +mpcstatus() { + stat=$(mpc status | head -2 | tail -1 | cut -c2-7) + status="Stopped" + [ "$stat" = "playin" ] && status="Playing" + [ "$stat" = "paused" ] && status="Paused" + echo "$status" +} + +########################## Percent ########################## +mpcperc() { + perc=$(mpc status %percenttime%) + [ -z "$perc" ] && perc="0" + echo "$perc" +} + +########################## Playlist ########################## +mpcsongpos() { + pos=$(mpc status %songpos%) + allsongs=$(mpc status %length%) + playlist="$pos/$allsongs" + [ -z "$pos" ] && playlist="0/0" + echo "$playlist" +} + +########################## Lyrics ########################## +mpclyrics() { + Title=$(mpc -f %title% current) + Artist=$(mpc -f %artist% current) + URL="https://api.lyrics.ovh/v1/$Artist/$Title" + lyrics=$(curl -s "$(echo "$URL" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)" | jq '.lyrics') + [ "$lyrics" = "null" ] && lyrics=$(curl -s --get "https://makeitpersonal.co/lyrics" --data-urlencode "artist=$Artist" --data-urlencode "title=$Title") + printf "$lyrics" | less +} + +# ┬ ┬┌─┐┬ ┌─┐ +# ├─┤├┤ │ ├─┘ +# ┴ ┴└─┘┴─┘┴ + +doc() { + echo "Usage: + music [Options] + +Options: + previous previous song + next next song + toggle toggle between play-pause song + title shows title of current song + album shows album of current song + artist shows artist of current song + status music status (playing/paused/stopped) + statusicon music status icons (playing/paused/stopped) + coverloc saves cover and shows location to cover of current song + showcover opens cover using feh + time shows current time of song + length shows length of song + percent shows percent song + playlist shows playlist position of current song + lyrics shows lyrics" +} + +# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐ +# │ │├─┘ │ ││ ││││└─┐ +# └─┘┴ ┴ ┴└─┘┘└┘└─┘ + +case $Control in + MPD) + case $1 in + next) mpc -q next ;; + previous) mpc -q prev ;; + toggle) mpc -q toggle ;; + title) mpctitle ;; + artist) mpcartist ;; + album) mpcalbum ;; + status) mpcstatus ;; + statusicon) mpcicon ;; + player) echo "$Control" ;; + coverloc) mpccover ;; + showcover) mpccover | xargs feh ;; + time) mpctime ;; + length) mpclength ;; + percent) mpcperc ;; + playlist) mpcsongpos ;; + lyrics) mpclyrics ;; + *) doc ;; + esac + ;; + *) + case $1 in + next) playerctl next ;; + previous) playerctl previous ;; + toggle) playerctl play-pause ;; + title) title ;; + artist) artist ;; + album) album ;; + status) status ;; + statusicon) statusicon ;; + player) echo "$Control" ;; + coverloc) cover ;; + showcover) cover | xargs feh ;; + time) ctime ;; + length) length ;; + percent) echo "0" ;; + playlist) playlist ;; + lyrics) lyrics ;; + *) doc ;; + esac + ;; +esac 2>/dev/null diff --git a/home/hyprland/ironbar/config/scripts/music_info b/home/hyprland/ironbar/config/scripts/music_info new file mode 100755 index 00000000..5c1e120b --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/music_info @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# scripts by adi1090x + +## Get data +STATUS="$(mpc status)" +COVER="/tmp/.music_cover.png" +MUSIC_DIR="$HOME/Music/iTunes Media" + +## Get status +get_status() { + if [[ $STATUS == *"[playing]"* ]]; then + echo "" + else + echo "奈" + fi +} + +## Get song +get_song() { + song=$(mpc -f %title% current) + if [[ -z "$song" ]]; then + echo "Offline" + else + echo "$song" + fi +} + +## Get artist +get_artist() { + artist=$(mpc -f %artist% current) + if [[ -z "$artist" ]]; then + echo "" + else + echo "$artist" + fi +} + +## Get time +get_time() { + time=$(mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)') + if [[ -z "$time" ]]; then + echo "0" + else + echo "$time" + fi +} +get_ctime() { + ctime=$(mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g') + if [[ -z "$ctime" ]]; then + echo "0:00" + else + echo "$ctime" + fi +} +get_ttime() { + ttime=$(mpc -f %time% current) + if [[ -z "$ttime" ]]; then + echo "0:00" + else + echo "$ttime" + fi +} + +## Get cover +get_cover() { + ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "${COVER}" -y &>/dev/null + STATUS=$? + + # Check if the file has a embbeded album art + if [ "$STATUS" -eq 0 ]; then + echo "$COVER" + else + echo "images/music.png" + fi +} + +## Execute accordingly +if [[ "$1" == "--song" ]]; then + get_song +elif [[ "$1" == "--artist" ]]; then + get_artist +elif [[ "$1" == "--status" ]]; then + get_status +elif [[ "$1" == "--time" ]]; then + get_time +elif [[ "$1" == "--ctime" ]]; then + get_ctime +elif [[ "$1" == "--ttime" ]]; then + get_ttime +elif [[ "$1" == "--cover" ]]; then + get_cover +elif [[ "$1" == "--toggle" ]]; then + mpc -q toggle +elif [[ "$1" == "--next" ]]; then + { + mpc -q next + get_cover + } +elif [[ "$1" == "--prev" ]]; then + { + mpc -q prev + get_cover + } +fi diff --git a/home/hyprland/ironbar/config/scripts/n.sh b/home/hyprland/ironbar/config/scripts/n.sh new file mode 100755 index 00000000..0114e71d --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/n.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy the contents of this file to the clipboard, then get a terminal open on your device and enter: +# $ cat > n.sh +# [Ctrl+V] or Right Click, Paste. Then [Ctrl+D]. +# chmod +x n.sh +# To run: ./n.sh eth0 +SLP=3 # display / sleep interval +DEVICE=$1 +IS_GOOD=0 +for GOOD_DEVICE in `grep \: /proc/net/dev | awk -F: '{print $1}'`; do + if [ "$DEVICE" = $GOOD_DEVICE ]; then + IS_GOOD=1 + break + fi +done +if [ $IS_GOOD -eq 0 ]; then + echo "Device not found. Should be one of these:" + grep ":" /proc/net/dev | awk -F: '{print $1}' | sed s@\ @@g + exit 1 +fi + +while true; do + LINE=`grep $1 /proc/net/dev | sed s/.*://`; + RECEIVED1=`echo $LINE | awk '{print $1}'` + TRANSMITTED1=`echo $LINE | awk '{print $9}'` + TOTAL=$(($RECEIVED1+$TRANSMITTED1)) + sleep $SLP + LINE=`grep $1 /proc/net/dev | sed s/.*://`; + RECEIVED2=`echo $LINE | awk '{print $1}'` + TRANSMITTED2=`echo $LINE | awk '{print $9}'` + SPEED=$((($RECEIVED2+$TRANSMITTED2-$TOTAL)/$SLP)) + INSPEED=$((($RECEIVED2-$RECEIVED1)/$SLP)) + OUTSPEED=$((($TRANSMITTED2-$TRANSMITTED1)/$SLP)) + printf "In: %12i KB/s | Out: %12i KB/s | Total: %12i KB/s\n" $(($INSPEED/1024)) $(($OUTSPEED/1024)) $(($SPEED/1024)) ; +done; \ No newline at end of file diff --git a/home/hyprland/ironbar/config/scripts/net b/home/hyprland/ironbar/config/scripts/net new file mode 100755 index 00000000..3a25b909 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/net @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +while true; do + status=$(nmcli g | tail -n 1 | awk '{print $1}') + signal=$(nmcli dev wifi | rg "\*" | awk '{ print $9 }') + essid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2) + + + icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨") + + if [ "$status" = "disconnected" ] ; then + icon="" + text="" + color="#988ba2" + else + level=$(awk -v n="$signal" 'BEGIN{print int(n/20)}') + if [ "$level" -gt 4 ]; then + level=4 + fi + + icon=${icons[$level]} + color="#cba6f7" + fi + + echo '{ "essid": "'"$essid"'", "icon": "'"$icon"'", "color": "'"$color"'" }' + + sleep 3 +done diff --git a/home/hyprland/ironbar/config/scripts/pop b/home/hyprland/ironbar/config/scripts/pop new file mode 100755 index 00000000..49f363e6 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/pop @@ -0,0 +1,89 @@ +#!/bin/sh + +calendar() { +LOCK_FILE="$HOME/.cache/eww-calendar.lock" +EWW_BIN="/usr/bin/eww" + +run() { + ${EWW_BIN} open calendar +} + +# Open widgets +if [[ ! -f "$LOCK_FILE" ]]; then + ${EWW_BIN} close system music_win audio_ctl + touch "$LOCK_FILE" + run && echo "ok good!" +else + ${EWW_BIN} close calendar + rm "$LOCK_FILE" && echo "closed" +fi +} + + +system() { +LOCK_FILE_MEM="$HOME/.cache/eww-system.lock" +EWW_BIN="/usr/bin/eww" + +run() { + ${EWW_BIN} open system +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_MEM" ]]; then + ${EWW_BIN} close calendar music_win audio_ctl + touch "$LOCK_FILE_MEM" + run && echo "ok good!" +else + ${EWW_BIN} close system + rm "$LOCK_FILE_MEM" && echo "closed" +fi +} + + +music() { +LOCK_FILE_SONG="$HOME/.cache/eww-song.lock" +EWW_BIN="/usr/bin/eww" + +run() { + ${EWW_BIN} open music_win +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_SONG" ]]; then + ${EWW_BIN} close system calendar + touch "$LOCK_FILE_SONG" + run && echo "ok good!" +else + ${EWW_BIN} close music_win + rm "$LOCK_FILE_SONG" && echo "closed" +fi +} + + + +audio() { +LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock" +EWW_BIN="/usr/bin/eww" + +run() { + ${EWW_BIN} open audio_ctl +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then + ${EWW_BIN} close system calendar music + touch "$LOCK_FILE_AUDIO" + run && echo "ok good!" +else + ${EWW_BIN} close audio_ctl + rm "$LOCK_FILE_AUDIO" && echo "closed" +fi +} + + +case $1 in + calendar) calendar;; + system) system;; + music) music;; + audio) audio;; +esac diff --git a/home/hyprland/ironbar/config/scripts/ram_info b/home/hyprland/ironbar/config/scripts/ram_info new file mode 100755 index 00000000..f11572f4 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/ram_info @@ -0,0 +1,4 @@ +used="$(free -m | grep Mem: | awk '{ print $3 }')" +shared="$(free -m | grep Mem: | awk '{ print $5 }')" +true_used=$(expr $shared + $used) +echo "$true_used*0.001" | bc -l diff --git a/home/hyprland/ironbar/config/scripts/ram_percentage b/home/hyprland/ironbar/config/scripts/ram_percentage new file mode 100755 index 00000000..db98b870 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/ram_percentage @@ -0,0 +1,7 @@ +total="$(free -m | grep Mem: | awk '{ print $2 }')" +used="$(free -m | grep Mem: | awk '{ print $3 }')" +shared="$(free -m | grep Mem: | awk '{ print $5 }')" +free=$(expr $total - $used - $shared) +true_used=$(expr $shared + $used) + +echo "($true_used/$total) * 100" | bc -l diff --git a/home/hyprland/ironbar/config/scripts/sys_info b/home/hyprland/ironbar/config/scripts/sys_info new file mode 100644 index 00000000..37364806 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/sys_info @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +## Files and Data +PREV_TOTAL=0 +PREV_IDLE=0 +cpuFile="/tmp/.cpu_usage" + +## Get CPU usage +get_cpu() { + if [[ -f "${cpuFile}" ]]; then + fileCont=$(cat "${cpuFile}") + PREV_TOTAL=$(echo "${fileCont}" | head -n 1) + PREV_IDLE=$(echo "${fileCont}" | tail -n 1) + fi + + CPU=($(cat /proc/stat | grep '^cpu ')) # Get the total CPU statistics. + unset CPU[0] # Discard the "cpu" prefix. + IDLE=${CPU[4]} # Get the idle CPU time. + + # Calculate the total CPU time. + TOTAL=0 + + for VALUE in "${CPU[@]:0:4}"; do + let "TOTAL=$TOTAL+$VALUE" + done + + if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then + # Calculate the CPU usage since we last checked. + let "DIFF_IDLE=$IDLE-$PREV_IDLE" + let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" + let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" + echo "${DIFF_USAGE}" + else + echo "?" + fi + + # Remember the total and idle CPU times for the next check. + echo "${TOTAL}" >"${cpuFile}" + echo "${IDLE}" >>"${cpuFile}" +} + +## Get Used memory +get_mem() { + printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') +} + +## Get Brightness +get_blight() { + CARD=$(ls /sys/class/backlight | head -n 1) + + if [[ "$CARD" == *"intel_"* ]]; then + BNESS=$(xbacklight -get) + LIGHT=${BNESS%.*} + else + BNESS=$(blight -d $CARD get brightness) + PERC="$(($BNESS * 100 / 255))" + LIGHT=${PERC%.*} + fi + + echo "$LIGHT" +} + +## Get Battery +get_battery() { + BAT=$(ls /sys/class/power_supply | grep BAT | head -n 1) + cat /sys/class/power_supply/${BAT}/capacity +} + +## Execute accordingly +if [[ "$1" == "--cpu" ]]; then + get_cpu +elif [[ "$1" == "--mem" ]]; then + get_mem +elif [[ "$1" == "--blight" ]]; then + get_blight +elif [[ "$1" == "--bat" ]]; then + get_battery +fi diff --git a/home/hyprland/ironbar/config/scripts/traffic.sh b/home/hyprland/ironbar/config/scripts/traffic.sh new file mode 100755 index 00000000..994f550f --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/traffic.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +#shows traffic on the specified device + +while :; do + function human_readable { + VALUE=$1 + BIGGIFIERS=(B K M G) + CURRENT_BIGGIFIER=0 + while [ $VALUE -gt 10000 ]; do + VALUE=$(($VALUE / 1000)) + CURRENT_BIGGIFIER=$((CURRENT_BIGGIFIER + 1)) + done + #echo "value: $VALUE" + #echo "biggifier: ${BIGGIFIERS[$CURRENT_BIGGIFIER]}" + echo "$VALUE${BIGGIFIERS[$CURRENT_BIGGIFIER]}" + } + + ###CHECKS#### + + DEVICE=$1 + IS_GOOD=0 + for GOOD_DEVICE in $(grep ":" /proc/net/dev | awk '{print $1}' | sed s/:.*//); do + if [ "$DEVICE" = "$GOOD_DEVICE" ]; then + IS_GOOD=1 + break + fi + done + if [ $IS_GOOD -eq 0 ]; then + echo "Device $DEVICE not found. Should be one of these:" + grep ":" /proc/net/dev | awk '{print $1}' | sed s/:.*// + exit 1 + fi + + ###REAL STUFF + LINE=$(grep $1 /proc/net/dev | sed s/.*://) + RECEIVED=$(echo $LINE | awk '{print $1}') + TRANSMITTED=$(echo $LINE | awk '{print $9}') + TOTAL=$(($RECEIVED + $TRANSMITTED)) + + SLP=1 + sleep $SLP + + LINE=$(grep $1 /proc/net/dev | sed s/.*://) + RECEIVED=$(echo $LINE | awk '{print $1}') + TRANSMITTED=$(echo $LINE | awk '{print $9}') + SPEED=$((($RECEIVED + $TRANSMITTED - $TOTAL) / $SLP)) + + echo "Current speed: $(human_readable $SPEED)/s" +done diff --git a/home/hyprland/ironbar/config/scripts/vol b/home/hyprland/ironbar/config/scripts/vol new file mode 100755 index 00000000..eb45fe17 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/vol @@ -0,0 +1,3 @@ +#! /usr/bin/env bash + +printf "[general]\nframerate=160\nbars = 7\n[output]\nmethod = raw\nraw_target = /dev/stdout\ndata_format = ascii\nascii_max_range = 7\n" | cava -p /dev/stdin | sed -u 's/;//g;s/0/▁/g;s/1/▂/g;s/2/▃/g;s/3/▄/g;s/4/▅/g;s/5/▆/g;s/6/▇/g;s/7/█/g; ' diff --git a/home/hyprland/ironbar/config/scripts/volume b/home/hyprland/ironbar/config/scripts/volume new file mode 100755 index 00000000..36927f96 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/volume @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2*100}' diff --git a/home/hyprland/ironbar/config/scripts/volume_icon b/home/hyprland/ironbar/config/scripts/volume_icon new file mode 100755 index 00000000..4817de0f --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/volume_icon @@ -0,0 +1,5 @@ +if [ -n "$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3}')" ];then + echo '' +else + echo '墳' +fi diff --git a/home/hyprland/ironbar/config/scripts/weather b/home/hyprland/ironbar/config/scripts/weather new file mode 100755 index 00000000..e6df28b6 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/weather @@ -0,0 +1,165 @@ +#!/usr/bin/env bash + +## Collect data +cache_dir="$HOME/.cache/eww/weather" +cache_weather_stat=${cache_dir}/weather-stat +cache_weather_degree=${cache_dir}/weather-degree +cache_weather_quote=${cache_dir}/weather-quote +cache_weather_hex=${cache_dir}/weather-hex +cache_weather_icon=${cache_dir}/weather-icon + +## Weather data +KEY=8289fc0cb3cc706f3078a8c86bea911f +ID=5288636 +UNIT=metric # Available options : 'metric' or 'imperial' + +## Make cache dir +if [[ ! -d "$cache_dir" ]]; then + mkdir -p ${cache_dir} +fi + +## Get data +get_weather_data() { + weather=$(curl -sf "http://api.openweathermap.org/data/2.5/weather?APPID="$KEY"&lat=24.963214912659005&lon=121.26339510521424&units="$UNIT"") + echo ${weather} + + if [ -n "$weather" ]; then + weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1) + weather_icon_code=$(echo "$weather" | jq -r ".weather[].icon" | head -1) + weather_description=$(echo "$weather" | jq -r ".weather[].description" | head -1 | sed -e "s/\b\(.\)/\u\1/g") + + #Big long case statement of doom + case "$weather_icon_code" in + 50d) + weather_icon=" " + weather_quote="Forecast says it's misty \nMake sure you don't get lost on your way..." + weather_hex="#84afdb" + ;; + 50n) + weather_icon=" " + weather_quote="Forecast says it's a misty night \nDon't go anywhere tonight or you might get lost..." + weather_hex="#84afdb" + ;; + 01d) + weather_icon=" " + weather_quote="It's a sunny day, gonna be fun! \nDon't go wandering all by yourself though..." + weather_hex="#ffd86b" + ;; + 01n) + weather_icon=" " + weather_quote="It's a clear night \nYou might want to take a evening stroll to relax..." + weather_hex="#fcdcf6" + ;; + 02d) + weather_icon=" " + weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..." + weather_hex="#adadff" + ;; + 02n) + weather_icon=" " + weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?" + weather_hex="#adadff" + ;; + 03d) + weather_icon=" " + weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..." + weather_hex="#adadff" + ;; + 03n) + weather_icon=" " + weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?" + weather_hex="#adadff" + ;; + 04d) + weather_icon=" " + weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..." + weather_hex="#adadff" + ;; + 04n) + weather_icon=" " + weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?" + weather_hex="#adadff" + ;; + 09d) + weather_icon=" " + weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..." + weather_hex="#6b95ff" + ;; + 09n) + weather_icon=" " + weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..." + weather_hex="#6b95ff" + ;; + 10d) + weather_icon=" " + weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..." + weather_hex="#6b95ff" + ;; + 10n) + weather_icon=" " + weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..." + weather_hex="#6b95ff" + ;; + 11d) + weather_icon="" + weather_quote="There's storm for forecast today \nMake sure you don't get blown away..." + weather_hex="#ffeb57" + ;; + 11n) + weather_icon="" + weather_quote="There's gonna be storms tonight \nMake sure you're warm in bed and the windows are shut..." + weather_hex="#ffeb57" + ;; + 13d) + weather_icon=" " + weather_quote="It's gonna snow today \nYou'd better wear thick clothes and make a snowman as well!" + weather_hex="#e3e6fc" + ;; + 13n) + weather_icon=" " + weather_quote="It's gonna snow tonight \nMake sure you get up early tomorrow to see the sights..." + weather_hex="#e3e6fc" + ;; + 40d) + weather_icon=" " + weather_quote="Forecast says it's misty \nMake sure you don't get lost on your way..." + weather_hex="#84afdb" + ;; + 40n) + weather_icon=" " + weather_quote="Forecast says it's a misty night \nDon't go anywhere tonight or you might get lost..." + weather_hex="#84afdb" + ;; + *) + weather_icon=" " + weather_quote="Sort of odd, I don't know what to forecast \nMake sure you have a good time!" + weather_hex="#adadff" + ;; + esac + + echo "$weather_icon" >${cache_weather_icon} + echo "$weather_description" >${cache_weather_stat} + echo "$weather_temp""°C" >${cache_weather_degree} + echo -e "$weather_quote" >${cache_weather_quote} + echo "$weather_hex" >${cache_weather_hex} + else + echo "Weather Unavailable" >${cache_weather_stat} + echo " " >${cache_weather_icon} + echo -e "Ah well, no weather huh? \nEven if there's no weather, it's gonna be a great day!" >${cache_weather_quote} + echo "-" >${cache_weather_degree} + echo "#adadff" >${tcache_weather_hex} + fi +} + +## Execute +case $1 in + --getdata) get_weather_data ;; + --mintemp) get_weather_data | jq ".main.temp_min" ;; + --maxtemp) get_weather_data | jq ".main.temp_max" ;; + --icon) cat ${cache_weather_icon} ;; + --temp) cat ${cache_weather_degree} ;; + --hex) cat ${cache_weather_hex} ;; + --stat) cat ${cache_weather_stat} ;; + --quote) cat ${cache_weather_quote} | head -n1 ;; + --quote2) cat ${cache_weather_quote} | tail -n1 ;; +esac diff --git a/home/hyprland/ironbar/config/scripts/wifi b/home/hyprland/ironbar/config/scripts/wifi new file mode 100755 index 00000000..4cf8f0fd --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/wifi @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +status=$(nmcli g | tail -n 1 | awk '{print $1}') +signal=$(nmcli -t -f in-use,signal device wifi list | rg "\*" | cut -d: -f2) +essid=$(nmcli -t -f in-use,ssid dev wifi | rg "\*" | cut -d: -f2) + +icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨") + +if [ "$status" = "disconnected" ]; then + icon="" + color="#988ba2" +else + level=$(awk -v n="$signal" 'BEGIN{print int(n/20)}') + if [ "$level" -gt 4 ]; then + level=4 + fi + + icon=${icons[$level]} + color="#cba6f7" +fi + +case $1 in + --COL) echo $color ;; + --ESSID) echo $essid ;; + --ICON) echo $icon ;; +esac diff --git a/home/hyprland/ironbar/config/scripts/wlr_mode b/home/hyprland/ironbar/config/scripts/wlr_mode new file mode 100755 index 00000000..dfacc534 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/wlr_mode @@ -0,0 +1,4 @@ +while : +do + socat -U - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read line; do echo $line | grep -o "submap>>.*" | cut -c 9- | sed 's/^.*,//' ;done +done diff --git a/home/hyprland/ironbar/config/scripts/wlr_window b/home/hyprland/ironbar/config/scripts/wlr_window new file mode 100755 index 00000000..78850d54 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/wlr_window @@ -0,0 +1,5 @@ +hyprctl activewindow -j | jq -r '.title' +while : +do + socat -U - UNIX-CONNECT:/tmp/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/.socket2.sock | while read line; do echo $line | grep -o "activewindow>>.*" | cut -c 15- | sed 's/^.*,//' | tr -d '\*' ; done +done diff --git a/home/hyprland/ironbar/config/scripts/workspace b/home/hyprland/ironbar/config/scripts/workspace new file mode 100755 index 00000000..6550e2b7 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/workspace @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +function array_sort() { + local -n ref=$1 + IFS=$'\n' ref=($(sort <<<"${ref[*]}")) + unset IFS +} +#initial check for occupied workspaces +set_mon="$1" +occupied_workspace=("$(hyprctl workspaces | grep " $set_mon" | awk '{print $3}')") +active_workspace="$(hyprctl monitors | grep " $set_mon" -A 3 | awk 'NR==4{print $3}')" +declare active_mon +declare last_created + +if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") +fi +array_sort occupied_workspace + +workspaces() { + if [[ ${1:0:9} == "workspace" ]]; then #set focused workspace + active_workspace=${1:11} + elif [[ ${1:0:15} == "createworkspace" ]] && [[ $active_mon == $set_mon ]]; then #add workspace to Occupied workspace + active_workspace=${1:17} + occupied_workspace+=("$active_workspace") + last_created=$active_workspace + array_sort occupied_workspace + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + fi + elif [[ ${1:0:16} == "destroyworkspace" ]] && [[ $active_mon == $set_mon ]]; then + # removing workspace from occupied + occupied_workspace=("${occupied_workspace[@]/${1:18}/}") + elif [[ ${1:0:10} == "focusedmon" ]]; then + string=${1:12} + monitor_name=${string/,*/} + active_workspace=${string##*,} + active_mon="$monitor_name" + if [[ $active_mon == $set_mon ]]; then + # for safety measures + occupied_workspace=("$(hyprctl workspaces | grep " $set_mon" | awk '{print $3}')") + active_workspace="$(hyprctl monitors | grep " $set_mon" -A 3 | awk 'NR==4{print $3}')" + array_sort occupied_workspace + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + fi + fi + # remove element + if [[ -n $last_created ]] && [[ $active_mon == "$set_mon" ]]; then + occupied_workspace=("${occupied_workspace[@]/$last_created/}") + fi + unset -v last_created + elif [[ ${1:0:13} == "moveworkspace" ]]; then + string=${1:15} + monitor_name=${string##*,} + active_workspace=${string/,*/} + if [[ $monitor_name == $set_mon ]]; then + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + fi + array_sort occupied_workspace + else + occupied_workspace=("${occupied_workspace[@]/$active_workspace/}") + fi + fi +} +module() { + #output eww widget + echo -n "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\"" + echo -n " (box :class \"works\" :orientation \"h\" :spacing 2 :space-evenly \"false\"" + for i in ${occupied_workspace[@]}; do + if [ $i = $active_workspace ]; then + echo -n " (button :onclick \"hyprctl dispatch workspace $i\" :class \"0act\" \"$i\") " + else + echo -n " (button :onclick \"hyprctl dispatch workspace $i\" :class \"0norm\" \"$i\") " + fi + done + echo -n " )" + echo ")" +} + +# initial +active_mon="$set_mon" +module +active_mon="$(hyprctl monitors | grep -B 7 "focused: yes" | awk 'NR==1{print $2;}')" + +socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do + workspaces "$event" + module +done diff --git a/home/hyprland/ironbar/config/scripts/workspace.bak b/home/hyprland/ironbar/config/scripts/workspace.bak new file mode 100755 index 00000000..f384e0ad --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/workspace.bak @@ -0,0 +1,70 @@ + export HYPRLAND_INSTANCE_SIGNATURE=$(ls /tmp/hypr/ | sort | tail -n 1) + colors=("#f38ba8" "#a6e3a1" "#89b4fa" "#fab387") + dimmed=("#794554" "#537150" "#445a7d" "#7d5943") + empty="#302d41" + focusedws=1 + declare -A o=([1]=0 [2]=0 [3]=0 [4]=0 [5]=0 [6]=0 [7]=0 [8]=0 [9]=0 [10]=0) + declare -A monitormap + declare -A workspaces + # sets color + status() { + if [[ ''${o[$1]} -eq 1 ]]; then + mon=''${monitormap[''${workspaces[$1]}]} + if [[ $focusedws -eq $1 ]]; then + echo -n "color: ''${colors[$mon]};" + else + echo -n "color: ''${dimmed[$mon]};" + fi + else + echo -n "color: $empty;" + fi + } + # handles workspace create/destroy + workspace_event() { + o[$1]=$2 + while read -r k v; do workspaces[$k]=$v; done < <(hyprctl -j workspaces | jq -r '.[]|"\(.id) \(.monitor)"') + } + # handles monitor (dis)connects + monitor_event() { + while read -r k v; do monitormap[$k]=$v; done < <(hyprctl -j monitors | jq -r '.[]|"\(.name) \(.id) "') + } + # generates the eww widget + generate() { + echo -n '(eventbox :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" (box :orientation "h" :class "module" :spacing 5 :space-evenly "true" ' + for i in {1..10}; do + echo -n "(button :onclick \"hyprctl dispatch workspace $i\" :class \"ws\" :style \"$(status $i)\" \"●\") " + done + echo '))' + } + # setup + # add monitors + monitor_event + # add workspaces + workspace_event 1 1 + # check occupied workspaces + for num in ''${!workspaces[@]}; do + o[$num]=1 + done + # generate initial widget + generate + # main loop + socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r line; do + case ''${line%>>*} in + "workspace") + focusedws=''${line#*>>} + ;; + "activemon") + focusedws=''${line#*,} + ;; + "createworkspace") + workspace_event ''${line#*>>} 1 + ;; + "destroyworkspace") + workspace_event ''${line#*>>} 0 + ;; + "monitor"*) + monitor_event + ;; + esac + generate + done diff --git a/home/hyprland/ironbar/config/scripts/workspace_own.sh b/home/hyprland/ironbar/config/scripts/workspace_own.sh new file mode 100755 index 00000000..cbde5e94 --- /dev/null +++ b/home/hyprland/ironbar/config/scripts/workspace_own.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +monitor=$1 +active_monitor="$(hyprctl monitors -j | jq ".[] | select(.id == $monitor)")" +active_workspace="$(echo $active_monitor | jq '.activeWorkspace.id')" +occupied_workspace=("$(hyprctl clients -j | jq -S "[ .[] | select(.monitor == $monitor) | .workspace.id ] | unique | .[]")") +if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + IFS=$'\n' occupied_workspace=($(sort <<<"${occupied_workspace[*]}")) + unset IFS +fi +workspaces() { + if [[ ${1:0:9} == "workspace" ]]; then + active_monitor="$(hyprctl monitors -j | jq ".[] | select(.id == $monitor)")" + active_workspace="$(echo $active_monitor | jq '.activeWorkspace.id')" + occupied_workspace=("$(hyprctl clients -j | jq -S "[ .[] | select(.monitor == $monitor) | .workspace.id ] | unique | .[]")") + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + IFS=$'\n' occupied_workspace=($(sort <<<"${occupied_workspace[*]}")) + unset IFS + fi + elif [[ ${1:0:15} == "createworkspace" ]]; then + active_monitor="$(hyprctl monitors -j | jq ".[] | select(.id == $monitor)")" + active_workspace="$(echo $active_monitor | jq '.activeWorkspace.id')" + occupied_workspace=("$(hyprctl clients -j | jq -S "[ .[] | select(.monitor == $monitor) | .workspace.id ] | unique | .[]")") + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + IFS=$'\n' occupied_workspace=($(sort <<<"${occupied_workspace[*]}")) + unset IFS + fi + elif [[ ${1:0:16} == "destroyworkspace" ]]; then + active_monitor="$(hyprctl monitors -j | jq ".[] | select(.id == $monitor)")" + active_workspace="$(echo $active_monitor | jq '.activeWorkspace.id')" + occupied_workspace=("$(hyprctl clients -j | jq -S "[ .[] | select(.monitor == $monitor) | .workspace.id ] | unique | .[]")") + if [[ ! "${occupied_workspace[*]}" =~ ${active_workspace} ]]; then + occupied_workspace+=("$active_workspace") + IFS=$'\n' occupied_workspace=($(sort <<<"${occupied_workspace[*]}")) + unset IFS + fi + fi +} +module() { + if [[ ${1:0:9} == "workspace" ]]; then + echo -n "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\"" + echo -n " (box :class \"works\" :orientation \"h\" :spacing 2 :space-evenly \"false\"" + for i in ${occupied_workspace[@]}; do + if [ $i = $active_workspace ]; then + echo -n " (button :onclick \"hyprctl dispatch workspace $i\" :class \"0act\" \"$i\") " + else + echo -n " (button :onclick \"hyprctl dispatch workspace $i\" :class \"0norm\" \"$i\") " + fi + done + echo -n " )" + echo ")" + fi +} + +# initial start +workspaces "$event" +module "workspace" + +# loop start +socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do + workspaces "$event" + module "$event" +done diff --git a/home/hyprland/ironbar/config/states/clock/state.sh b/home/hyprland/ironbar/config/states/clock/state.sh new file mode 100755 index 00000000..37ecebcc --- /dev/null +++ b/home/hyprland/ironbar/config/states/clock/state.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +LOCK="/tmp/clock.lock" +if [ -f "$LOCK" ]; then + exit 1 +else + exit 0 +fi diff --git a/home/hyprland/ironbar/config/states/internet/state.sh b/home/hyprland/ironbar/config/states/internet/state.sh new file mode 100755 index 00000000..6c2f54ac --- /dev/null +++ b/home/hyprland/ironbar/config/states/internet/state.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +LOCK="/tmp/internet.lock" +if [ -f "$LOCK" ]; then + exit 1 +else + exit 0 +fi diff --git a/home/hyprland/ironbar/config/states/soundbar/expand_soundbar b/home/hyprland/ironbar/config/states/soundbar/expand_soundbar new file mode 100755 index 00000000..35149913 --- /dev/null +++ b/home/hyprland/ironbar/config/states/soundbar/expand_soundbar @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +LOCK="/tmp/ironbar_soundbar.lock" + +if [ -f "$LOCK" ]; then + rm -rf "$LOCK" +else + touch "$LOCK" +fi diff --git a/home/hyprland/ironbar/config/states/soundbar/soundbar_state b/home/hyprland/ironbar/config/states/soundbar/soundbar_state new file mode 100755 index 00000000..ad3f8d78 --- /dev/null +++ b/home/hyprland/ironbar/config/states/soundbar/soundbar_state @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +LOCK="/tmp/ironbar_soundbar.lock" +if [ -f "$LOCK" ]; then + exit 0 +else + exit 1 +fi diff --git a/home/hyprland/ironbar/config/states/title/state.sh b/home/hyprland/ironbar/config/states/title/state.sh new file mode 100755 index 00000000..1cced7c5 --- /dev/null +++ b/home/hyprland/ironbar/config/states/title/state.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +LOCK="/tmp/title.lock" +if [ -f "$LOCK" ]; then + exit 1 +else + exit 0 +fi diff --git a/home/hyprland/ironbar/config/style.css b/home/hyprland/ironbar/config/style.css new file mode 100644 index 00000000..7743428b --- /dev/null +++ b/home/hyprland/ironbar/config/style.css @@ -0,0 +1,266 @@ +.container { + font-family: cjkFonts; + font-weight: bold; + font-size: 23px; +} + +#cava { + font-family: renogare; +} + +.time { + font-size: 23px; + font-weight: normal; + padding: 0px 10px 0px 10px; + background: linear-gradient(45deg, rgb(254, 240, 224) 0%, rgb(244, 169, 158) 50%, rgb(238, 214, 215) 100%); + background-size: 300% 300%; + animation: gradient 5s ease infinite; + text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); + box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; + border-radius: 16px; + margin: 10px 10px 10px 10px; + font-family: Renogare; +} + +.clock_date { + font-family: Renogare; + font-weight: normal; + font-size: 18; + color: rgb(49, 50, 68); +} + + +.background { + background-color: rgba(0, 0, 0, 0) +} + +.popup-clock { + font-weight: bolder; + background: rgb(36, 39, 58); +} + +.popup-pwr { + background: rgb(234, 153, 156); + color: rgb(48, 52, 70); + background: rgb(238, 190, 190); + background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%); + background-size: 300% 300%; + animation: gradient 10s ease infinite; + border: none; +} + +#power-btn { + padding: 0px 20px 0px 20px; + margin-top: 10px; + margin-bottom: 10px; + margin-right: 15px; + margin-left: 0px; + border-radius: 15px; + background: rgb(238, 190, 190); + background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%); + background-size: 300% 300%; + animation: gradient 10s ease infinite; + border: none; + font-weight: bolder; + box-shadow: rgba(0, 0, 0, 0.25) 2px 2px 5px 2px; +} + +#shutdown { + background: rgb(238, 190, 190); +} + +#reboot { + background: rgb(140, 170, 238); +} + +#hibernation { + box-shadow: rgba(0, 0, 0, 0.35) 2px 2px 5px 2px; + background: rgb(153, 209, 219); +} + +/* base */ +.sysinfo .item, +.script, +.tray { + padding: 0px 10px; + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + border-radius: 15px; + background: #cdd6f4; + color: #516079; + box-shadow: rgba(0, 0, 0, 0.116) 2px 2px 5px 2px; +} + +.scale, +.internet, +.script { + transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1); + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + padding-right: 20px; + padding-left: 20px; + padding-bottom: 3px; + box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; + text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); + border-radius: 15px; + background: rgb(202, 158, 230); + background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); + background-size: 300% 300%; + animation: gradient 5s ease infinite; + color: #fff; +} + + +scale trough { + border-radius: 16px; + background-color: #E7D4CB; + box-shadow: 0 2px 3px 2px rgba(00, 00, 00, 0.4); + min-height: 10px; + min-width: 70px; + margin: 0px 5px 10px 10px; +} + +scale value { + color: #77a5bf; + font-size: 0px; +} + +scale trough highlight { + background-image: linear-gradient(to right, #afcee0 30%, #92B6F4 50%, #77a5bf 100%); + border-radius: 10px; + background-color: #afcee0; +} + +.focused { + color: rgb(84, 111, 175); + font-size: 20px; + padding: 0px 10px 0px 10px; + margin: 10px 10px 10px 0px; + background: rgb(238, 190, 190); + background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%); + background-size: 300% 300%; + animation: gradient 5s ease infinite; + border-radius: 16px; +} + + +/* cpu */ +.sysinfo .item:nth-child(1) { + background: rgb(180, 190, 254); + background: linear-gradient(52deg, rgba(180, 190, 254, 1) 0%, rgba(137, 220, 235, 1) 32%, rgba(137, 180, 250, 1) 72%, rgba(166, 227, 161, 1) 100%); + background-size: 300% 300%; + animation: gradient 20s ease infinite; + text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); + /* background-color: #b4befe; */ + color: #fff; +} + +.clock { + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + padding-right: 20px; + padding-left: 20px; + padding-bottom: 3px; + box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; + text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); + border: none; + border-radius: 15px; + font-size: 24px; + background: rgb(202, 158, 230); + background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); + background-size: 300% 300%; + animation: gradient 10s ease infinite; + color: #fff; +} + +.tray { + color: rgb(84, 111, 175); + font-size: 15px; + padding: 0px 10px 0px 10px; + margin: 10px 10px 10px 0px; + background: rgb(238, 190, 190); + background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%); + background-size: 300% 300%; + animation: gradient 5s ease infinite; + border-radius: 16px; +} + +.tray>.passive { + -gtk-icon-effect: dim; +} + +.tray>.needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +.workspaces { + font-family: Renogare; + font-weight: normal; + font-size: 25px; + font-weight: normal; + margin: 10px 0px 0px 20px; + border-radius: 16px; +} + +.workspaces .item { + box-shadow: rgba(0, 0, 0, 0.116) 2 2 5 2px; + border: unset; + background: #fff; + border-radius: 15px; + margin: 10px 10px 15px 0px; + padding: 5px 20px 5px 20px; + color: #cba6f7; +} + +.workspaces .item.focused { + border: unset; + font-size: 25px; + transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1); + box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + padding: 5px 10px 5px 10px; + border-radius: 16px; + margin: 10px 10px 15px 0px; + background: rgb(202, 158, 230); + background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); + background-size: 300% 300%; + animation: gradient 10s ease infinite; + color: #fff; +} + + +@keyframes gradient { + 0% { + background-position: 0% 50%; + } + + 50% { + background-position: 100% 50%; + } + + 100% { + background-position: 0% 50%; + } +} + + +tooltip.background { + background-color: rgba(00, 00, 00, 0.5); + font-size: 18; + border-radius: 10px; + color: #FDFDFD; +} + +tooltip * { + padding: 4px; + background-color: transparent; + color: white; +} + +.host tooltip { + background-color: rgba(255, 00, 00, 0.5); +} \ No newline at end of file diff --git a/home/hyprland/ironbar/default.nix b/home/hyprland/ironbar/default.nix new file mode 100644 index 00000000..c48697b9 --- /dev/null +++ b/home/hyprland/ironbar/default.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ ironbar cava ]; + xdg.configFile.ironbar.source = ./config; +} diff --git a/home/hyprland/rofi/default.nix b/home/hyprland/rofi/default.nix index 2f54f418..43380376 100644 --- a/home/hyprland/rofi/default.nix +++ b/home/hyprland/rofi/default.nix @@ -4,11 +4,15 @@ stylix.targets.rofi.enable = true; programs.rofi = { enable = true; + package = pkgs.rofi-wayland; location = "center"; + terminal = "${pkgs.alacritty}/bin/alacritty"; pass = { enable = true; extraConfig = '' USERNAME_field='login' + backend=wtype + clibpoard_backend=wl-clipboard ''; }; extraConfig = {