Add all of iogamaster modules

This commit is contained in:
2024-06-15 09:59:52 +02:00
parent c97f22254a
commit fa99b32cad
120 changed files with 3587 additions and 254 deletions

View File

@@ -0,0 +1,14 @@
(defpoll hostname :interval "1000s" "hostnamectl hostname")
(defpoll username :interval "1000s" "echo $USER")
(defpoll net :interval "100s" `nmcli -terse -fields SIGNAL,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`)
(defpoll ssid :interval "100s" `nmcli -terse -fields SSID,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`)
(defvar profile "~/.face")
(defpoll dunst :interval "1s" "[ $(dunstctl is-paused) = false ] && echo  || echo ")
(defpoll time :interval "1s" `date +'{"hour":"%H","min":"%M","sec":"%S","pretty":"%a, %e %b","day":"%A","month":"%B","dom":"%e","year":"%Y","day_num":"%d","month_num":"%m","year_num":"%y"}'`)
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ title }} - {{ artist }}' || true")

View File

@@ -0,0 +1,113 @@
* {
all: unset; //Unsets everything so you can style everything from scratch
}
$bg: #1e1e2e;
$black: #313244;
$red: #f38ba8;
$green: #a6e3a1;
$yellow: #f9e2af;
$pink: #f5c2e7;
$blue: #89b4fa;
$purple: #cba6f7;
$cyan: #89dceb;
$white: #cdd6f4;
$gray: #313244;
* {
transition: 200ms ease;
font-family: "JetBrainsMono Nerd Font";
}
.bar {
background-color: $bg;
color: $white;
padding: 10px;
}
.bar2 {
background-color: $bg;
color: $white;
padding: 10px;
}
.workspaces {
padding-left: 10;
font-size: 20;
}
.system {
padding-right: 10;
}
.module { margin: 0 5px; }
.metric scale trough highlight {
all: unset;
background-color: $blue;
color: $black;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: $gray;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: $blue;
color: $black;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: $gray;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.bat-box scale trough highlight {
all: unset;
background-color: $blue;
color: $black;
border-radius: 10px;
}
.bat-box scale trough {
all: unset;
background-color: $gray;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.bat-box scale trough highlight {
all: unset;
background-color: $blue;
color: $black;
border-radius: 10px;
}
.bat-box scale trough {
all: unset;
background-color: $gray;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}

View File

@@ -0,0 +1,39 @@
(include "./widgets/workspaces.yuck")
(include "./widgets/music.yuck")
(include "./widgets/metrics.yuck")
(defwidget bar []
(centerbox :orientation "h"
(box
:space-evenly false
:halign "start"
(workspaces))
(label :text "")
(metrics)))
;; Windows
(defwindow bar
:monitor 0
:geometry (geometry :x "0%"
:y "0px"
:width "100%"
:height "4%"
:anchor "top center")
:stacking "fg"
:windowtype "dock"
:wm-ignore false
:exclusive true
(bar))
(defwindow bar2
:monitor 1
:geometry (geometry :x "0%"
:y "0px"
:width "100%"
:height "4%"
:anchor "top center")
:stacking "fg"
:windowtype "dock"
:wm-ignore false
:exclusive true
(bar))

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env sh
set -eu
if [ -f /sys/class/power_supply/BAT0/capacity ]; then
cat /sys/class/power_supply/BAT0/capacity
fi

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env sh
set -eu
if [ -f /sys/class/power_supply/BAT0/status]; then
cat /sys/class/power_supply/BAT0/status
fi

View File

@@ -0,0 +1,83 @@
#!/usr/bin/env bash
source ~/.config/theme/workspace_colors
# get initial focused workspace
focusedws=$(hyprctl -j monitors | jaq -r '.[] | select(.focused == true) | .activeWorkspace.id')
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
# set color for each workspace
status() {
if [ "${o[$1]}" -eq 1 ]; then
mon=${monitormap[${workspaces[$1]}]}
if [ $focusedws -eq "$1" ]; then
echo -n "${colors[$mon]}"
else
echo -n "${dimmed[$mon]}"
fi
else
echo -n "$empty"
fi
}
# handle workspace create/destroy
workspace_event() {
o[$1]=$2
while read -r k v; do workspaces[$k]="$v"; done < <(hyprctl -j workspaces | gojq -r '.[]|"\(.id) \(.monitor)"')
}
# handle monitor (dis)connects
monitor_event() {
while read -r k v; do monitormap["$k"]=$v; done < <(hyprctl -j monitors | gojq -r '.[]|"\(.name) \(.id) "')
}
# generate the json for eww
generate() {
echo -n '['
for i in {1..10}; do
echo -n ''$([ $i -eq 1 ] || echo ,) '{ "number": "'"$i"'", "color": "'$(status "$i")'" }'
done
echo ']'
}
# setup
# add monitors
monitor_event
# add workspaces
while read -r k v; do workspaces[$k]="$v"; done < <(hyprctl -j workspaces | gojq -r '.[]|"\(.id) \(.monitor)"')
# 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

View File

@@ -0,0 +1,48 @@
(defwidget metrics []
(box :class "system" :orientation "h" :space-evenly false :halign "end"
(_battery)
(metric :label "󰘚"
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "󰋊"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 151
:active {onchange != ""}
:value value
:onchange onchange)))
(defpoll battery-percent :interval "30s"
:initial ''
"./scripts/battery-percent")
(defpoll battery-status :interval "5s"
:initial ''
"./scripts/battery-status")
(defwidget _battery []
(box :class "bat-box" :space-evenly false :spacing 8
:visable {battery-status != ''}
(label :text {battery-status == 'Charging' ? "󰂄" :
battery-percent < 10 ? "󰂃" :
battery-percent < 20 ? "󰁻" :
battery-percent < 30 ? "󰁼" :
battery-percent < 40 ? "󰁽" :
battery-percent < 50 ? "󰁾" :
battery-percent < 60 ? "󰁿" :
battery-percent < 70 ? "󰂀" :
battery-percent < 80 ? "󰂁" :
battery-percent < 90 ? "󰂂" : "󰁹"})))
(defpoll time :interval "1s"
"date '+%H:%M'")

View File

@@ -0,0 +1,9 @@
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "󰽰 ${music}" : ""}))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ title }} - {{ artist }}' || true")

View File

@@ -0,0 +1,13 @@
(defwidget workspaces []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
(box
:class "module workspaces"
:spacing 10
(for i in workspace
(button
:onclick "hyprctl dispatch workspace ${i.number}"
:class "ws"
:style "color: ${i.color};"
"●")))))
(deflisten workspace "./scripts/workspace")

View File

@@ -0,0 +1,32 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.frajul; let
cfg = config.desktop.addons.eww;
in {
options.desktop.addons.eww = with types; {
enable = mkBoolOpt false "Enable or disable EWW.";
wayland = mkBoolOpt false "Enable wayland support";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
eww-wayland
playerctl
gojq
jaq
socat
];
home.configFile."eww/" = {
recursive = true;
source = ./config;
};
};
}

View File

@@ -0,0 +1,37 @@
{
options,
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.frajul; let
cfg = config.desktop.addons.gtklock;
inherit (inputs.nix-colors.colorschemes.${builtins.toString config.desktop.colorscheme}) palette;
in {
options.desktop.addons.gtklock = with types; {
enable = mkBoolOpt false "Enable or disable the gtklock screen locker.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
gtklock
];
security.pam.services.gtklock = {};
home.configFile."gtklock/style.css".text = ''
window {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-color: #${palette.base00};
}
clock-label {
color: #${palette.base05};
}
'';
};
}

View File

@@ -0,0 +1,41 @@
{
options,
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.frajul;
let
cfg = config.desktop.addons.mako;
inherit (inputs.nix-colors.colorschemes.${builtins.toString config.desktop.colorscheme}) palette;
in
{
options.desktop.addons.mako = with types; {
enable = mkBoolOpt false "Enable or disable mako";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
mako
libnotify
];
home.configFile."mako/config" = {
text = ''
background-color=#${palette.base00}
text-color=#${palette.base05}
border-color=#${palette.base0D}
progress-color=over #${palette.base02}
[urgency=high]
border-color=#${palette.base09}
'';
onChange = ''
${pkgs.busybox}/bin/pkill -SIGUSR2 mako
'';
};
};
}

View File

@@ -0,0 +1,22 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.frajul; let
cfg = config.desktop.addons.swaync;
in {
options.desktop.addons.swaync = with types; {
enable = mkBoolOpt false "Enable or disable swaync";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
swaync
libnotify
];
};
}

View File

@@ -0,0 +1,31 @@
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.frajul;
let
cfg = config.desktop.addons.swww;
in
{
options.desktop.addons.swww = with types; {
enable = mkBoolOpt false "Enable or disable SWWW";
};
config = mkIf cfg.enable {
environment.systemPackages = [
pkgs.swww
(pkgs.writeShellScriptBin "wallpaper" ''
/usr/bin/env ls ~/.config/wallpapers/ | sort -R | tail -1 |while read file; do
swww img ~/.config/wallpapers/$file --transition-fps 255 --transition-type wipe
echo "$file"
done
'')
];
home.persist.directories = [ ".cache/swww" ];
};
}

View File

@@ -0,0 +1,80 @@
{
"layer": "top",
"position": "top",
"mod": "dock",
"exclusive": true,
"passtrough": false,
"gtk-layer-shell": true,
"height": 32,
"modules-left": [
"hyprland/workspaces"
],
"modules-center": [],
"modules-right": [
"tray",
"network",
"battery",
"clock"
],
"hyprland/window": {
"format": "{}"
},
"hyprland/workspaces": {
"on-scroll-up": "hyprctl dispatch workspace e+1",
"on-scroll-down": "hyprctl dispatch workspace e-1",
"all-outputs": true,
"on-click": "activate",
"format": "{icon}",
"format-icons": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
"10": "10"
}
},
"tray": {
"icon-size": 12,
"tooltip": false,
"spacing": 10
},
"clock": {
"format": "{:%H:%M}",
},
"pulseaudio": {
"format": " {volume}%",
"tooltip": false,
"format-muted": " N/A",
"on-click": "pavucontrol &",
"scroll-step": 5
},
"network": {
"format-wifi": " {essid} {signalStrength}%",
"format-ethernet": "󰈀",
"format-disconnected": "󰈂"
},
"battery": {
"states": {
"warning": 20,
"critical": 15
},
"format": "󰁹 {capacity}%",
"format-charging": "󰂄 {capacity}%",
"format-plugged": "󰂄 {capacity}%"
}
}

View File

@@ -0,0 +1,223 @@
{
options,
config,
pkgs,
lib,
inputs,
...
}:
with lib;
with lib.frajul;
let
cfg = config.desktop.addons.waybar;
inherit (inputs.nix-colors.colorschemes.${builtins.toString config.desktop.colorscheme}) palette;
in
{
options.desktop.addons.waybar = with types; {
enable = mkBoolOpt false "Enable or disable waybar";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.waybar ];
home.configFile."waybar/config.jsonc" = {
source = ./config.jsonc;
onChange = ''
${pkgs.busybox}/bin/pkill -SIGUSR2 waybar
'';
};
home.configFile."waybar/style.css" = {
text = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: JetBrainsMono Nerd Font;
font-size: 13px;
border-radius: 17px;
}
#clock,
#custom-notification,
#custom-launcher,
#custom-power-menu,
/*#custom-colorpicker,*/
#custom-window,
#memory,
#disk,
#network,
#battery,
#custom-spotify,
#pulseaudio,
#window,
#tray {
padding: 5 15px;
border-radius: 12px;
background: #${palette.base00};
color: #${palette.base07};
margin-top: 8px;
margin-bottom: 8px;
margin-right: 2px;
margin-left: 2px;
transition: all 0.3s ease;
}
#window {
background-color: transparent;
box-shadow: none;
}
window#waybar {
background-color: rgba(0, 0, 0, 0.096);
border-radius: 17px;
}
window * {
background-color: transparent;
border-radius: 0px;
}
#workspaces button label {
color: #${palette.base07};
}
#workspaces button.active label {
color: #${palette.base00};
font-weight: bolder;
}
#workspaces button:hover {
box-shadow: #${palette.base07} 0 0 0 1.5px;
background-color: #${palette.base00};
min-width: 50px;
}
#workspaces {
background-color: transparent;
border-radius: 17px;
padding: 5 0px;
margin-top: 3px;
margin-bottom: 3px;
}
#workspaces button {
background-color: #${palette.base00};
border-radius: 12px;
margin-left: 10px;
transition: all 0.3s ease;
}
#workspaces button.active {
min-width: 50px;
box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px;
background-color: #${palette.base0F};
background-size: 400% 400%;
transition: all 0.3s ease;
background: linear-gradient(
58deg,
#${palette.base0E},
#${palette.base0E},
#${palette.base0E},
#${palette.base0D},
#${palette.base0D},
#${palette.base0E},
#${palette.base08}
);
background-size: 300% 300%;
animation: colored-gradient 20s ease infinite;
}
@keyframes colored-gradient {
0% {
background-position: 71% 0%;
}
50% {
background-position: 30% 100%;
}
100% {
background-position: 71% 0%;
}
}
#custom-power-menu {
margin-right: 10px;
padding-left: 12px;
padding-right: 15px;
padding-top: 3px;
}
#custom-spotify {
margin-left: 5px;
padding-left: 15px;
padding-right: 15px;
padding-top: 3px;
color: #${palette.base07};
background-color: #${palette.base00};
transition: all 0.3s ease;
}
#custom-spotify.playing {
color: rgb(180, 190, 254);
background: rgba(30, 30, 46, 0.6);
background: linear-gradient(
90deg,
#${palette.base02},
#${palette.base00},
#${palette.base00},
#${palette.base00},
#${palette.base00},
#${palette.base02}
);
background-size: 400% 100%;
animation: grey-gradient 3s linear infinite;
transition: all 0.3s ease;
}
@keyframes grey-gradient {
0% {
background-position: 100% 50%;
}
100% {
background-position: -33% 50%;
}
}
#tray menu {
background-color: #${palette.base00};
opacity: 0.8;
}
#pulseaudio.muted {
color: #${palette.base08};
padding-right: 16px;
}
#custom-notification.collapsed,
#custom-notification.waiting_done {
min-width: 12px;
padding-right: 17px;
}
#custom-notification.waiting_start,
#custom-notification.expanded {
background-color: transparent;
background: linear-gradient(
90deg,
#${palette.base02},
#${palette.base00},
#${palette.base00},
#${palette.base00},
#${palette.base00},
#${palette.base02}
);
background-size: 400% 100%;
animation: grey-gradient 3s linear infinite;
min-width: 500px;
border-radius: 17px;
}
'';
onChange = ''
${pkgs.busybox}/bin/pkill -SIGUSR2 waybar
'';
};
};
}

View File

@@ -0,0 +1,74 @@
{
options,
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.frajul; let
cfg = config.desktop.addons.wlogout;
inherit (inputs.nix-colors.colorschemes.${builtins.toString config.desktop.colorscheme}) palette;
in {
options.desktop.addons.wlogout = with types; {
enable = mkBoolOpt false "Enable or disable wlogout.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
wlogout
];
home.configFile."wlogout/style.css".text = ''
* {
all: unset;
font-family: JetBrains Mono Nerd Font;
}
window {
background-color: #${palette.base00};
}
button {
color: #${palette.base01};
font-size: 64px;
background-color: rgba(0,0,0,0);
outline-style: none;
margin: 5px;
}
button:focus, button:active, button:hover {
color: #${palette.base0D};
transition: ease 0.4s;
}
'';
home.configFile."wlogout/layout".text = ''
{
"label" : "lock",
"action" : "gtklock",
"text" : "󰌾",
"keybind" : ""
}
{
"label" : "logout",
"action" : "loginctl terminate-user $USER",
"text" : "󰗽",
"keybind" : ""
}
{
"label" : "shutdown",
"action" : "systemctl poweroff",
"text" : "󰐥",
"keybind" : ""
}
{
"label" : "reboot",
"action" : "systemctl reboot",
"text" : "󰑓",
"keybind" : ""
}
'';
};
}

View File

@@ -0,0 +1,15 @@
width=900
height=600
location=center
show=drun
prompt=Search...
filter_rate=100
allow_markup=true
no_actions=true
halign=fill
orientation=vertical
content_halign=fill
insensitive=true
allow_images=true
image_size=35
gtk_dark=true

View File

@@ -0,0 +1,94 @@
{
options,
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.frajul;
let
cfg = config.desktop.addons.wofi;
inherit (inputs.nix-colors.colorschemes.${builtins.toString config.desktop.colorscheme}) palette;
in
{
options.desktop.addons.wofi = with types; {
enable = mkBoolOpt false "Enable or disable the wofi run launcher.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ wofi ];
home.configFile."wofi/config".source = ./config;
home.configFile."wofi/style.css".text = ''
window {
margin: 5px;
border: 5px solid #181926;
background-color: #${palette.base00};
border-radius: 15px;
font-family: "JetBrainsMono";
font-size: 14px;
}
#input {
all: unset;
min-height: 36px;
padding: 4px 10px;
margin: 4px;
border: none;
color: #${palette.base05};
font-weight: bold;
background-color: #${palette.base01};
outline: none;
border-radius: 15px;
margin: 10px;
margin-bottom: 2px;
}
#inner-box {
margin: 4px;
padding: 10px;
font-weight: bold;
border-radius: 15px;
}
#outer-box {
margin: 0px;
padding: 3px;
border: none;
border-radius: 15px;
border: 5px solid #${palette.base01};
}
#scroll {
margin-top: 5px;
border: none;
border-radius: 15px;
margin-bottom: 5px;
}
#text:selected {
color: #${palette.base01};
margin: 0px 0px;
border: none;
border-radius: 15px;
}
#entry {
margin: 0px 0px;
border: none;
border-radius: 15px;
background-color: transparent;
}
#entry:selected {
margin: 0px 0px;
border: none;
border-radius: 15px;
background: #${palette.base0D};
background-size: 400% 400%;
}
'';
};
}