diff --git a/lib/colors.nix b/lib/colors.nix deleted file mode 100644 index 33a19d6..0000000 --- a/lib/colors.nix +++ /dev/null @@ -1,71 +0,0 @@ -lib: -with lib; rec { - # color-related functions - - # convert rrggbb hex to #rrggbb - x = c: "#${c}"; - - # same as x but adds an alpha channel for transparency - xrgba = c: "${c}88"; - xargb = c: "88${c}"; - - # convert rrggbb hex to rgba(r, g, b, a) css - rgba = c: let - r = toString (hexToDec (__substring 0 2 c)); - g = toString (hexToDec (__substring 2 2 c)); - b = toString (hexToDec (__substring 4 2 c)); - res = "rgba(${r}, ${g}, ${b}, 0.5)"; - in - res; - - # general stuff - - # functions copied from https://gist.github.com/corpix/f761c82c9d6fdbc1b3846b37e1020e11 - # convert a hex value to an integer - hexToDec = v: let - hexToInt = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - "a" = 10; - "b" = 11; - "c" = 12; - "d" = 13; - "e" = 14; - "f" = 15; - "A" = 10; - "B" = 11; - "C" = 12; - "D" = 13; - "E" = 14; - "F" = 15; - }; - chars = stringToCharacters v; - charsLen = length chars; - in - foldl - (a: v: a + v) - 0 - (imap0 - (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) - chars); - - pow = let - pow' = base: exponent: value: - # FIXME: It will silently overflow on values > 2**62 :( - # The value will become negative or zero in this case - if exponent == 0 - then 1 - else if exponent <= 1 - then value - else (pow' base (exponent - 1) (value * base)); - in - base: exponent: pow' base exponent base; -} diff --git a/lib/default.nix b/lib/default.nix index 6f3d694..cfd50cb 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -21,6 +21,4 @@ lib.makeExtensible (self: { (b.filter (name: b.match ".*\.nix" name != null) fileNames); in filesToImport; - - colors = import ./colors.nix lib; }) diff --git a/users/modules/eww/css/_calendar.scss b/users/modules/eww/css/_calendar.scss deleted file mode 100644 index 2aadfa3..0000000 --- a/users/modules/eww/css/_calendar.scss +++ /dev/null @@ -1,32 +0,0 @@ -.calendar-win { - @include window; - background-color: $bg; - border: 1px solid $border; - color: $fg; - padding: .2em; -} - -calendar { - padding: 5px; - - :selected { - color: $mauve; - } - - .header { - color: $subtext1; - } - - .highlight { - color: $maroon; - font-weight: bold; - } - - .button { - color: $sapphire; - } - - :indeterminate { - color: $overlay0; - } -} diff --git a/users/modules/eww/css/_colors.scss b/users/modules/eww/css/_colors.scss deleted file mode 100644 index eba8236..0000000 --- a/users/modules/eww/css/_colors.scss +++ /dev/null @@ -1,35 +0,0 @@ -$rosewater: #f5e0dc; -$flamingo: #f2cdcd; -$pink: #f5c2e7; -$mauve: #cba6f7; -$red: #f38ba8; -$maroon: #eba0ac; -$peach: #fab387; -$yellow: #f9e2af; -$green: #a6e3a1; -$teal: #94e2d5; -$sky: #89dceb; -$sapphire: #74c7ec; -$blue: #89b4fa; -$lavender: #b4befe; - -$text: #cdd6f4; -$subtext1: #bac2de; -$subtext0: #a6adc8; -$overlay2: #9399b2; -$overlay1: #7f849c; -$overlay0: #6c7086; - -$surface2: #585b70; -$surface1: #45475a; -$surface0: #313244; - -$base: #1e1e2e; -$mantle: #181825; -$crust: #11111b; - -$fg: $text; -$bg: $base; -$bg1: $surface0; -$border: #28283d; -$shadow: $crust; diff --git a/users/modules/eww/css/_music.scss b/users/modules/eww/css/_music.scss deleted file mode 100644 index 2667609..0000000 --- a/users/modules/eww/css/_music.scss +++ /dev/null @@ -1,62 +0,0 @@ -.song-cover-art { - @include rounding; - background-position: center; - background-size: cover; - margin: 4px 5px 4px 0; - min-height: 24px; - min-width: 24px; -} - -.music-window { - @include window; - background-color: $bg; - border: 1px solid $border; - color: $fg; -} - -.music-cover-art { - background-position: center; - background-size: cover; - border-radius: 8px; - margin: 1em; - min-height: 170px; - min-width: 170px; -} - -.music-box { - margin: 1rem 1rem 1rem 0; -} - -.music-title { - font-weight: bold; - font-size: 1.1rem; -} - -.music-artist { - color: $subtext1; -} - -.music-button label { - color: $subtext1; - font-size: 2rem; -} - -.music-time { - color: $subtext1; - margin: 0 1rem; -} - -.music-bar scale { - highlight { - background-image: linear-gradient(to right, $teal 30%, $sky 100%); - border-radius: 24px; - } - - trough { - background-color: $bg1; - border-radius: 24px; - margin-top: 0; - min-height: 10px; - min-width: 170px; - } -} diff --git a/users/modules/eww/css/_notification.scss b/users/modules/eww/css/_notification.scss deleted file mode 100644 index ee143d5..0000000 --- a/users/modules/eww/css/_notification.scss +++ /dev/null @@ -1,59 +0,0 @@ -.notifications-box { - @include window; - background: $bg; - padding: 1rem; -} - -.notification { - background-color: $surface0; - border-bottom: 1px solid $bg; - padding: .5rem; - - box { margin-bottom: .5rem; } - - label { font-size: 1rem; } - - &:hover { - border: 1px solid $border; - } - - .appname { - color: $peach; - font-weight: bold; - } - - .summary { - color: $text; - font-weight: bold; - } - - .body { color: $text; } -} - -.container { - &:first-child { border-radius: 8px 8px 0 0; }; - &:last-child { border-radius: 0 0 8px 8px; }; -} - -.notification-header { - margin-bottom: 1rem; -} - -.notification-label { - color: $blue; - font-size: 1.5rem; -} - -.notification-action { - border-radius: 50%; - padding: .3rem; - - label { - color: $text; - font-size: 1.2rem; - } - - &:hover { - background: $surface0; - } -} diff --git a/users/modules/eww/css/_sidebar.scss b/users/modules/eww/css/_sidebar.scss deleted file mode 100644 index 1b32e84..0000000 --- a/users/modules/eww/css/_sidebar.scss +++ /dev/null @@ -1,109 +0,0 @@ -.system-menu-box { - @include window; - background-color: $bg; - border: 1px solid $border; - color: $text; -} - -.separator { - font-size: 1rem; -} - -.top-row { - margin: 1rem 1.5rem 0; -} - -.system-row { - margin: .5rem .7rem; - - .airplane-box button { - padding: 1rem 3rem; - } - - label { - font-size: 1rem; - margin: 0 .1rem; - } -} - -.element { - @include rounding; - background: $surface0; - margin: .3rem; - - button { - @include rounding; - padding: 1rem; - - label { - font-size: 1.5rem; - } - - &:hover { - background: $overlay0; - } - } -} - -.sliders { - @include rounding; - background-color: $surface0; - margin: .5rem 1rem; - padding: .6rem 1rem; - - scale { - margin-right: -1rem; - min-width: 21.5rem; - } - - box { margin: .2rem 0; } - - label { font-size: 1.2rem; } -} - -.volume-bar highlight { - @include rounding; - background-image: linear-gradient(to right, $teal 30%, $sky 100%); -} - -.brightness-slider-box scale highlight { - @include rounding; - background-image: linear-gradient(to right, $yellow 30%, $peach 100%); -} - -.time { font-size: 2rem; } -.date-box { - margin: 0 1rem; - - label { font-size: 1.1rem; } - - .date { - background: unset; - margin: 0 .5rem 0 0; - padding: 0; - } -} - -.battery-box { margin: .5rem 1rem; } -.battery-icon { font-size: 2rem; } -.battery-wattage { color: $mauve; } - -.battery-status { - color: $subtext0; - margin: 0 .5rem; -} - -.bottom-row button { - background-color: $surface0; - border-radius: 50%; - padding: .5rem; - margin: .5rem 1rem; - - label { - font-size: 1.5rem; - } - - &:hover { - background: $overlay0; - } -} diff --git a/users/modules/eww/css/_system.scss b/users/modules/eww/css/_system.scss deleted file mode 100644 index 3f5d032..0000000 --- a/users/modules/eww/css/_system.scss +++ /dev/null @@ -1,76 +0,0 @@ -.membar { - color: $peach; -} - -.cpubar { - color: $blue; -} - -.batbar { - color: $green; -} - -.membar, -.cpubar, -.batbar { - background-color: $bg1; -} - -.iconmem { - color: $peach; -} - -.iconcpu { - color: $blue; -} - -.icon-text { - font-size: 3rem; - padding: .7rem; -} - -.sys-text-sub { - color: $text; -} - -.sys-text-mem, -.sys-text-cpu { - font-size: 1rem; - font-weight: bold; -} - -.sys-icon-mem, -.sys-icon-cpu { - font-size: 1.5rem; - margin: 1.5rem; -} - -.system-info-box { - @include rounding; - background-color: $surface0; - margin: .5rem 1rem; - padding: .5rem; -} - -.sys-mem, -.sys-cpu { - background-color: $bg; -} - -.sys-icon-mem, -.sys-text-mem, -.sys-mem { - color: $peach; -} - -.sys-icon-cpu, -.sys-text-cpu, -.sys-cpu { - color: $blue; -} - -.sys-box { - margin: .3em; - - box { margin-left: 1rem; } -} diff --git a/users/modules/eww/css/_volume.scss b/users/modules/eww/css/_volume.scss deleted file mode 100644 index f64062f..0000000 --- a/users/modules/eww/css/_volume.scss +++ /dev/null @@ -1,5 +0,0 @@ -.vol-icon { color: $teal; } -.volbar highlight { - background-image: linear-gradient(to right, $teal 30%, $sky 100%); - border-radius: 10px; -} diff --git a/users/modules/eww/default.nix b/users/modules/eww/default.nix deleted file mode 100644 index 28e271f..0000000 --- a/users/modules/eww/default.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ - config, - pkgs, - inputs, - lib, - ... -}: let - dependencies = with pkgs; [ - config.wayland.windowManager.hyprland.package - config.programs.eww.package - # notifs - dunst - # utils - coreutils - findutils - gawk - gnused - jq - bash - bc - ripgrep - socat - procps - util-linux - wget - # brightness - light - # network - networkmanager - config.programs.rofi-nm.package - # volume - wireplumber - playerctl - pulseaudio - # session management - wlogout - # bluetooth - blueberry - bluez - # misc - dbus - udev - upower - ]; -in { - imports = [../rofi-nm]; - - programs.eww = { - enable = true; - package = inputs.eww.packages.${pkgs.system}.eww-wayland; - # remove nix files - configDir = lib.cleanSourceWith { - filter = name: _type: let - baseName = baseNameOf (toString name); - in - !(lib.hasSuffix ".nix" baseName); - src = lib.cleanSource ./.; - }; - }; - - home.packages = with pkgs; [ - material-icons - material-design-icons - (nerdfonts.override {fonts = ["Hack"];}) - ]; - - systemd.user.services.eww = { - Unit = { - Description = "Eww Daemon"; - # not yet implemented - # PartOf = ["tray.target"]; - PartOf = ["graphical-session.target"]; - }; - Service = { - Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath dependencies}"; - ExecStart = "${config.programs.eww.package}/bin/eww daemon --no-daemonize"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; -} diff --git a/users/modules/eww/eww.scss b/users/modules/eww/eww.scss deleted file mode 100644 index f16d095..0000000 --- a/users/modules/eww/eww.scss +++ /dev/null @@ -1,92 +0,0 @@ -@import 'css/colors'; - -@mixin rounding { - border-radius: 16px; -} - -@mixin window { - border: 1px solid $border; - box-shadow: 0 2px 3px $shadow; - margin: 5px 5px 10px; - @include rounding; -} - -* { - all: unset; - transition: 200ms ease; -} - -@import 'css/calendar'; -@import 'css/music'; -@import 'css/notification'; -@import 'css/sidebar'; -@import 'css/system'; -@import 'css/volume'; - -.bar { - background-color: $bg; - color: $fg; - - label { - font-size: 1.2rem; - } -} - -tooltip { - background: $bg; - border: 1px solid $border; - border-radius: 8px; - - label { - font-size: 1rem; - } -} - -.module { margin: 0 5px; } -.hour { font-weight: bold; } -.date { - background: $bg; - color: $flamingo; - margin-left: -1.15rem; - padding: 0 1rem; - - label { - font-size: 1.2rem; - } -} - -.bright-icon { color: $yellow; } - -.module-ssid, -.module-net { color: $lavender; } - -.module-bt { font-size: 1.2rem; } - -.separ { - color: $surface0; - font-size: 1.5rem; - padding-bottom: 2px; -} - -scale trough { - background-color: $bg1; - border-radius: 24px; - margin: 0 1rem; - min-height: 10px; - min-width: 70px; -} - -.ws { margin-top: .4rem; } -.workspaces { margin-left: 10px; } - -.launcher label { - background-color: $blue; - color: $bg; - font-family: monospace; - font-size: 1.5rem; - padding: 0 1.1rem 0 .5rem; -} - -.notif-toggle { - padding: 0 5px; -} diff --git a/users/modules/eww/eww.yuck b/users/modules/eww/eww.yuck deleted file mode 100644 index 867d159..0000000 --- a/users/modules/eww/eww.yuck +++ /dev/null @@ -1,77 +0,0 @@ -(include "./modules/bat.yuck") -(include "./modules/bluetooth.yuck") -(include "./modules/bright.yuck") -(include "./modules/clock.yuck") -(include "./modules/cpu.yuck") -(include "./modules/mem.yuck") -(include "./modules/music.yuck") -(include "./modules/net.yuck") -(include "./modules/variables.yuck") -(include "./modules/volume.yuck") - -(include "./windows/calendar.yuck") -(include "./windows/music.yuck") -(include "./windows/notifications.yuck") -(include "./windows/sidebar.yuck") - -(defwidget sep [] - (label :class "separ module" :text "|")) - -(defwidget notif-toggle [] - (button - :class "notif-toggle module" - :onclick "${EWW_CMD} open --toggle notifications"; - {notif_icons.icon})) - -; clipboard 󰅌 󰅍 󰄷 - -(defwidget workspaces [] - (literal :content workspace)) - -(defwidget left [] - (box - :space-evenly false - :halign "start" - (workspaces))) - -(defwidget right [] - (box - :space-evenly false - :halign "end" - (bright) - (volume-module) - (net) - (bluetooth) - (sep) - (cpu) - (mem) - (bat) - (sep) - (clock_module) - (notif-toggle))) - -(defwidget center [] - (box - :space-evenly false - :halign "center" - (music-module))) - -(defwidget bar [] - (centerbox - :class "bar" - (left) - (center) - (right))) - -(defwindow bar - :monitor 0 - :geometry (geometry :x "0%" - :y "0%" - :width "100%" - :height "32px" - :anchor "top center") - :stacking "fg" - :windowtype "dock" - :exclusive true - :wm-ignore false - (bar)) diff --git a/users/modules/eww/images/mic.png b/users/modules/eww/images/mic.png deleted file mode 100644 index d77f315..0000000 Binary files a/users/modules/eww/images/mic.png and /dev/null differ diff --git a/users/modules/eww/images/music.png b/users/modules/eww/images/music.png deleted file mode 100644 index 11804f5..0000000 Binary files a/users/modules/eww/images/music.png and /dev/null differ diff --git a/users/modules/eww/images/profile.png b/users/modules/eww/images/profile.png deleted file mode 100644 index 0190a36..0000000 Binary files a/users/modules/eww/images/profile.png and /dev/null differ diff --git a/users/modules/eww/images/speaker.png b/users/modules/eww/images/speaker.png deleted file mode 100644 index 79e005b..0000000 Binary files a/users/modules/eww/images/speaker.png and /dev/null differ diff --git a/users/modules/eww/modules/bat.yuck b/users/modules/eww/modules/bat.yuck deleted file mode 100644 index 07ac9f2..0000000 --- a/users/modules/eww/modules/bat.yuck +++ /dev/null @@ -1,10 +0,0 @@ -(defwidget bat [] - (circular-progress - :value "${EWW_BATTERY["BAT0"].capacity}" - :class "batbar module" - :style "color: ${battery.color};" - :thickness 3 - (button - :tooltip "battery on ${EWW_BATTERY["BAT0"].capacity}%" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/bluetooth.yuck b/users/modules/eww/modules/bluetooth.yuck deleted file mode 100644 index 13bcd2c..0000000 --- a/users/modules/eww/modules/bluetooth.yuck +++ /dev/null @@ -1,7 +0,0 @@ -(defwidget bluetooth [] - (button - :class "module-bt module" - :onclick "blueberry" - :tooltip "${bluetooth.text} ${bluetooth.batt_icon}" - :style "color: ${bluetooth.color};" - {bluetooth.icon})) diff --git a/users/modules/eww/modules/bright.yuck b/users/modules/eww/modules/bright.yuck deleted file mode 100644 index 3dfdfcc..0000000 --- a/users/modules/eww/modules/bright.yuck +++ /dev/null @@ -1,9 +0,0 @@ -(defwidget bright [] - (box - :class "module" - (eventbox - :onscroll "echo {} | sed -e 's/up/-U 1/g' -e 's/down/-A 1/g' | xargs light" - (label - :text {brightness.icon} - :class "bright-icon" - :tooltip "brightness ${round(brightness.level, 0)}%")))) diff --git a/users/modules/eww/modules/clock.yuck b/users/modules/eww/modules/clock.yuck deleted file mode 100644 index fce6f7a..0000000 --- a/users/modules/eww/modules/clock.yuck +++ /dev/null @@ -1,25 +0,0 @@ -(defvar date_rev false) - -(defwidget clock_module [] - (eventbox - :onhover "${EWW_CMD} update date_rev=true" - :onhoverlost "${EWW_CMD} update date_rev=false" - (overlay - :class "module" - (box - :space-evenly "false" - (label - :text {time.hour} - :class "clock hour") - (label - :text ":" - :class "clock") - (label - :text {time.minute} - :class "clock minute")) - (revealer - :reveal date_rev - (button - :class "date clock" - :onclick "${EWW_CMD} open --toggle calendar" - {time.date}))))) diff --git a/users/modules/eww/modules/cpu.yuck b/users/modules/eww/modules/cpu.yuck deleted file mode 100644 index f6ec05b..0000000 --- a/users/modules/eww/modules/cpu.yuck +++ /dev/null @@ -1,9 +0,0 @@ -(defwidget cpu [] - (circular-progress - :value "${EWW_CPU.avg}" - :class "cpubar module" - :thickness 3 - (button - :tooltip "using ${round(EWW_CPU.avg,0)}% cpu" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/mem.yuck b/users/modules/eww/modules/mem.yuck deleted file mode 100644 index af3f0d6..0000000 --- a/users/modules/eww/modules/mem.yuck +++ /dev/null @@ -1,9 +0,0 @@ -(defwidget mem [] - (circular-progress - :value {memory.percentage} - :class "membar module" - :thickness 3 - (button - :tooltip "using ${round(memory.percentage,0)}% ram" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/music.yuck b/users/modules/eww/modules/music.yuck deleted file mode 100644 index 4e7bb48..0000000 --- a/users/modules/eww/modules/music.yuck +++ /dev/null @@ -1,22 +0,0 @@ -(defwidget music-module [] - (eventbox - :onhover "${EWW_CMD} update music_reveal=true" - :onhoverlost "${EWW_CMD} update music_reveal=false" - (box - :class "module" - :space-evenly "false" - (box - :class "song-cover-art" - :style "background-image: url(\"${music_cover}\");") - (button - :class "module" - :onclick "${EWW_CMD} open --toggle music" - {music.title}) - (revealer - :transition "slideright" - :reveal music_reveal - :duration "350ms" - (box - (button :class "song-button" :onclick "playerctl previous" "") - (button :class "song-button" :onclick "playerctl play-pause" {music.status}) - (button :class "song-button" :onclick "playerctl next" "")))))) diff --git a/users/modules/eww/modules/net.yuck b/users/modules/eww/modules/net.yuck deleted file mode 100644 index d4834a1..0000000 --- a/users/modules/eww/modules/net.yuck +++ /dev/null @@ -1,7 +0,0 @@ -(defwidget net [] - (button - :class "module-net module" - :onclick "rofi-nm" - :tooltip {net.essid} - :style "color: ${net.color};" - {net.icon})) diff --git a/users/modules/eww/modules/variables.yuck b/users/modules/eww/modules/variables.yuck deleted file mode 100644 index fe3c6c7..0000000 --- a/users/modules/eww/modules/variables.yuck +++ /dev/null @@ -1,22 +0,0 @@ -(defvar bright_reveal false) -(defvar bt_rev false) -(defvar music_reveal false) -(defvar notif_rev false) -(defvar net_rev false) -(defvar time_rev false) -(defvar vol_reveal false) - -(defpoll time :interval "5s" `date +'{"date": "%d/%m", "hour": "%H", "minute": "%M", "day": "%A"}'`) - -(deflisten airplane "scripts/airplane") -(deflisten battery "scripts/battery") -(deflisten bluetooth "scripts/bluetooth") -(deflisten brightness "scripts/brightness") -(deflisten memory "scripts/memory") -(deflisten music "scripts/music") -(deflisten music_cover "scripts/music cover") -(deflisten notifications "scripts/notifications") -(deflisten notif_icons :initial `{"icon": "󰆄", "toggle_icon": ""}` "scripts/notifications icons") -(deflisten net "scripts/net") -(deflisten volume "scripts/volume") -(deflisten workspace "scripts/workspaces") diff --git a/users/modules/eww/modules/volume.yuck b/users/modules/eww/modules/volume.yuck deleted file mode 100644 index 2cdc7d8..0000000 --- a/users/modules/eww/modules/volume.yuck +++ /dev/null @@ -1,11 +0,0 @@ -(defwidget volume-module [] - (box - :class "module" - (eventbox - :onscroll "echo {} | sed -e 's/up/-/g' -e 's/down/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.005%" - :onclick "pavucontrol &" - :onrightclick "scripts/volume mute SINK" - (label - :class "vol-icon" - :tooltip "volume ${volume.percent}" - :text {volume.icon})))) diff --git a/users/modules/eww/scripts/airplane b/users/modules/eww/scripts/airplane deleted file mode 100755 index 8a976ae..0000000 --- a/users/modules/eww/scripts/airplane +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -icon() { - if [[ $STATUS == "no" ]]; then - echo "" - else - echo "" - fi -} - -toggle() { - if [[ $STATUS == "no" ]]; then - rfkill block all - notify-send --urgency=normal -i airplane-mode-symbolic "Airplane Mode" "Airplane mode has been turned on!" - else - rfkill unblock all - notify-send --urgency=normal -i airplane-mode-disabled-symbolic "Airplane Mode" "Airplane mode has been turned off!" - fi -} - -if [[ $1 == "toggle" ]]; then - toggle -else - while true; do - STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - icon - sleep 3; - done -fi diff --git a/users/modules/eww/scripts/battery b/users/modules/eww/scripts/battery deleted file mode 100755 index f49cf7e..0000000 --- a/users/modules/eww/scripts/battery +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -icons=("󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹") -icons_charging=("󰂆" "󰂇" "󰂈" "󰂉" "󰂅") - -# declare -A baticon=([10]="󰁺" [20]="󰁻" [30]="󰁼" [40]="󰁽" [50]="󰁾" [60]="󰁿" [70]="󰂀" [80]="󰂁" [90]="󰂂" [100]="󰁹") - -geticon() { - if [ "$STATE" = "Charging" ]; then - level=$(awk -v n="$CAPACITY" 'BEGIN{print int((n-1)/20)}') - echo "${icons_charging[$level]}" - else - level=$(awk -v n="$CAPACITY" 'BEGIN{print int((n-1)/10)}') - echo "${icons[$level]}" - fi -} - -status() { - if [ "$STATE" = "Charging" ]; then - echo -n "charging" - - if [ "$RATE" -gt 0 ]; then - echo ", $(gettime) left" - else - echo "" - fi - elif [ "$STATE" = "Discharging" ]; then - echo "$(gettime)h left" - else - echo "fully charged" - fi -} - -color() { - if [ "$CAPACITY" -le 20 ]; then - echo '#f38ba8' - else - echo '#a6e3a1' - fi -} - -wattage() { - echo "$(bc -l <<< "scale=1; $RATE / 1000000") W" -} - -gettime() { - FULL=$(cat /sys/class/power_supply/BAT0/energy_full) - NOW=$(cat /sys/class/power_supply/BAT0/energy_now) - - if [ "$RATE" -gt 0 ]; then - if [ "$STATE" = "Discharging" ]; then - EX="$NOW / $RATE" - else - EX="($FULL - $NOW) / $RATE" - fi - date -u -d@"$(bc -l <<< "$EX * 3600")" +%H:%M - fi -} - -while true; do - RATE=$(cat /sys/class/power_supply/BAT0/power_now) - CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity) - STATE=$(cat /sys/class/power_supply/BAT0/status) - - echo '{ "icon": "'"$(geticon)"'", "percentage": '"$CAPACITY"', "wattage": "'"$(wattage)"'", "status": "'"$(status)"'", "color": "'"$(color)"'" }' - sleep 3 -done \ No newline at end of file diff --git a/users/modules/eww/scripts/bluetooth b/users/modules/eww/scripts/bluetooth deleted file mode 100755 index d5ae345..0000000 --- a/users/modules/eww/scripts/bluetooth +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -declare -A baticon=([10]="󰤾" [20]="󰤿" [30]="󰥀" [40]="󰥁" [50]="󰥂" [60]="󰥃" [70]="󰥄" [80]="󰥅" [90]="󰥆" [100]="󰥈") - -toggle() { - status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block bluetooth - else - rfkill unblock bluetooth - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - while true; do - powered=$(bluetoothctl show | rg Powered | cut -f 2- -d ' ') - status=$(bluetoothctl info) - name=$(echo "$status" | rg Name | cut -f 2- -d ' ') - mac=$(echo "$status" | head -1 | awk '{print $2}' | tr ':' '_') - - if [[ "$(echo "$status" | rg Percentage)" != "" ]]; then - battery=$(upower -i /org/freedesktop/UPower/devices/headset_dev_"$mac" | rg percentage | awk '{print $2}' | cut -f 1 -d '%') - batt_icon=${baticon[$battery]} - else - batt_icon="" - fi - - if [ "$powered" = "yes" ]; then - if [ "$status" != "Missing device address argument" ]; then - text="$name" - icon="" - color="#b4befe" - else - icon="" - text="Disconnected" - color="#45475a" - fi - else - icon="" - text="Bluetooth off" - color="#45475a" - fi - - echo '{ "icon": "'"$icon"'", "batt_icon": "'"$batt_icon"'", "text": "'"$text"'", "color": "'"$color"'" }' - - sleep 3 - done -fi diff --git a/users/modules/eww/scripts/brightness b/users/modules/eww/scripts/brightness deleted file mode 100755 index 93002dd..0000000 --- a/users/modules/eww/scripts/brightness +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -icons=("" "" "") - -# initial -icon=${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]} -echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }' - -udevadm monitor | rg --line-buffered "backlight" | while read -r _; do - icon="${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]}" - - echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }' -done diff --git a/users/modules/eww/scripts/memory b/users/modules/eww/scripts/memory deleted file mode 100755 index 051c400..0000000 --- a/users/modules/eww/scripts/memory +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -while true; do - # human-readable - freeH=$(free -h --si | rg "Mem:") - # non-human-readable - freeN=$(free --mega | rg "Mem:") - - total="$(echo "$freeH" | awk '{ print $2 }')" - used="$(echo "$freeH" | awk '{ print $3 }')" - t="$(echo "$freeN" | awk '{ print $2 }')" - u="$(echo "$freeN" | awk '{ print $3 }')" - - free=$(printf '%.1fG' "$(bc -l <<< "($t - $u) / 1000")") - perc=$(printf '%.1f' "$(free -m | rg Mem | awk '{print ($3/$2)*100}')") - - echo '{ "total": "'"$total"'", "used": "'"$used"'", "free": "'"$free"'", "percentage": '"$perc"' }' - - sleep 3 -done diff --git a/users/modules/eww/scripts/music b/users/modules/eww/scripts/music deleted file mode 100755 index b8e7047..0000000 --- a/users/modules/eww/scripts/music +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash - -get_status() { - s=$1 - if [ "$s" = "Playing" ]; then - echo "" - else - echo "" - fi -} - -get_length_sec() { - len=$1 - if [ -z "$len" ]; then - echo 0 - else - bc <<< "$len / 1000000" - fi -} - -get_length_time() { - len=$1 - if [ -n "$len" ]; then - len=$(bc <<< "$len / 1000000 + 1") - date -d@"$len" +%M:%S - else - echo "" - fi -} - -get_position() { - pos=$1 - len=$2 - if [ -n "$pos" ]; then - bc -l <<< "$pos / $len * 100" - else - echo 0 - fi -} - -get_position_time() { - pos=$1 - len=$2 - if [ -n "$pos" ]; then - date -d@"$(bc <<< "$pos / 1000000")" +%M:%S - else - echo "" - fi -} - -get_cover() { - # COVER_URL=$1 - mkdir -p "$XDG_CACHE_HOME/eww_covers" - cd "$XDG_CACHE_HOME/eww_covers" || exit - - IMGPATH="$XDG_CACHE_HOME/eww_covers/cover_art.png" - - playerctl -F metadata mpris:artUrl 2>/dev/null | while read -r COVER_URL; do - if [[ "$COVER_URL" = https* ]]; then - if [ ! -e "$XDG_CACHE_HOME/eww_covers/$(basename "$COVER_URL")" ]; then - wget -N "$COVER_URL" -o /dev/null - fi - - rm "$IMGPATH" - ln -s "$(basename "$COVER_URL")" "$IMGPATH" - - echo "$IMGPATH" - elif [ "$COVER_URL" = "" ]; then - echo "" - else - echo "$COVER_URL" - fi - done -} - -if [ "$1" = "cover" ]; then - get_cover -else - playerctl -F metadata -f '{{title}}\{{artist}}\{{status}}\{{position}}\{{mpris:length}}' 2>/dev/null | while IFS="$(printf '\\')" read -r title artist status position len; do - echo '{"artist": "'"$artist"'", "title": "'"$title"'", "status": "'"$(get_status "$status")"'", "position": "'"$(get_position "$position" "$len")"'", "position_time": "'"$(get_position_time "$position" "$len")"'", "length": "'"$(get_length_time "$len")"'"}' #, "cover": "'"$(get_cover $art)"'" - done -fi diff --git a/users/modules/eww/scripts/net b/users/modules/eww/scripts/net deleted file mode 100755 index 91ada63..0000000 --- a/users/modules/eww/scripts/net +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -toggle() { - status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "wlan") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block wlan - else - rfkill unblock wlan - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - while true; do - status=$(nmcli g | tail -n 1 | awk '{print $1}') - signal=$(nmcli -f in-use,signal dev wifi | rg "\*" | awk '{ print $2 }') - essid=$(nmcli -t -f NAME connection show --active | head -n1) - - icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨") - - if [ "$status" = "disconnected" ] ; then - icon="" - color="#988ba2" - else - level=$(awk -v n="$signal" 'BEGIN{print int((n-1)/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 -fi diff --git a/users/modules/eww/scripts/notifications b/users/modules/eww/scripts/notifications deleted file mode 100755 index 28e5d80..0000000 --- a/users/modules/eww/scripts/notifications +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env bash - -tmp=$XDG_CACHE_HOME/dunst-history.json -lock="$XDG_CACHE_HOME/dunst-toggle.lock" -lockinfo="$XDG_CACHE_HOME/dunst-lock-info" - -touch $lockinfo - -declare ids -export toggle_icon="" - -get_ids() { - mapfile -t ids < <(dunstctl history | jq -r ".data[] | .[] | select(.appname.data != \"Spotify\") | .id.data") -} - -get_notif() { - echo -n '(box :class "container" :orientation "v" :space-evenly false ' - - for id in "${ids[@]}"; do - mapfile -t n < <(jq -r ".data[] | .[] | select(.id.data == $id) | .appname.data, .summary.data, .body.data" "$tmp" | sed -r '/^\s*$/d' | sed -e 's/\%/ percent/g') - echo -n '(eventbox :onclick "dunstctl history-pop '"$id"' && dunstctl action 0 && dunstctl close" ' - echo -n '(box :class "notification" :orientation "v" :width 300 :space-evenly false ' - echo -n '(box :space-evenly false :spacing 10 ' - echo -n '(label :halign "start" :xalign 0 :wrap true :class "summary" :text "'"${n[1]}"'")' - echo -n '(label :halign "end" :xalign 1 :wrap true :class "appname" :text "'"${n[0]}"'"))' - echo -n '(label :halign "start" :wrap true :class "body" :text "'"${n[2]}"'")))' - done - - echo ')' -} - -toggle() { - dunstctl set-paused toggle - - if [ ! -f "$lock" ]; then - export toggle_icon="" - touch "$lock" - else - export toggle_icon="" - rm "$lock" - fi - - echo "icon_change" > $lockinfo -} - -clear() { - systemctl --user restart dunst - echo "icon_change" > $lockinfo -} - -get_icon() { - if [ ${#ids[@]} -eq 0 ]; then - echo "󰆂" - else - echo "󰆄" - fi -} - -if [ "$1" == "toggle" ]; then - toggle - dunstctl history > "$tmp" -elif [ "$1" == "clear" ]; then - clear - dunstctl history > "$tmp" -elif [ "$1" == "icons" ]; then - dunstctl history > "$tmp" - get_ids - echo '{"toggle_icon": "'"$toggle_icon"'", "icon": "'"$(get_icon)"'"}' - tail -f "$lockinfo" | while read -r; do - get_ids - echo '{"toggle_icon": "'"$toggle_icon"'", "icon": "'"$(get_icon)"'"}' - done -else - dunstctl history > "$tmp" - get_ids - get_notif - tail -f "$tmp" 2>/dev/null | rg --line-buffered "aa\{sv\}" | while read -r; do - get_ids - get_notif - done -fi diff --git a/users/modules/eww/scripts/pop b/users/modules/eww/scripts/pop deleted file mode 100755 index 32ae3e0..0000000 --- a/users/modules/eww/scripts/pop +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -window() { -NAME=$1 -LOCK_FILE="$XDG_CACHE_HOME/eww_${NAME}.lock" - -if [ ! -f "$LOCK_FILE" ]; then - eww open "${NAME}_win" - touch "$LOCK_FILE" - echo "opened $NAME" -else - eww close "${NAME}_win" - rm "$LOCK_FILE" - echo "closed $NAME" -fi -} - -window "$1" diff --git a/users/modules/eww/scripts/reveal_toggle b/users/modules/eww/scripts/reveal_toggle deleted file mode 100755 index e535023..0000000 --- a/users/modules/eww/scripts/reveal_toggle +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -if [ "$($2 get "$1")" == "true" ]; then - state="false" -else - state="true" -fi - -$2 update "$1=$state" diff --git a/users/modules/eww/scripts/volume b/users/modules/eww/scripts/volume deleted file mode 100755 index 7e739a4..0000000 --- a/users/modules/eww/scripts/volume +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -volicons=("󰕿" "󰖀" "󰕾") - -vol() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | awk '{print int($2*100)}' -} -ismuted() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | rg -i muted - echo $? -} -setvol() { - wpctl set-volume @DEFAULT_AUDIO_"$1"@ "$(awk -v n="$2" 'BEGIN{print (n / 100)}')" -} -setmute() { - wpctl set-mute @DEFAULT_AUDIO_"$1"@ toggle -} - -if [ "$1" = "mute" ]; then - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only mute SINK or SOURCE"; exit 1 - fi - setmute "$2" -elif [ "$1" = "setvol" ]; then - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only set volume for SINK or SOURCE"; exit 1 - elif [ "$3" -lt 1 ] || [ "$3" -gt 100 ]; then - echo "Volume must be between 1 and 100"; exit 1 - fi - setvol "$2" "$3" -else - # initial values - lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') - ismuted=$(ismuted "SINK") - - if [ "$ismuted" = 1 ]; then - icon="${volicons[$lvl]}" - else - icon="" - fi - echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' - - # event loop - pactl subscribe | rg --line-buffered "change" | while read -r _; do - lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') - ismuted=$(ismuted "SINK") - - if [ "$ismuted" = 1 ]; then - icon="${volicons[$lvl]}" - else - icon="" - fi - echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' - done -fi diff --git a/users/modules/eww/scripts/workspaces b/users/modules/eww/scripts/workspaces deleted file mode 100755 index 897e8bd..0000000 --- a/users/modules/eww/scripts/workspaces +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -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 workspaces" :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#*>>} - ;; - "focusedmon") - focusedws=${line#*,} - ;; - "createworkspace") - workspace_event "${line#*>>}" 1 - ;; - "destroyworkspace") - workspace_event "${line#*>>}" 0 - ;; - "monitor"*) - monitor_event - ;; - esac - generate -done diff --git a/users/modules/eww/windows/calendar.yuck b/users/modules/eww/windows/calendar.yuck deleted file mode 100644 index 403d732..0000000 --- a/users/modules/eww/windows/calendar.yuck +++ /dev/null @@ -1,14 +0,0 @@ -(defwidget calendar-win [] - (box - :class "calendar-win" - (calendar))) - -(defwindow calendar - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "top right" - :width "0px" - :height "0px") - (calendar-win)) diff --git a/users/modules/eww/windows/music.yuck b/users/modules/eww/windows/music.yuck deleted file mode 100644 index 11ea20f..0000000 --- a/users/modules/eww/windows/music.yuck +++ /dev/null @@ -1,54 +0,0 @@ -(defwidget music [] - (box - :class "music-window" - :space-evenly false - (box - :class "music-cover-art" - :style "background-image: url(\"${music_cover}\");") - (box - :orientation "v" - :class "music-box" - (label - :class "music-title" - :wrap true - :limit-width 30 - :text {music.title}) - (label - :class "music-artist" - :wrap true - :limit-width 30 - :text {music.artist}) - (centerbox - :halign "center" - :class "music-button-box" - (button :class "music-button" :onclick "playerctl previous" "") - (button :class "music-button" :onclick "playerctl play-pause" {music.status}) - (button :class "music-button" :onclick "playerctl next" "")) - (box - :orientation "v" - (box - (label - :xalign 0 - :class "music-time" - :text {music.position_time}) - (label - :xalign 1 - :class "music-time" - :text {music.length})) - (box - :class "music-bar" - (scale - :onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`" - :value {music.position})))))) - -(defwindow music - :stacking "fg" - :focusable "false" - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :width "0%" - :height "0%" - :anchor "top center") - (music)) diff --git a/users/modules/eww/windows/music_win.yuck b/users/modules/eww/windows/music_win.yuck deleted file mode 100644 index 994751a..0000000 --- a/users/modules/eww/windows/music_win.yuck +++ /dev/null @@ -1,53 +0,0 @@ -(defwidget music_window [] - (box - :class "music-window" - (box - :class "music-cover-art" - :style "background-image: url(\"${music_cover}\");") - (box - :orientation "v" - :class "music-box" - (label - :class "music-title" - :limit-width 18 - :text {music.title}) - (label - :class "music-artist" - :wrap "true" - :limit-width 30 - :text {music.artist}) - (centerbox - :halign "center" - :class "music-button-box" - (button :class "music-button" :onclick "playerctl previous" "") - (button :class "music-button" :onclick "playerctl play-pause" {music.status}) - (button :class "music-button" :onclick "playerctl next" "")) - (box - :orientation "v" - (centerbox - (label - :xalign 0 - :class "music-time" - :text {music.position_time}) - (label) - (label - :xalign 1 - :class "music-time" - :text {music.length})) - (box - :class "music-bar" - (scale - :onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`" - :value {music.position})))))) - -(defwindow music_win - :stacking "fg" - :focusable "false" - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :width "0%" - :height "0%" - :anchor "top center") - (music_window)) diff --git a/users/modules/eww/windows/notifications.yuck b/users/modules/eww/windows/notifications.yuck deleted file mode 100644 index 10cd014..0000000 --- a/users/modules/eww/windows/notifications.yuck +++ /dev/null @@ -1,46 +0,0 @@ -(defwindow notifications - :geometry - (geometry - :x "0px" - :y "0px" - :width "0px" - :height "0px" - :anchor "right top") - :stacking "fg" - :monitor "0" -(notifications)) - -(defwidget notifications [] - (box - :class "notifications-box" - :orientation "v" - :space-evenly "false" - (box - :class "notification-header" - (label - :class "notification-label" - :halign "start" - :text "Notifications") - (box - :halign "end" - :space-evenly "false" - :spacing 10 - (button - :class "notification-action" - :tooltip "Refresh" - :onclick "dunstctl history > $XDG_CACHE_HOME/dunst-history.json" "") - (button - :class "notification-action" - :tooltip "Pause/Resume Notifications" - :onclick "scripts/notifications toggle" {notif_icons.toggle_icon}) - (button - :class "notification-action" - :tooltip "Clear Notifications" - :onclick "scripts/notifications clear" ""))) ; 󰅖 - (scroll - :vscroll "true" - :hscroll "false" - :height 500 - :width 300 - (literal - :content notifications)))) diff --git a/users/modules/eww/windows/sidebar.yuck b/users/modules/eww/windows/sidebar.yuck deleted file mode 100644 index 5350d97..0000000 --- a/users/modules/eww/windows/sidebar.yuck +++ /dev/null @@ -1,215 +0,0 @@ -(defwidget system-menu [] - (box - :class "system-menu-box" - :space-evenly false - :orientation "v" - (box - :class "top-row" - :space-evenly false - (label - :class "time" - :text "${time.hour}:${time.minute}") - (box - :class "date-box" - :space-evenly false - (label - :class "date" - :text {time.date}) - (label - :class "day" - :text {time.day}))) - - (centerbox - :class "system-row" - (box - :class "wifi-box" - :space-evenly false - :orientation "v" - (box - :class "element" - :space-evenly false - (button - :class "wifi-button" - :onclick "scripts/net toggle" - {net.icon}) - (label - :class "separator" - :text "|") - (button - :class "wifi-arrow-btn" - :onclick "eww close system-menu && nm-connection-editor &" - "")) - (label - :text {net.essid} - :xalign 0.5 - :limit-width 15)) - - (box - :class "bluetooth-box" - :space-evenly false - :orientation "v" - (box - :class "element" - :space-evenly false - (button - :class "bluetooth-button" - :onclick "scripts/bluetooth toggle" - {bluetooth.icon}) - (label - :class "separator" - :text "|") - (button - :class "bluetooth-arrow-btn" - :onclick "eww close system-menu && blueberry" - "")) - (label - :text {bluetooth.text} - :xalign 0.5 - :tooltip "${bluetooth.text} ${bluetooth.batt_icon}" - :limit-width 15)) - - (box - :class "airplane-box" - :space-evenly false - :orientation "v" - (box - :class "element" - (button - :class "airplane-button" - :onclick "scripts/airplane toggle" - airplane)) - (label - :text "Airplane Mode" - :xalign 0.5 - :limit-width 16))) - - (box - :class "sliders" - :orientation "v" - (box - :class "volume-slider-box" - :space-evenly false - (button - :class "volume-icon" - :onclick "scripts/volume mute SINK" - {volume.icon}) - (scale - :class "volume-bar" - :value {volume.percent} - :tooltip "volume on ${volume.percent}%" - :onchange "scripts/volume setvol SINK {}")) - (box - :class "volume-slider-box" - :space-evenly false - (button - :class "volume-icon" - :onclick "scripts/volume mute SOURCE" - "") - (scale - :class "volume-bar" - :value {volume.microphone} - :tooltip "mic on ${volume.microphone}%" - :onchange "scripts/volume setvol SOURCE {}")) - (box - :class "brightness-slider-box" - :space-evenly false - (button - :class "brightness-slider-icon" - {brightness.icon}) - (scale - :class "brightness-slider" - :value {brightness.level} - :marks true - :onchange "light -S {}"))) - - (box - :class "system-info-box" - - ; cpu - (box - :class "sys-box" - :space-evenly false - :halign "start" - (circular-progress - :value "${EWW_CPU.avg}" - :class "sys-cpu" - :thickness 3 - (label - :text "" - :class "sys-icon-cpu")) - (box - :orientation "v" - :vexpand "false" - (label - :text "cpu" - :halign "start" - :class "sys-text-cpu") - (label - :text "${round(EWW_CPU.avg,2)}%" - :halign "start" - :class "sys-text-sub") - (label - :text "${EWW_CPU.cores[0].freq} MHz" - :halign "start" - :class "sys-text-sub"))) - - ; memory - (box - :class "sys-box" - :space-evenly false - :halign "end" - (circular-progress - :value {memory.percentage} - :class "sys-mem" - :thickness 3 - (label - :text "" - :class "sys-icon-mem")) - (box - :orientation "v" - (label - :text "memory" - :halign "start" - :class "sys-text-mem") - (label - :text "${memory.used} | ${memory.total}" - :halign "start" - :class "sys-text-sub")))) - - (box - :class "bottom-row" - (box - :class "battery-box" - :space-evenly false - :halign "start" - (label - :class "battery-icon" - :style "color: ${battery.color}" - :text {battery.icon}) - (label - :class "battery-percentage" - :text {EWW_BATTERY["BAT0"].capacity}) - (label - :class "battery-status" - :text {battery.status}) - (label - :class "battery-wattage" - :text {battery.wattage})) - (button - :class "power-button" - :halign "end" - :onclick "wlogout -p layer-shell &" "")))) - -;; windows -(defwindow system-menu - :stacking "fg" - :windowtype "dock" - :wm-ignore true - :monitor "0" - :geometry (geometry - :x "0" - :y "0" - :width "0%" - :height "0%" - :anchor "right top") - (system-menu)) diff --git a/users/modules/eww/windows/system.yuck b/users/modules/eww/windows/system.yuck deleted file mode 100644 index 7e34619..0000000 --- a/users/modules/eww/windows/system.yuck +++ /dev/null @@ -1,93 +0,0 @@ -(defwidget system [] - (box - :class "sys-win" - :orientation "v" - - ; cpu - (box - :class "sys-box" - :space-evenly "false" - :halign "start" - (circular-progress - :value "${EWW_CPU.avg}" - :class "sys-cpu" - :thickness "3" - (label - :text "" - :class "sys-icon-cpu")) - (box - :orientation "v" - :vexpand "false" - (label - :text "cpu" - :halign "start" - :class "sys-text-cpu") - (label - :text "${round(EWW_CPU.avg,2)}%" - :halign "start" - :class "sys-text-sub") - (label - :text "${EWW_CPU.cores[0].freq} MHz" - :halign "start" - :class "sys-text-sub"))) - - ; memory - (box - :class "sys-box" - :space-evenly "false" - :halign "start" - (circular-progress - :value {memory.percentage} - :class "sys-mem" - :thickness "3" - (label - :text "" - :class "sys-icon-mem")) - (box - :orientation "v" - (label - :text "memory" - :halign "start" - :class "sys-text-mem" ) - (label - :text "${memory.used} | ${memory.total}" - :halign "start" - :class "sys-text-sub" ))) - - ; battery - (box - :class "sys-box" - :space-evenly "false" - (circular-progress - :value "${EWW_BATTERY["BAT0"].capacity}" - :class "sys-bat" - :style "color: ${battery.color};" - :thickness 3 - (label - :text "" - :style "color: ${battery.color};" - :class "sys-icon-bat" )) - (box - :orientation "v" - (label - :text "battery" - :halign "start" - :class "sys-text-bat" ) - (label - :text "${EWW_BATTERY["BAT0"].capacity}% | ${battery.wattage}" - :halign "start" - :class "sys-text-sub" ) - (label - :text "${battery.status}" - :halign "start" - :class "sys-text-sub" ))))) - -(defwindow system_win - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "top right" - :width "0" - :height "0") - (system)) diff --git a/users/modules/eww/windows/volume_win.yuck b/users/modules/eww/windows/volume_win.yuck deleted file mode 100644 index 1af972f..0000000 --- a/users/modules/eww/windows/volume_win.yuck +++ /dev/null @@ -1,46 +0,0 @@ -(defwidget volume_window [] - (box - :class "volume-window" - :orientation "v" - (box - :space-evenly "false" - (label - :class "volume-icon" - :text "") - (box - :orientation "v" - :class "volume-info" - (label - :class "volume-text" - :text "speaker") - (scale - :class "volume-bar" - :value {volume.percent} - :tooltip "volume on ${volume.percent}%" - :onchange "scripts/volume setvol SINK {}"))) - (box - :space-evenly "false" - (label - :class "volume-icon" - :text "") - (box - :orientation "v" - :class "volume-info" - (label - :class "volume-text" - :text "mic") - (scale - :class "volume-bar" - :value {volume.microphone} - :tooltip "mic on ${volume.microphone}%" - :onchange "scripts/volume setvol SOURCE {}"))))) - -(defwindow volume_win - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "top right" - :width "0" - :height "0") - (volume_window)) diff --git a/users/modules/hikari/default.nix b/users/modules/hikari/default.nix deleted file mode 100644 index 2872bdf..0000000 --- a/users/modules/hikari/default.nix +++ /dev/null @@ -1,206 +0,0 @@ -{ - fontComb ? "Iosevka 10", - config, - pkgs, - ... -}: { - home.packages = with pkgs; [hikari xwayland]; - xdg = { - enable = true; - configFile = { - "hikari/hikari.conf".text = '' - ui { - border = 1 - gap = 0 - step = 120 - font = "${fontComb}" - - colorscheme { - background = 0x282C34 - foreground = 0x000000 - selected = 0xF5E094 - grouped = 0xFDAF53 - first = 0xB8E673 - conflict = 0xED6B32 - insert = 0xE3C3FA - active = 0xFFFFFF - inactive = 0x465457 - } - } - - outputs { - "*" { - background = "${config.home.homeDirectory}/wallpaper.png" - } - } - - inputs { - keyboards { - "*" { - xkb = { - layout = "tr" - } - } - } - pointers { - "*" { - accel-profile = "flat" - } - } - } - - layouts { - # main stack - s = { - scale = { - min = 0.5 - max = 0.75 - } - left = single - right = stack - } - - # main queue - q = { - scale = 0.75 - top = single - bottom = queue - } - - f = full - h = stack - v = queue - g = grid - } - - actions { - terminal = "${pkgs.alacritty}/bin/alacritty" - run = "${pkgs.wofi}/bin/wofi --show drun" - } - - bindings { - keyboard { - "L+0" = workspace-switch-to-sheet-0 - "L+1" = workspace-switch-to-sheet-1 - "L+2" = workspace-switch-to-sheet-2 - "L+3" = workspace-switch-to-sheet-3 - "L+4" = workspace-switch-to-sheet-4 - "L+5" = workspace-switch-to-sheet-5 - "L+6" = workspace-switch-to-sheet-6 - "L+7" = workspace-switch-to-sheet-7 - "L+8" = workspace-switch-to-sheet-8 - "L+9" = workspace-switch-to-sheet-9 - "L+numbersign" = workspace-switch-to-sheet-alternate - "L+Period" = workspace-switch-to-sheet-current - "L+j" = workspace-switch-to-sheet-next - "L+k" = workspace-switch-to-sheet-prev - "L+Comma" = workspace-switch-to-sheet-next-inhabited - "LS+Comma" = workspace-switch-to-sheet-prev-inhabited - "LSC+g" = workspace-show-group - "LSC+i" = workspace-show-invisible - "LSC+Period" = workspace-show-all - "LC+n" = workspace-cycle-next - "LC+p" = workspace-cycle-prev - - "LC+i" = sheet-show-invisible - "LC+Period" = sheet-show-all - "LC+g" = sheet-show-group - - "LA+r" = layout-reset - "LA+Return" = layout-restack-append - "LAS+Return" = layout-restack-prepend - "L+Home" = layout-cycle-view-first - "L+End" = layout-cycle-view-last - "L+n" = layout-cycle-view-next - "L+p" = layout-cycle-view-prev - "L+x" = layout-exchange-view-next - "LS+x" = layout-exchange-view-prev - "LA+x" = layout-exchange-view-main - - "LS+0" = view-pin-to-sheet-0 - "LS+1" = view-pin-to-sheet-1 - "LS+2" = view-pin-to-sheet-2 - "LS+3" = view-pin-to-sheet-3 - "LS+4" = view-pin-to-sheet-4 - "LS+5" = view-pin-to-sheet-5 - "LS+6" = view-pin-to-sheet-6 - "LS+7" = view-pin-to-sheet-7 - "LS+8" = view-pin-to-sheet-8 - "LS+9" = view-pin-to-sheet-9 - "LS+numbersign" = view-pin-to-sheet-alternate - "LS+Period" = view-pin-to-sheet-current - "LS+j" = view-pin-to-sheet-next - "LS+k" = view-pin-to-sheet-prev - - "L+q" = view-quit - "L+Tab" = view-cycle-next - "LS+Tab" = view-cycle-prev - - "L+Up" = view-move-up - "L+Down" = view-move-down - "L+Left" = view-move-left - "L+Right" = view-move-right - "LA+Up" = view-decrease-size-up - "LAS+Up" = view-increase-size-up - "LA+Down" = view-increase-size-down - "LAS+Down" = view-decrease-size-down - "LA+Left" = view-decrease-size-left - "LAS+Left" = view-increase-size-left - "LA+Right" = view-increase-size-right - "LAS+Right" = view-decrease-size-right - "LS+Up" = view-snap-up - "LS+Down" = view-snap-down - "LS+Left" = view-snap-left - "LS+Right" = view-snap-right - "L+r" = view-reset-geometry - - "L+minus" = view-toggle-maximize-vertical - "L+less" = view-toggle-maximize-horizontal - "L+f" = view-toggle-maximize-full - "L5+plus" = view-toggle-floating - "L+i" = view-toggle-invisible - "L5+p" = view-toggle-public - - "L+l" = mode-enter-layout - "L+s" = mode-enter-sheet-assign - "L+g" = mode-enter-group-assign - "L+m" = mode-enter-mark-assign - "L+acute" = mode-enter-mark-select - "LS+acute" = mode-enter-mark-switch-select - "LCA+g" = mode-enter-input-grab - - "LS+Backspace" = lock - "LCA+q" = quit - "LCA+r" = reload - - "L+Return" = action-terminal - "L+d" = action-run - - "A+F1" = vt-switch-to-1 - "A+F2" = vt-switch-to-2 - "A+F3" = vt-switch-to-3 - "A+F4" = vt-switch-to-4 - "A+F5" = vt-switch-to-5 - "A+F6" = vt-switch-to-6 - "A+F7" = vt-switch-to-7 - "A+F8" = vt-switch-to-8 - "A+F9" = vt-switch-to-9 - } - - mouse { - "L+left" = mode-enter-move - "L+right" = mode-enter-resize - } - } - ''; - "hikari/autostart".source = "${ - pkgs.writeScriptBin - "hikari-autostart" - '' - #!${pkgs.stdenv.shell} - ${pkgs.waybar}/bin/waybar & - '' - }/bin/hikari-autostart"; - }; - }; -}