mirror of
https://github.com/morten-olsen/nixos-config.git
synced 2026-02-08 00:36:27 +01:00
init
This commit is contained in:
247
user/files/eww/eww.scss
Normal file
247
user/files/eww/eww.scss
Normal file
@@ -0,0 +1,247 @@
|
||||
/* Created by https://github.com/rxyhn
|
||||
Designed by https://github.com/rxyhn
|
||||
Maintaned by https://github.com/rxyhn
|
||||
*/
|
||||
|
||||
// Global
|
||||
*{
|
||||
all: unset;
|
||||
}
|
||||
|
||||
// Variable Color's
|
||||
$background: #1A1B26;
|
||||
$foreground: #A9B1D6;
|
||||
|
||||
$black: #24283B;
|
||||
$gray: #565F89;
|
||||
$red: #F7768E;
|
||||
$green: #73DACA;
|
||||
$yellow: #E0AF68;
|
||||
$blue: #7AA2F7;
|
||||
$magenta: #BB9AF7;
|
||||
$cyan: #7DCFFF;
|
||||
$white: $foreground;
|
||||
|
||||
// EWW BAR
|
||||
.eww_bar{
|
||||
background-color: $background;
|
||||
padding: .3rem;
|
||||
}
|
||||
|
||||
// Launcher
|
||||
.launcher_icon{
|
||||
color: $cyan;
|
||||
font-family: "Font Awesome 6";
|
||||
font-size: 1.7em;
|
||||
padding: 1rem 0 1rem 0;
|
||||
}
|
||||
|
||||
// Workspaces
|
||||
.works {
|
||||
font-family: "Font Awesome 6";
|
||||
padding: .2rem .7rem .2rem .7rem;
|
||||
background-color: $black;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.0 , .01, .02, .03, .04, .05, .06,
|
||||
.011, .022, .033, .044, .055, .066{
|
||||
margin: .55rem 0 .55rem 0;
|
||||
}
|
||||
|
||||
/* Unoccupied */
|
||||
.0 {
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
/* Occupied */
|
||||
.01, .02, .03, .04, .05, .06 {
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
/* Focused */
|
||||
.011,
|
||||
.022,
|
||||
.033,
|
||||
.044,
|
||||
.055,
|
||||
.066 {
|
||||
color: $foreground;
|
||||
}
|
||||
|
||||
.0:nth-child(1),
|
||||
.0:nth-child(3){
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.0:nth-child(2){
|
||||
font-size: 1.4em;
|
||||
}
|
||||
.0:nth-child(4),
|
||||
.0:nth-child(5){
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.0:nth-child(6){
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.01,
|
||||
.011,
|
||||
.03,
|
||||
.033{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.02,
|
||||
.022{
|
||||
font-size: 1.4em;
|
||||
}
|
||||
.04,
|
||||
.05,
|
||||
.044,
|
||||
.055{
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.06,
|
||||
.066{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
|
||||
// Control Panel
|
||||
.control {
|
||||
padding: .5rem;
|
||||
font-family: Material Icons;
|
||||
font-size: 1.6em;
|
||||
background-color: $black;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.bat{
|
||||
font-family: JetBrainsMono Nerd Font;
|
||||
font-size: 1.2em;
|
||||
padding-right: .5rem;
|
||||
color: $blue;
|
||||
}
|
||||
.wifi-icon{
|
||||
margin-bottom: .2rem;
|
||||
color: $magenta;
|
||||
}
|
||||
.brightness-icon{
|
||||
margin: .2rem 0 .2rem 0;
|
||||
color: $yellow;
|
||||
}
|
||||
.volume-icon{
|
||||
font-family: "Fira Code Nerd Font";
|
||||
margin: 0rem .0rem 0rem -.6rem;
|
||||
color: $green;
|
||||
}
|
||||
scale trough {
|
||||
all: unset;
|
||||
background-color: $background;
|
||||
border-radius: 5px;
|
||||
min-height: 80px;
|
||||
min-width: 10px;
|
||||
margin: .3rem 0 .3rem 0;
|
||||
}
|
||||
.bribar trough highlight {
|
||||
background-color: $yellow;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.volbar trough highlight {
|
||||
background-color: $green;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
// Clock
|
||||
.time {
|
||||
font-family: Comic Mono;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
background-color: $black;
|
||||
color: $white;
|
||||
border-radius: 5px;
|
||||
padding: .7rem 0 .5rem 0;
|
||||
margin: .5rem 0 .5rem 0;
|
||||
}
|
||||
|
||||
.workspace-entry {
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
padding: .1rem .2rem;
|
||||
border: solid 3px transparent;
|
||||
|
||||
&.occupied {
|
||||
background-color: $black;
|
||||
}
|
||||
|
||||
&.current {
|
||||
border: solid 3px transparent;
|
||||
background: #e67e22;
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar
|
||||
.cal-box {
|
||||
background-color: $black;
|
||||
font-family: Comic Mono;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
|
||||
.cal-inner-box {
|
||||
padding: 1rem 1rem .2rem;
|
||||
|
||||
.cal {
|
||||
&.highlight {
|
||||
padding: 10rem;
|
||||
}
|
||||
|
||||
padding: .8rem .25rem 0rem;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
calendar:selected {
|
||||
color: $blue;
|
||||
}
|
||||
|
||||
calendar.header {
|
||||
color: $blue;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
calendar.button {
|
||||
color: $magenta;
|
||||
}
|
||||
|
||||
calendar.highlight {
|
||||
color: $magenta;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
calendar:indeterminate {
|
||||
color: $background;
|
||||
}
|
||||
|
||||
// Powermenu
|
||||
.powermenu {
|
||||
font-family: feather;
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.button-bspres, .button-reb, .button-lock,
|
||||
.button-quit, .button-off{
|
||||
padding: .5rem .2rem .3rem .2rem;
|
||||
}
|
||||
.button-off{
|
||||
margin-bottom: .5rem;
|
||||
color: $red;
|
||||
}
|
||||
.button-bspres{
|
||||
color: $green;
|
||||
}
|
||||
.button-reb{
|
||||
color: $yellow
|
||||
}
|
||||
.button-quit{
|
||||
color: $magenta;
|
||||
}
|
||||
.button-lock{
|
||||
color: $blue;
|
||||
}
|
||||
222
user/files/eww/eww.yuck
Normal file
222
user/files/eww/eww.yuck
Normal file
@@ -0,0 +1,222 @@
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
(defwidget workspaces []
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :space-evenly true :orientation "v"
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :orientation "v" :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
||||
(label :text "${workspace.id}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
;; Created by https://github.com/rxyhn
|
||||
;; Designed by https://github.com/rxyhn
|
||||
;; Maintaned by https://github.com/rxyhn
|
||||
|
||||
;; put path to aesthetic bar config files here ;;
|
||||
(defvar eww "/usr/bin/eww -c $HOME/.config/eww")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Widget Section's ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Launcher Widgets ;;
|
||||
(defwidget launcher []
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:spacing -15
|
||||
(button :class "launcher_icon"
|
||||
:onclick "scripts/popup launcher" "")))
|
||||
|
||||
;; Volume Widgets ;;
|
||||
(defwidget volum []
|
||||
(eventbox :onhover "${eww} update volum=true"
|
||||
:onhoverlost "${eww} update volum=false"
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:spacing "2"
|
||||
(revealer :transition "slideup"
|
||||
:reveal volum
|
||||
:duration "150ms"
|
||||
(scale :class "volbar"
|
||||
:value current-volume
|
||||
:orientation "v"
|
||||
:flipped true
|
||||
:tooltip "Volume: ${current-volume}%"
|
||||
:max 101
|
||||
:min 0
|
||||
:onchange "amixer sset Master {}%" ))
|
||||
(button :onclick "pavucontrol" :class "volume-icon" ""))))
|
||||
(defpoll current-volume :interval "1s" "~/.config/eww/scripts/getvol")
|
||||
(defvar volum false)
|
||||
|
||||
|
||||
;; Wifi Widgets ;;
|
||||
(defwidget wifi []
|
||||
(box :orientation "v"
|
||||
:tooltip wifi-name
|
||||
(button :onclick "scripts/popup wifi"
|
||||
:class "wifi-icon" wifi-icon)))
|
||||
(defpoll wifi-icon :interval "1s" "scripts/wifi icon")
|
||||
(defpoll wifi-name :interval "1s" "scripts/wifi name")
|
||||
|
||||
;; Brightness Widgets ;;
|
||||
(defwidget bright []
|
||||
(eventbox :onhover "${eww} update bright=true"
|
||||
:onhoverlost "${eww} update bright=false"
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:spacing 2
|
||||
(revealer :transition "slideup"
|
||||
:reveal bright
|
||||
:duration "550ms"
|
||||
(scale :class "bribar"
|
||||
:value current-brightness
|
||||
:tooltip "Brightness: ${current-brightness}%"
|
||||
:onchange "brightnessctl set {}%"
|
||||
:orientation "v"
|
||||
:flipped true
|
||||
:max 101
|
||||
:min 0))
|
||||
(label :class "brightness-icon"
|
||||
:text ""))))
|
||||
(defpoll current-brightness :interval "1s" "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
|
||||
(defvar bright false)
|
||||
|
||||
;; Control Panel Widgets ;;
|
||||
(defwidget control []
|
||||
(box :orientation "v"
|
||||
:space-evenly false
|
||||
:class "control"
|
||||
(volum)(bright)(wifi)))
|
||||
|
||||
;; Clock Widgets ;;
|
||||
(defwidget time []
|
||||
(box :orientation "v"
|
||||
:class "time"
|
||||
:valign "end"
|
||||
(button :onclick "scripts/popup calendar"
|
||||
:class "time-hour" hour)
|
||||
(button :onclick "scripts/popup calendar"
|
||||
:class "time-min" min)))
|
||||
(defpoll hour :interval "1s" "date '+%H'")
|
||||
(defpoll min :interval "1s" "date '+%M'")
|
||||
|
||||
;; Calendar Widgets ;;
|
||||
(defwidget cal []
|
||||
(box :class "cal-box"
|
||||
:orientation "v"
|
||||
(box :class "cal-inner-box"
|
||||
(calendar :class "cal"
|
||||
:day calendar_day
|
||||
:month calendar_month
|
||||
:year calendar_year))))
|
||||
(defpoll calendar_day :interval "10h"
|
||||
"date '+%d'")
|
||||
(defpoll calendar_month :interval "10h"
|
||||
"scripts/calendar")
|
||||
(defpoll calendar_year :interval "10h"
|
||||
"date '+%Y'")
|
||||
|
||||
;; Powermenu Widgets ;;
|
||||
(defwidget power []
|
||||
(eventbox :onhover "${eww} update power=true"
|
||||
:onhoverlost "${eww} update power=false"
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:vexpand "false"
|
||||
:class "powermenu"
|
||||
(revealer :transition "slideup"
|
||||
:reveal power
|
||||
:duration "550ms"
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
|
||||
(button :class "button-bspres"
|
||||
:tooltip "BSPWM Restart"
|
||||
:onclick "bspc wm -r" "" )
|
||||
|
||||
(button :class "button-reb"
|
||||
:tooltip "Reboot"
|
||||
:onclick "reboot" "")
|
||||
|
||||
(button :class "button-quit"
|
||||
:tooltip "Logout"
|
||||
:onclick "killall bspwm" "")
|
||||
|
||||
(button :class "button-lock"
|
||||
:tooltip "Lock Screen"
|
||||
:onclick "betterlockscreen -l" "")))
|
||||
|
||||
(button :class "button-off"
|
||||
:tooltip "Shutdown"
|
||||
:onclick "shutdown now" ""))))
|
||||
(defvar power false)
|
||||
|
||||
;; Top Widgets ;;
|
||||
(defwidget top []
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:valign "start"
|
||||
(launcher)
|
||||
(workspaces)))
|
||||
|
||||
;; Bottom Widgets ;;
|
||||
(defwidget bottom []
|
||||
(box :orientation "v"
|
||||
:space-evenly false
|
||||
(time)
|
||||
(power)))
|
||||
|
||||
;; End Widgets ;;
|
||||
(defwidget end []
|
||||
(box :orientation "v"
|
||||
:space-evenly "false"
|
||||
:valign "end"
|
||||
:spacing 5
|
||||
(control)
|
||||
(bottom)))
|
||||
|
||||
;; Bar Widgets ;;
|
||||
(defwidget bar []
|
||||
(box :class "eww_bar"
|
||||
:orientation "v"
|
||||
:vexpand "false"
|
||||
:hexpand "false"
|
||||
(top)
|
||||
(end)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Window Section's ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Bar Windows ;;
|
||||
(defwindow bar
|
||||
:geometry (geometry :x "0"
|
||||
:y "0"
|
||||
:height "100%"
|
||||
:width "47px")
|
||||
:monitor 0
|
||||
:reserve (struts :distance "35px"
|
||||
:side "left")
|
||||
:wm-ignore false
|
||||
:hexpand "false"
|
||||
:vexpand "false"
|
||||
(bar))
|
||||
|
||||
;; Calendar Windows ;;
|
||||
(defwindow calendar
|
||||
:geometry (geometry :x "70px"
|
||||
:y "65%"
|
||||
:width "270px"
|
||||
:height "60px")
|
||||
(cal))
|
||||
|
||||
|
||||
|
||||
44
user/files/eww/scripts/battery
Executable file
44
user/files/eww/scripts/battery
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
bat=/sys/class/power_supply/BAT0/
|
||||
per="$(cat "$bat/capacity")"
|
||||
|
||||
icon() {
|
||||
|
||||
[ $(cat "$bat/status") = Charging ] && echo "" && exit
|
||||
|
||||
if [ "$per" -gt "90" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "80" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "70" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "60" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "50" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "40" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "30" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "20" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "10" ]; then
|
||||
icon=""
|
||||
notify-send -u critical "Battery Low" "Connect Charger"
|
||||
elif [ "$per" -gt "0" ]; then
|
||||
icon=""
|
||||
notify-send -u critical "Battery Low" "Connect Charger"
|
||||
else
|
||||
echo && exit
|
||||
fi
|
||||
echo "$icon"
|
||||
}
|
||||
|
||||
percent() {
|
||||
echo $per
|
||||
}
|
||||
|
||||
[ "$1" = "icon" ] && icon && exit
|
||||
[ "$1" = "percent" ] && percent && exit
|
||||
exit
|
||||
21
user/files/eww/scripts/change-active-workspace
Executable file
21
user/files/eww/scripts/change-active-workspace
Executable file
@@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
function clamp {
|
||||
min=$1
|
||||
max=$2
|
||||
val=$3
|
||||
python -c "print(max($min, min($val, $max)))"
|
||||
}
|
||||
|
||||
direction=$1
|
||||
current=$2
|
||||
if test "$direction" = "down"
|
||||
then
|
||||
target=$(clamp 1 10 $(($current+1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
elif test "$direction" = "up"
|
||||
then
|
||||
target=$(clamp 1 10 $(($current-1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
fi
|
||||
3
user/files/eww/scripts/get-active-workspace
Executable file
3
user/files/eww/scripts/get-active-workspace
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
hyprctl monitors -j | jq --raw-output .[0].activeWorkspace.id
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 grep '^workspace>>' | stdbuf -o0 awk -F '>>|,' '{print $2}'
|
||||
11
user/files/eww/scripts/get-workspaces
Executable file
11
user/files/eww/scripts/get-workspaces
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
spaces (){
|
||||
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
|
||||
seq 1 10 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
|
||||
}
|
||||
|
||||
spaces
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||
spaces
|
||||
done
|
||||
2
user/files/eww/scripts/getram
Executable file
2
user/files/eww/scripts/getram
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')
|
||||
2
user/files/eww/scripts/getvol
Executable file
2
user/files/eww/scripts/getvol
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1
|
||||
13
user/files/eww/scripts/wifi
Executable file
13
user/files/eww/scripts/wifi
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
symbol() {
|
||||
[ $(cat /sys/class/net/w*/operstate) = down ] && echo && exit
|
||||
echo
|
||||
}
|
||||
|
||||
name() {
|
||||
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
|
||||
}
|
||||
|
||||
[ "$1" = "icon" ] && symbol && exit
|
||||
[ "$1" = "name" ] && name && exit
|
||||
Reference in New Issue
Block a user