imported previous rust projects and cleaned up unused files

This commit is contained in:
willifan 2024-05-23 18:56:06 +02:00
parent 0166b32872
commit 10b8db251b
432 changed files with 874 additions and 1585 deletions

96
eww/eww.scss Normal file
View file

@ -0,0 +1,96 @@
window {
border-width: 2px;
border-color: #595959;
border-radius: 12.5px;
}
.calendar {
border-width: 2px;
border-color: #595959;
border-radius: 12.5px;
}
.power {
border-width: 2px;
border-color: #595959;
border-radius: 12.5px;
}
.activeWorkspace {
border-radius: 10px;
background-color: #52341A;
}
.unoccupiedWorkspace {
color: grey;
}
.cpu {
color: red;
}
.ram {
color: green;
}
.volume {
color: lavender;
}
.muted {
color: red;
}
.brightness {
color: yellow;
}
.network {
color: orange;
}
.bluetooth {
color: lightblue;
}
.battery {
color: lightgreen;
}
.batteryLow {
color: red;
}
.power {
color: darkred;
}
.time {
}
.workspaces {
}
.playback {
}
.test {
border-radius: 15px;
}
.smallBox {
border-radius: 10px;
background-color: #44464D;
}
.smallBox:hover {
background-color: #3B3D45;
}
.smallBox:active {
background-color: #52341A;
}

260
eww/eww.yuck Normal file
View file

@ -0,0 +1,260 @@
(include "variables.yuck")
(include "templates.yuck")
;; left
(defwidget time []
(eventbox
:onclick ``
:class "smallBox"
:valign "center"
:height 20
:width 70
(label
:text "${formattime(EWW_TIME, "%H:%M:%S")}")))
;; center
(defwidget normalWorkspaces [monitor]
(box
:space-evenly false
:spacing 3
(for workspace in workspaces
(workspace
:activeOn {workspace.normal.activeOn}
:occupied {workspace.normal.occupied}
:id {workspace.normal.id}
:cmd {workspace.normal.id}
:icon {workspace.normal.icon}
:monitor {monitor}))))
;; right
(defwidget cpu []
(icon
:widgetclass "cpu"
:hover "${round(EWW_CPU.avg, 1)}%"
:percentage {round(EWW_CPU.avg, 1)}
:image "images/cpu.png"))
(defwidget ram []
(icon
:widgetclass "ram"
:hover "${round(EWW_RAM.used_mem /(1024*1024*1024), 1)} GiB | ${round(EWW_RAM.used_mem_perc, 1)}%"
:percentage {round(EWW_RAM.used_mem_perc, 1)}
:image "images/ram.png"))
(defwidget audio []
(icon
:widgetclass {volume.muted == 1 ? "muted" : "volume"}
:hover "${volume.volume}%"
:percentage {volume.volume >= 0 && volume.volume <= 100 ? volume.volume : 0}
:image {volume.muted == 1 ? "images/volumeMuted.png" : "images/volume.png"}))
(defwidget brightness []
(icon
:widgetclass "brightness"
:hover "${brightnessValue / 960}%"
:percentage {brightnessValue / 960}
:image "images/brightness.png"))
(defwidget network []
(icon
:widgetclass "network"
:hover {network.name}
:percentage "100"
:image "images/${network.image}.png"))
(defwidget bluetooth []
(icon
:widgetclass "bluetooth"
:hover {bluetooth.name}
:percentage {bluetooth.battery}
:image "images/bluetooth.png"))
(defwidget battery []
(icon
:widgetclass {EWW_BATTERY.BAT1.status == "Charging" ? "battery" : EWW_BATTERY.total_avg > 25 ? "battery" : "batteryLow"}
:hover "${round(EWW_BATTERY.total_avg, 1)}%"
:percentage {EWW_BATTERY.total_avg <= 90 ? round(EWW_BATTERY.total_avg, 1)/0.9 : 100}
:image {EWW_BATTERY.BAT1.status == "Charging" ? "images/charging.png" : EWW_BATTERY.total_avg > 25 ? "images/battery.png" : "images/batteryLow.png"}))
(defwidget power []
(icon
:widgetclass "power"
:hover "placeholder"
:percentage "0"
:image "images/power.png"))
;; Widget blocks
;;(defwidget media []
;; (box
;; :class "smallBox"
;; :height 20
;; :valign "center"
;; :space-evenly false
;; :visible {media.status == "Playing" ? true : false}
;; (smallSpacer)
;; (label
;; :text {media.name}
;; :tooltip {media.name}
;; :limit-width 40)
;; (smallSpacer)))
(defwidget processing []
(eventbox
:onclick 'hyprctl dispatch exec "[float; pin; size 40% 40%; move 100%-41% 40] kitty bpytop -b proc"'
:class "smallBox"
(box
:space-evenly false
:halign "end"
:valign "center"
:height 20
(smallSpacer)
(cpu)
(space)
(ram)
(smallSpacer))))
(defwidget controlls []
(eventbox
:onclick 'hyprctl dispatch exec "[float; pin; size 40% 40%; move 100%-41% 40] kitty pulsemixer"'
:class "smallBox"
(box
:space-evenly false
:halign "end"
:valign "center"
:height 20
(smallSpacer)
(audio)
(space)
(brightness)
(smallSpacer))))
(defwidget wireless []
(eventbox
:onclick "`networkmanager_dmenu`"
:class "smallBox"
(box
:space-evenly false
:halign "end"
:valign "center"
:height 20
(smallSpacer)
(network)
(space)
(bluetooth)
(smallSpacer))))
(defwidget energy []
(eventbox
:onclick `sleep 1 && systemctl hibernate`
:class "smallBox"
(box
:space-evenly false
:halign "end"
:valign "center"
:height 20
(smallSpacer)
(battery)
(space)
(power)
(smallSpacer))))
(defwidget start []
(box
:orientation "h"
:space-evenly false
:halign "start"
(space)
(time)))
(defwidget center [monitor]
(box
:orientation "h"
:space-evenly false
:halign "center"
(workspace
:activeOn {workspaces[0].special.activeOn}
:occupied {workspaces[0].special.occupied}
:id {workspaces[0].special.id}
:icon {workspaces[0].special.icon}
:monitor {monitor})
(workspace
:activeOn {workspaces[1].special.activeOn}
:occupied {workspaces[1].special.occupied}
:id {workspaces[1].special.id}
:icon {workspaces[1].special.icon}
:monitor {monitor})
(seperator)
(normalWorkspaces
:monitor {monitor})
(seperator)
(workspace
:activeOn {workspaces[2].special.activeOn}
:occupied {workspaces[2].special.occupied}
:id {workspaces[2].special.id}
:icon {workspaces[2].special.icon}
:monitor {monitor})
(workspace
:activeOn {workspaces[3].special.activeOn}
:occupied {workspaces[3].special.occupied}
:id {workspaces[3].special.id}
:icon {workspaces[3].special.icon}
:monitor {monitor})))
(defwidget end []
(box
:spacing 2
:orientation "h"
:space-evenly false
:valign "center"
:halign "end"
(processing)
(seperator)
(controlls)
(seperator)
(wireless)
(seperator)
(energy)
(space)))
(defwidget bar [monitor]
(centerbox :orientation "h"
(start)
(center
:monitor {monitor})
(end)))
(defwindow bar [monitor width height]
:monitor {monitor}
:class "bar"
:geometry (geometry
:x "0%"
:y "5px"
:width "${width}px"
:height "${height}px"
:anchor "top center")
:stacking "fg"
:exclusive true
(bar
:monitor {monitor}))

80
eww/templates.yuck Normal file
View file

@ -0,0 +1,80 @@
(defwidget imageDPI [image size visible]
(overlay
:width "${size}"
:height "${size}"
:visible "${visible}"
(box
:width "${size}"
:height "${size}")
(transform
:scale-x "50%"
:scale-y "50%"
:halign "center"
:valign "center"
:translate-x "${size}"
:translate-y "${size}"
(image
:path "${image}"
:image-width "${size * 2}"
:image-height "${size * 2}"))))
(defwidget icon [widgetclass ?hover percentage image]
(box
:class "${widgetclass}"
:space-evenly false
(overlay
:tooltip "${hover}"
(circular-progress
:width 18
:value "${percentage}"
:start-at 75
:thickness 2
:clockwise false)
(transform
:scale-x "50%"
:scale-y "50%"
:halign "center"
:valign "center"
:translate-x "16"
:translate-y "16"
(image
:path "${image}"
:image-width "32"
:image-height "32")))))
(defwidget workspace [activeOn occupied id icon monitor]
(eventbox
:onclick `/home/willifan/.config/scripts/workspaces.sh ${id}`
:class {activeOn == monitor ? "activeWorkspace" : "smallBox"}
:valign "center"
:halign "center"
:height 20
:width 20
(box
:halign "center"
:space-evenly false
(smallSpacer)
(label
:class {occupied > 0 ? "" : "unoccupiedWorkspace"}
:width 16
:text {matches(id, "special:") ? substring(id, 8, 1) : id })
(imageDPI
:visible {occupied > 0 ? true : false}
:image "/usr/share/icons/Papirus-Dark/128x128/apps/${icon}"
:size "16")
(smallSpacer))))
(defwidget smallSpacer []
(box
:width 2))
(defwidget space []
(box
:width 5))
(defwidget seperator []
(box
(label
:text "|"
)))

25
eww/variables.yuck Normal file
View file

@ -0,0 +1,25 @@
(deflisten brightnessValue
:initial "0"
`scripts/brightness.sh`)
(deflisten network
:initial '{"name":"No Connection","image":"n.A."}'
`scripts/network.sh`)
(deflisten workspaces
:initial ''
`scripts/clients/build/clients`)
(defpoll bluetooth
:initial '{"name":"","battery":"0"}'
:interval "2s"
`scripts/bluetooth.sh`)
(deflisten volume
:initial '{"volume":"0","muted":"0"}'
`scripts/volume.sh`)
;;(defpoll media
;; :initial '{"status":"","name":""}'
;; :interval "2s"
;; `scripts/media.sh`)