update eww stuff

This commit is contained in:
dusk 2022-10-22 23:54:44 +03:00
parent e94eb28e54
commit 2d014546bd
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
35 changed files with 899 additions and 483 deletions

View File

@ -0,0 +1,16 @@
{pkgs, ...}: {
services.greetd = {
enable = true;
settings = {
terminal.vt = 1;
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --issue --time --cmd 'apply-hm-env Hyprland'";
user = "greeter";
};
};
};
systemd.services = {
"getty@tty1".enable = false;
"autovt@tty1".enable = false;
};
}

View File

@ -1,8 +1,7 @@
.calendar-window {
@include wshadow;
.calendar-win {
@include window;
background-color: $bg;
border: 1px solid $border;
border-radius: 16px;
color: $fg;
padding: .2em;
}
@ -12,7 +11,6 @@ calendar {
:selected {
color: $mauve;
font-weight: bold;
}
.header {
@ -23,4 +21,12 @@ calendar {
color: $maroon;
font-weight: bold;
}
.button {
color: $sapphire;
}
:indeterminate {
color: $overlay0;
}
}

View File

@ -32,4 +32,4 @@ $fg: $text;
$bg: $base;
$bg1: $surface0;
$border: #28283d;
$shadow: $surface1;
$shadow: $crust;

View File

@ -1,17 +1,16 @@
.song-cover-art {
@include rounding;
background-position: center;
background-size: cover;
border-radius: 16px;
margin: 4px 5px 4px 0;
min-height: 24px;
min-width: 24px;
}
.music-window {
@include wshadow;
@include window;
background-color: $bg;
border: 1px solid $border;
border-radius: 16px;
color: $fg;
}
@ -30,11 +29,11 @@
.music-title {
font-weight: bold;
font-size: 1.1rem;
}
.music-artist {
color: $subtext1;
font-size: 1.2rem;
}
.music-button label {
@ -44,7 +43,6 @@
.music-time {
color: $subtext1;
font-size: 1rem;
margin: 0 1rem;
}

View File

@ -1,42 +1,59 @@
.side {
padding: 1em;
.notifications-box {
@include window;
background: $bg;
border-radius: 16px;
@include wshadow;
padding: 1rem;
}
.notification {
background-color: $crust;
padding: 1rem;
border-radius: 8px;
:hover {
background-color: $surface0;
border-bottom: 1px solid $bg;
padding: .5rem;
box { margin-bottom: .5rem; }
label { font-size: 1rem; }
&:hover {
border: 1px solid $border;
}
.appname {
font-size: 0.9rem;
font-weight: bold;
color: $peach;
font-weight: bold;
}
.summary {
font-size: 1.1rem;
font-weight: bold;
color: $text;
font-weight: bold;
}
.body {
color: $text;
}
.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 {
font-size: 1.5rem;
color: $blue;
font-size: 1.5rem;
}
.notification-action {
font-size: 2rem;
color: $text;
margin-left: 1rem;
border-radius: 50%;
padding: .3rem;
label {
color: $text;
font-size: 1.2rem;
}
&:hover {
background: $surface0;
}
}

View File

@ -0,0 +1,109 @@
.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;
}
}

View File

@ -20,10 +20,6 @@
color: $peach;
}
.iconbat {
color: $green;
}
.iconcpu {
color: $blue;
}
@ -35,35 +31,30 @@
.sys-text-sub {
color: $text;
font-size: 1.2rem;
margin-left: 2rem;
}
.sys-text-mem,
.sys-text-cpu,
.sys-text-bat {
.sys-text-cpu {
font-size: 1rem;
font-weight: bold;
margin-left: 2rem;
}
.sys-icon-mem,
.sys-icon-cpu,
.sys-icon-bat {
font-size: 30px;
margin: 25px;
.sys-icon-cpu {
font-size: 1.5rem;
margin: 1.5rem;
}
.sys-win {
@include wshadow;
background-color: $bg;
border: 1px solid $border;
border-radius: 16px;
.system-info-box {
@include rounding;
background-color: $surface0;
margin: .5rem 1rem;
padding: .5rem;
}
.sys-mem,
.sys-cpu,
.sys-bat {
background-color: $bg1;
.sys-cpu {
background-color: $bg;
}
.sys-icon-mem,
@ -78,14 +69,8 @@
color: $blue;
}
.sys-icon-bat,
.sys-text-bat,
.sys-bat {
color: $green;
}
.sys-box {
margin: 1em;
margin: .3em;
box { margin-left: 1rem; }
}

View File

@ -3,37 +3,3 @@
background-image: linear-gradient(to right, $teal 30%, $sky 100%);
border-radius: 10px;
}
.volume-window {
@include wshadow;
background-color: $bg;
border-radius: 16px;
padding-right: 1rem;
}
.volume-text {
color: $teal;
font-size: 1.5rem;
font-weight: bold;
}
.volume-icon {
color: $teal;
font-size: 5rem;
margin: 1rem;
}
.volume-info {
margin: 1rem 0;
}
.volume-bar {
trough {
min-width: 120px;
}
highlight {
background-image: linear-gradient(to right, $teal 30%, $sky 100%);
border-radius: 16px;
}
}

View File

@ -5,38 +5,46 @@
lib,
...
}: let
dependencies =
config.home.packages
++ (with pkgs; [
config.wayland.windowManager.hyprland.package
config.programs.eww.package
bash
bc
bluez
coreutils
dbus
dunst
findutils
gawk
gnused
jq
light
networkmanager
playerctl
procps
pulseaudio
ripgrep
socat
udev
upower
wget
wireplumber
]);
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];
# home.packages = [inputs.eww.packages.${pkgs.system}.eww-wayland];
# home.file.".config/eww".source = config.lib.file.mkOutOfStoreSymlink ./.;
programs.eww = {
enable = true;
package = inputs.eww.packages.${pkgs.system}.eww-wayland;

View File

@ -1,54 +1,71 @@
@import 'css/colors';
@mixin wshadow {
box-shadow: 0 5px 10px $shadow;
margin: 15px 20px 25px;
@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;
font-size: 1.2rem;
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; }
.clock { font-size: 1.4rem; }
.hour { font-weight: bold; }
.date {
label {
font-size: 1.4rem;
}
background: $bg;
color: $flamingo;
margin-left: -1rem;
margin-left: -1.15rem;
padding: 0 1rem;
label {
font-size: 1.2rem;
}
}
.bright-icon { color: $yellow; }
.brightbar trough highlight {
background-image: linear-gradient(to right, $yellow 30%, $peach 100%);
border-radius: 10px;
}
.module-ssid,
.module-net { color: $lavender; }
.module-bt { font-size: 1.2rem; }
.separ {
color: $surface0;
padding-bottom: 2px;
font-size: 1.5rem;
padding-bottom: 2px;
}
scale trough {

View File

@ -10,10 +10,9 @@
(include "./modules/volume.yuck")
(include "./windows/calendar.yuck")
(include "./windows/music_win.yuck")
(include "./windows/music.yuck")
(include "./windows/notifications.yuck")
(include "./windows/system.yuck")
(include "./windows/volume_win.yuck")
(include "./windows/sidebar.yuck")
(defwidget sep []
(label :class "separ module" :text "|"))
@ -21,7 +20,7 @@
(defwidget notif-toggle []
(button
:class "notif-toggle module"
:onclick "scripts/reveal_toggle notification_rev ${EWW_CMD}";
:onclick "${EWW_CMD} open --toggle notifications";
{notif_icons.icon}))
; clipboard 󰅌 󰅍 󰄷
@ -40,7 +39,7 @@
:space-evenly false
:halign "end"
(bright)
(volume)
(volume-module)
(net)
(bluetooth)
(sep)
@ -55,7 +54,7 @@
(box
:space-evenly false
:halign "center"
(music)))
(music-module)))
(defwidget bar []
(centerbox

View File

@ -6,5 +6,5 @@
:thickness 3
(button
:tooltip "battery on ${EWW_BATTERY["BAT0"].capacity}%"
:onclick "./scripts/pop system"
:onclick "${EWW_CMD} open --toggle system-menu"
(label :class "icon-text" :text ""))))

View File

@ -1,19 +1,7 @@
(defwidget bluetooth []
(eventbox
:onhover "${EWW_CMD} update bt_rev=true"
:onhoverlost "${EWW_CMD} update bt_rev=false"
(box
:space-evenly "false"
(revealer
:transition "slideright"
:reveal bt_rev
:duration "350ms"
(label
:class "module-bt module"
:style "color: ${bluetooth.color};"
:text {bluetooth.text}))
(button
:class "module-bt module"
:onclick "rofi-bluetooth"
:style "color: ${bluetooth.color};"
{bluetooth.icon}))))
(button
:class "module-bt module"
:onclick "blueberry"
:tooltip "${bluetooth.text} ${bluetooth.batt_icon}"
:style "color: ${bluetooth.color};"
{bluetooth.icon}))

View File

@ -1,21 +1,9 @@
(defwidget bright []
(eventbox
:onhover "${EWW_CMD} update bright_reveal=true"
:onhoverlost "${EWW_CMD} update bright_reveal=false"
(box
:class "module"
:space-evenly "false"
:spacing "3"
(revealer
:transition "slideleft"
:reveal bright_reveal
:duration "350ms"
(scale
:class "brightbar"
:value {brightness.level}
:tooltip "${brightness.level}%"
:onchange "light -S {}"))
(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 ${brightness.level}%"))))
:tooltip "brightness ${round(brightness.level, 0)}%"))))

View File

@ -2,8 +2,8 @@
(defwidget clock_module []
(eventbox
:onhover "${EWW_CMD} update time_rev=false; ${EWW_CMD} update date_rev=true"
:onhoverlost "${EWW_CMD} update time_rev=false; ${EWW_CMD} update date_rev=false"
:onhover "${EWW_CMD} update date_rev=true"
:onhoverlost "${EWW_CMD} update date_rev=false"
(overlay
:class "module"
(box
@ -21,5 +21,5 @@
:reveal date_rev
(button
:class "date clock"
:onclick "./scripts/pop calendar"
:onclick "${EWW_CMD} open --toggle calendar"
{time.date})))))

View File

@ -5,5 +5,5 @@
:thickness 3
(button
:tooltip "using ${round(EWW_CPU.avg,0)}% cpu"
:onclick "./scripts/pop system"
:onclick "${EWW_CMD} open --toggle system-menu"
(label :class "icon-text" :text ""))))

View File

@ -5,5 +5,5 @@
:thickness 3
(button
:tooltip "using ${round(memory.percentage,0)}% ram"
:onclick "./scripts/pop system"
:onclick "${EWW_CMD} open --toggle system-menu"
(label :class "icon-text" :text ""))))

View File

@ -1,4 +1,4 @@
(defwidget music []
(defwidget music-module []
(eventbox
:onhover "${EWW_CMD} update music_reveal=true"
:onhoverlost "${EWW_CMD} update music_reveal=false"
@ -10,7 +10,7 @@
:style "background-image: url(\"${music_cover}\");")
(button
:class "module"
:onclick "./scripts/pop music"
:onclick "${EWW_CMD} open --toggle music"
{music.title})
(revealer
:transition "slideright"

View File

@ -1,19 +1,7 @@
(defwidget net []
(eventbox
:onhover "${EWW_CMD} update net_rev=true"
:onhoverlost "${EWW_CMD} update net_rev=false"
(box
:space-evenly "false"
(revealer
:transition "slideright"
:reveal net_rev
:duration "350ms"
(label
:class "module-ssid module"
:style "color: ${net.color};"
:text {net.essid}))
(button
:class "module-net module"
:onclick "rofi-nm"
:style "color: ${net.color};"
{net.icon}))))
(button
:class "module-net module"
:onclick "rofi-nm"
:tooltip {net.essid}
:style "color: ${net.color};"
{net.icon}))

View File

@ -1,13 +1,14 @@
(defvar bright_reveal false)
(defvar bt_rev false)
(defvar music_reveal false)
(defvar notification_rev 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"}'`)
(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")

View File

@ -1,23 +1,11 @@
(defwidget volume []
(eventbox
:onhover "${EWW_CMD} update vol_reveal=true"
:onhoverlost "${EWW_CMD} update vol_reveal=false"
(box
:class "module"
:space-evenly "false"
:spacing "3"
(revealer
:transition "slideright"
:reveal vol_reveal
:duration "350ms"
(scale
:class "volbar"
:value {volume.percent}
:tooltip "${volume.percent}%"
:max 100
:min 0
:onchange "./scripts/volume setvol SINK {}"))
(button
:onclick "./scripts/pop volume"
(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"
{volume.icon}))))
:tooltip "volume ${volume.percent}"
:text {volume.icon}))))

View File

@ -0,0 +1,29 @@
#!/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

View File

@ -1,5 +1,20 @@
#!/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"
@ -47,6 +62,6 @@ while true; do
CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity)
STATE=$(cat /sys/class/power_supply/BAT0/status)
echo '{ "percentage": '"$CAPACITY"', "wattage": "'"$(wattage)"'", "status": "'"$(status)"'", "color": "'"$(color)"'" }'
echo '{ "icon": "'"$(geticon)"'", "percentage": '"$CAPACITY"', "wattage": "'"$(wattage)"'", "status": "'"$(status)"'", "color": "'"$(color)"'" }'
sleep 3
done

View File

@ -1,35 +1,51 @@
#!/usr/bin/env bash
declare -A baticon=([10]="󰁺" [20]="󰁻" [30]="󰁼" [40]="󰁽" [50]="󰁾" [60]="󰁿" [70]="󰂀" [80]="󰂁" [90]="󰂂" [100]="󰁹")
declare -A baticon=([10]="󰤾" [20]="󰤿" [30]="󰥀" [40]="󰥁" [50]="󰥂" [60]="󰥃" [70]="󰥄" [80]="󰥅" [90]="󰥆" [100]="󰥈")
while true; do
powered=$(bluetoothctl show | rg Powered | cut -f 2- -d ' ')
status=$(bluetoothctl info)
battery=$(echo "$status" | tail -1 | awk '{print $4 }' | tr -d '()')
name=$(echo "$status" | rg Name | cut -f 2- -d ' ')
toggle() {
status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1)
if [ "$powered" = "yes" ]; then
if [ "$status" != "Missing device address argument" ]; then
if [ "$battery" -le 100 ] && [ "$battery" -ge 0 ]; then
text="$name ${baticon[$battery]}"
else
text="$name"
fi
if [ "$status" = "unblocked" ]; then
rfkill block bluetooth
else
rfkill unblock bluetooth
fi
}
icon=""
color="#b4befe"
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
icon=""
text="Disconnected"
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
else
icon=""
text="Bluetooth off"
color="#45475a"
fi
echo '{ "icon": "'"$icon"'", "text": "'"$text"'", "color": "'"$color"'" }'
echo '{ "icon": "'"$icon"'", "batt_icon": "'"$batt_icon"'", "text": "'"$text"'", "color": "'"$color"'" }'
sleep 3
done
sleep 3
done
fi

View File

@ -66,7 +66,7 @@ get_cover() {
echo "$IMGPATH"
elif [ "$COVER_URL" = "" ]; then
echo "images/music.png"
echo ""
else
echo "$COVER_URL"
fi

View File

@ -1,26 +1,40 @@
#!/usr/bin/env bash
while true; do
status=$(nmcli g | tail -n 1 | awk '{print $1}')
signal=$(nmcli dev wifi | rg "\*" | awk '{ print $8 }')
essid=$(nmcli -t -f NAME connection show --active | head -n1)
toggle() {
status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "wlan") | .soft' | head -1)
icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨")
if [ "$status" = "disconnected" ] ; then
icon=""
color="#988ba2"
if [ "$status" = "unblocked" ]; then
rfkill block wlan
else
level=$(awk -v n="$signal" 'BEGIN{print int(n/20)}')
if [ "$level" -gt 4 ]; then
level=4
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
icon=${icons[$level]}
color="#cba6f7"
fi
echo '{ "essid": "'"$essid"'", "icon": "'"$icon"'", "color": "'"$color"'" }'
echo '{ "essid": "'"$essid"'", "icon": "'"$icon"'", "color": "'"$color"'" }'
sleep 3
done
sleep 3
done
fi

View File

@ -1,6 +1,11 @@
#!/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=""
@ -9,25 +14,23 @@ get_ids() {
}
get_notif() {
echo -n "(box :orientation \"v\" :space-evenly \"false\" :spacing \"10\" :halign \"start\" "
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\" \
(box :class \"notification\" :orientation \"h\" :width 300 :space-evenly \"false\" \
(box :orientation \"v\" :space-evenly \"false\" :valign \"start\" :width 300 :spacing 10 \
(box :orientation \"h\" :space-evenly \"false\" :width 300 :spacing 10 \
(label :xalign 0 :wrap \"true\" :class \"summary\" :text \"${n[1]}\") \
(label :xalign 1 :wrap \"true\" :class \"appname\" :text \"${n[0]}\")) \
(label :xalign 0 :wrap \"true\" :class \"body\" :text \"${n[2]}\"))))"
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 ")"
echo ')'
}
toggle() {
dunstctl set-paused toggle
lock="$XDG_CACHE_HOME/dunst-toggle.lock"
if [ ! -f "$lock" ]; then
export toggle_icon=""
@ -36,14 +39,13 @@ toggle() {
export toggle_icon=""
rm "$lock"
fi
echo "icon_change" > $lockinfo
}
clear() {
get_ids
for id in "${ids[@]}"; do
dunstctl history-pop "$id"
done
get_ids
systemctl --user restart dunst
echo "icon_change" > $lockinfo
}
get_icon() {
@ -64,7 +66,7 @@ elif [ "$1" == "icons" ]; then
dunstctl history > "$tmp"
get_ids
echo '{"toggle_icon": "'"$toggle_icon"'", "icon": "'"$(get_icon)"'"}'
tail -f "$tmp" 2>/dev/null | rg --line-buffered "aa\{sv\}" | while read -r; do
tail -f "$lockinfo" | while read -r; do
get_ids
echo '{"toggle_icon": "'"$toggle_icon"'", "icon": "'"$(get_icon)"'"}'
done

View File

@ -1,8 +1,9 @@
(defwidget calendar-win []
(box
:class "calendar-window"
:class "calendar-win"
(calendar)))
(defwindow calendar_win
(defwindow calendar
:monitor 0
:geometry (geometry
:x "0%"

View File

@ -0,0 +1,54 @@
(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))

View File

@ -1,42 +1,34 @@
(defwindow notifications_win
(defwindow notifications
:geometry
(geometry
:x "0px"
:y "0px"
:width "0px"
:height "0px"
:anchor "right center")
:anchor "right top")
:stacking "fg"
:monitor "0"
(rightside))
(notifications))
(defwidget rightside []
(revealer
:transition "slideleft"
:reveal notification_rev
:duration "350ms"
(defwidget notifications []
(box
:class "side"
:class "notifications-box"
:orientation "v"
:space-evenly "false"
:spacing "10"
:halign "center"
(box
:class "notification-header"
:orientation "h"
:space-evenly "false"
(label
:class "notification-label"
:halign "start"
:text "Notifications")
(box
:orientation "h"
:space-evenly "false"
:halign "end"
:space-evenly "false"
:spacing 10
(button
:class "notification-action"
:tooltip "Refresh"
:onclick "dunstctl history > $XDG_CACHE_HOME/dunst-history.json" "")
:onclick "dunstctl history > $XDG_CACHE_HOME/dunst-history.json" "")
(button
:class "notification-action"
:tooltip "Pause/Resume Notifications"
@ -44,12 +36,11 @@
(button
:class "notification-action"
:tooltip "Clear Notifications"
:onclick "scripts/notifications clear" "󰅙"))); 󰅖
:onclick "scripts/notifications clear" ""))) ; 󰅖
(scroll
:vscroll "true"
:hscroll "false"
:height 840
:width 200
:height 500
:width 300
(literal
:content notifications)
))))
:content notifications))))

View File

@ -0,0 +1,215 @@
(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))

View File

@ -25,38 +25,37 @@ in {
exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
exec-once=swaybg -i ~/.config/wallpaper
exec-once=mpvpaper -p -o "no-audio loop-file=inf" eDP-1 ~/.config/wallpaper.mp4
exec-once=eww open-many bar notifications_win
exec-once=eww open bar
input {
kb_layout=tr
follow_mouse=1
force_no_accel=1
touchpad {
natural_scroll=1
}
kb_layout=tr
follow_mouse=1
force_no_accel=1
touchpad {
natural_scroll=1
}
}
general {
main_mod=SUPER
gaps_in=5
gaps_out=5
border_size=0
main_mod=SUPER
gaps_in=5
gaps_out=5
border_size=0
}
decoration {
rounding=16
blur=1
blur_size=3
blur_passes=3
blur_new_optimizations=1
drop_shadow=0
shadow_ignore_window=1
rounding=16
blur=1
blur_size=3
blur_passes=3
blur_new_optimizations=1
drop_shadow=0
shadow_ignore_window=1
}
animations {
enabled=1
animation=windows,1,3,default,popin 80%
animation=border,1,2,default
animation=fade,1,4,default
animation=workspaces,1,2,default,slide
enabled=1
animation=windows,1,3,default,popin 80%
animation=border,1,2,default
animation=fade,1,4,default
animation=workspaces,1,2,default,slide
}
dwindle {
pseudotile=1
@ -68,17 +67,20 @@ in {
}
# window rules
windowrule=float,title:^(Media viewer)$
windowrule=float,title:^(Picture-in-Picture)$
windowrule=pin,title:^(Picture-in-Picture)$
windowrule=float,title:^(Firefox Sharing Indicator)$
windowrule=move 0 0,title:^(Firefox Sharing Indicator)$
windowrulev2=float,title:^(Media viewer)$
windowrulev2=float,title:^(Picture-in-Picture)$
windowrulev2=pin,title:^(Picture-in-Picture)$
windowrulev2=float,title:^(Firefox Sharing Indicator)$
windowrulev2=move 0 0,title:^(Firefox Sharing Indicator)$
# window rules for organization
windowrule=workspace 1,title:^(Firefox)$
windowrule=workspace 2,title:^(Discord)$
windowrule=workspace 2,title:^(WebCord)$
windowrule=workspace 3,title:^(foot)$
windowrulev2=workspace 1,title:^(Firefox)$
windowrulev2=workspace 2,title:^(Discord)$
windowrulev2=workspace 2,title:^(WebCord)$
windowrulev2=workspace 3,title:^(foot)$
# make blueberry device-specific window proper size
windowrulev2 = tile, class:^(blueberry.py)$, title:^(?!Sound).+$
# mouse
bindm=SUPER,mouse:272,movewindow

View File

@ -1,136 +1,143 @@
{
config,
pkgs,
lib,
...
}: let
rofi-nm = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/P3rf/rofi-network-manager/1daa69406c9b6539a4744eafb0d5bb8afdc80e9b/rofi-network-manager.sh";
hash = "sha256:1nlnjmk5b743j5826z2nzfvjwk0fmbf7gk38darby93kdr3nv5zx";
};
package = pkgs.writeShellScriptBin "rofi-nm" ''
${config.home.homeDirectory}/.config/rofi-nm/rofi-nm.sh
'';
in {
xdg.configFile = {
"rofi-nm/rofi-nm.sh" = {
source = pkgs.runCommandLocal "rofi-nm" {} ''
cp --no-preserve=mode,ownership ${rofi-nm} rofi-nm.sh
substituteInPlace rofi-nm.sh \
--replace "#!/bin/bash" "#!${pkgs.stdenv.shell}" \
--replace "grep" "${pkgs.gnugrep}/bin/grep"
mv rofi-nm.sh $out
'';
executable = true;
options = {
programs.rofi-nm.package = lib.mkOption {
type = lib.types.package;
};
"rofi-nm/rofi-network-manager.conf".text = ''
LOCATION=3
WIDTH_FIX_MAIN=10
WIDTH_FIX_STATUS=10
'';
"rofi-nm/rofi-network-manager.rasi".text = ''
configuration {
show-icons: false;
sidebar-mode: false;
hover-select: true;
me-select-entry: "";
me-accept-entry: [MousePrimary];
}
* {
font: "${config.settings.font.regular.fullName}";
}
@theme "catppuccin"
element-text, element-icon , mode-switcher {
background-color: inherit;
text-color: inherit;
}
window {
height: 40%;
width: 40%;
border: 3px;
border-color: @border-col;
background-color: @bg-col;
}
mainbox {
background-color: @bg-col;
}
inputbar {
children: [prompt,entry];
background-color: @bg-col;
border-radius: 5px;
padding: 2px;
}
prompt {
background-color: @blue;
padding: 6px;
text-color: @bg-col;
border-radius: 3px;
margin: 20px 0px 0px 20px;
}
textbox-prompt-colon {
expand: false;
str: ":";
}
entry {
placeholder: "";
padding: 6px;
margin: 20px 0px 0px 10px;
text-color: @fg-col;
background-color: @bg-col;
}
listview {
border: 0px 0px 0px;
padding: 6px 0px 0px;
margin: 10px 0px 0px 20px;
columns: 1;
background-color: @bg-col;
}
element {
padding: 5px;
background-color: @bg-col;
text-color: @fg-col ;
}
element-icon {
size: 25px;
}
element selected {
background-color: @selected-col ;
text-color: @fg-col2 ;
}
mode-switcher {
spacing: 0;
}
button {
padding: 10px;
background-color: @bg-col-light;
text-color: @grey;
vertical-align: 0.5;
horizontal-align: 0.5;
}
button selected {
background-color: @bg-col;
text-color: @blue;
}
'';
};
config = {
programs.rofi-nm.package = package;
home.packages = [
(
pkgs.writeShellScriptBin "rofi-nm" ''
${config.home.homeDirectory}/.config/rofi-nm/rofi-nm.sh
''
)
];
home.packages = [package];
xdg.configFile = {
"rofi-nm/rofi-nm.sh" = {
source = pkgs.runCommandLocal "rofi-nm" {} ''
cp --no-preserve=mode,ownership ${rofi-nm} rofi-nm.sh
substituteInPlace rofi-nm.sh \
--replace "#!/bin/bash" "#!${pkgs.stdenv.shell}" \
--replace "grep" "${pkgs.gnugrep}/bin/grep"
mv rofi-nm.sh $out
'';
executable = true;
};
"rofi-nm/rofi-network-manager.conf".text = ''
LOCATION=3
WIDTH_FIX_MAIN=10
WIDTH_FIX_STATUS=10
'';
"rofi-nm/rofi-network-manager.rasi".text = ''
configuration {
show-icons: false;
sidebar-mode: false;
hover-select: true;
me-select-entry: "";
me-accept-entry: [MousePrimary];
}
* {
font: "${config.settings.font.regular.fullName}";
}
@theme "catppuccin"
element-text, element-icon , mode-switcher {
background-color: inherit;
text-color: inherit;
}
window {
height: 40%;
width: 40%;
border: 3px;
border-color: @border-col;
background-color: @bg-col;
}
mainbox {
background-color: @bg-col;
}
inputbar {
children: [prompt,entry];
background-color: @bg-col;
border-radius: 5px;
padding: 2px;
}
prompt {
background-color: @blue;
padding: 6px;
text-color: @bg-col;
border-radius: 3px;
margin: 20px 0px 0px 20px;
}
textbox-prompt-colon {
expand: false;
str: ":";
}
entry {
placeholder: "";
padding: 6px;
margin: 20px 0px 0px 10px;
text-color: @fg-col;
background-color: @bg-col;
}
listview {
border: 0px 0px 0px;
padding: 6px 0px 0px;
margin: 10px 0px 0px 20px;
columns: 1;
background-color: @bg-col;
}
element {
padding: 5px;
background-color: @bg-col;
text-color: @fg-col ;
}
element-icon {
size: 25px;
}
element selected {
background-color: @selected-col ;
text-color: @fg-col2 ;
}
mode-switcher {
spacing: 0;
}
button {
padding: 10px;
background-color: @bg-col-light;
text-color: @grey;
vertical-align: 0.5;
horizontal-align: 0.5;
}
button selected {
background-color: @bg-col;
text-color: @blue;
}
'';
};
};
}

View File

@ -7,9 +7,5 @@
NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1";
XDG_SESSION_TYPE = "wayland";
GDK_SCALE = "2";
};
programs.zsh.loginExtra = ''
xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
'';
}

View File

@ -10,7 +10,6 @@
nixosConfig = globalAttrs.config;
in {
imports = [../../modules/de/gnome];
users.users.patriot = {
isNormalUser = true;
createHome = true;
@ -98,8 +97,7 @@ in {
imports = let
modulesToEnable = l.flatten [
# wm
# ["hyprland"]
["wayland"]
["hyprland" "foot"]
# desktop stuff
["firefox" "discord"]
# cli stuff
@ -142,12 +140,10 @@ in {
]
++ mkPaths ".config" [
"lutris"
"dconf"
];
files = l.flatten [
".config/wallpaper"
".config/wallpaper.mp4"
".config/gnome-initial-setup-done"
(lib.removePrefix "~/" config.programs.ssh.userKnownHostsFile)
];
allowOther = true;
@ -155,9 +151,9 @@ in {
fonts.fontconfig.enable = l.mkForce true;
settings.font.regular = {
name = "Comic Neue";
name = "Comic Relief";
size = 13;
package = pkgs.comic-neue;
package = pkgs.comic-relief;
};
settings.font.monospace = {
name = "Comic Mono";
@ -227,7 +223,6 @@ in {
''
)
obs-studio
rofi-bluetooth-wayland
];
};
programs = {
@ -241,6 +236,11 @@ in {
userName = name;
userEmail = email;
};
zsh.loginExtra = ''
if [[ "$(tty)" == "/dev/tty1" ]]; then
exec Hyprland
fi
'';
};
services = {
gpg-agent = let