Add eww and SSH
This commit is contained in:
parent
3fad5809b9
commit
7f324958a5
24 changed files with 309 additions and 16 deletions
40
programs/eww/config/modules/bar.yuck
Normal file
40
programs/eww/config/modules/bar.yuck
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
(include "./widgets/components/hyprwindow.yuck")
|
||||
(include "./widgets/components/hyprworkspaces.yuck")
|
||||
(include "./widgets/components/internet.yuck")
|
||||
(include "./widgets/components/japanesedate.yuck")
|
||||
(include "./widgets/components/japaneseaudio.yuck")
|
||||
|
||||
(defwidget bar []
|
||||
(centerbox :orientation "horizontal"
|
||||
:style "padding: 0px 8px"
|
||||
(box :halign "start"
|
||||
:spacing 18
|
||||
:space-evenly false
|
||||
(hyprworkspaces)
|
||||
(hyprwindow)
|
||||
)
|
||||
""
|
||||
(box :halign "end"
|
||||
:spacing 18
|
||||
:space-evenly false
|
||||
(eventbox :onhover "eww open preview"
|
||||
:onhoverlost "eww close preview"
|
||||
barplayer
|
||||
)
|
||||
(internet)
|
||||
(japaneseaudio)
|
||||
(japanesedate)
|
||||
(label :style "color: #FAE3B0"
|
||||
:text bartime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll bartime :interval "10s"
|
||||
"date '+%H:%M'"
|
||||
)
|
||||
|
||||
(deflisten barplayer :initial ""
|
||||
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true"
|
||||
)
|
||||
5
programs/eww/config/modules/components/hyprwindow.yuck
Normal file
5
programs/eww/config/modules/components/hyprwindow.yuck
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(defwidget hyprwindow []
|
||||
(label :text "${hyprwindow_listener}")
|
||||
)
|
||||
|
||||
(deflisten hyprwindow_listener :initial "" "bash $XDG_CONFIG_HOME/eww/scripts/get-window-title")
|
||||
17
programs/eww/config/modules/components/hyprworkspaces.yuck
Normal file
17
programs/eww/config/modules/components/hyprworkspaces.yuck
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(defwidget hyprworkspaces []
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :space-evenly false
|
||||
:spacing 5
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
||||
(label :text "${workspace.id}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash $XDG_CONFIG_HOME/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "1" "bash $XDG_CONFIG_HOME/eww/scripts/get-active-workspace")
|
||||
18
programs/eww/config/modules/components/index.html
Normal file
18
programs/eww/config/modules/components/index.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Directory listing for /eww/widgets/components/</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Directory listing for /eww/widgets/components/</h1>
|
||||
<hr>
|
||||
<ul>
|
||||
<li><a href="hyprwindow.yuck">hyprwindow.yuck</a></li>
|
||||
<li><a href="hyprworkspaces.yuck">hyprworkspaces.yuck</a></li>
|
||||
<li><a href="japaneseaudio.yuck">japaneseaudio.yuck</a></li>
|
||||
<li><a href="japanesedate.yuck">japanesedate.yuck</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
</body>
|
||||
</html>
|
||||
8
programs/eww/config/modules/components/internet.yuck
Normal file
8
programs/eww/config/modules/components/internet.yuck
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(defwidget internet []
|
||||
(box :spacing 0 :space-evenly false :style "color: #f5c2e7"
|
||||
network
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll network :interval "30s"
|
||||
"iwgetid -r")
|
||||
11
programs/eww/config/modules/components/japaneseaudio.yuck
Normal file
11
programs/eww/config/modules/components/japaneseaudio.yuck
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(defwidget japaneseaudio []
|
||||
(eventbox :onscroll "bash -c 'if [ '{}' = 'up' ]; then pamixer -i 5; else pamixer -d 5; fi'"
|
||||
(box :spacing 0 :space-evenly false :style "color: #96CDFB"
|
||||
volume
|
||||
"音"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll volume :interval "1s"
|
||||
"pamixer --get-volume")
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(defwidget japanesebattery []
|
||||
(box :spacing 0 :space-evenly false :style "color: #FAB387"
|
||||
power
|
||||
"電"
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll power :interval "1m"
|
||||
"cat /sys/class/power_supply/BAT1/capacity")
|
||||
9
programs/eww/config/modules/components/japanesedate.yuck
Normal file
9
programs/eww/config/modules/components/japanesedate.yuck
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(defwidget japanesedate []
|
||||
(label :style "color: #DDB6F2"
|
||||
:text japanesedate_time
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll japanesedate_time :interval "100s"
|
||||
"bash $XDG_CONFIG_HOME/eww/scripts/japanesedate"
|
||||
)
|
||||
16
programs/eww/config/modules/index.html
Normal file
16
programs/eww/config/modules/index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Directory listing for /eww/widgets/</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Directory listing for /eww/widgets/</h1>
|
||||
<hr>
|
||||
<ul>
|
||||
<li><a href="bar.yuck">bar.yuck</a></li>
|
||||
<li><a href="components/">components/</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
</body>
|
||||
</html>
|
||||
15
programs/eww/config/modules/powerbar.yuck
Normal file
15
programs/eww/config/modules/powerbar.yuck
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defwidget powerbar []
|
||||
(box
|
||||
:orientation "vertical"
|
||||
:spacing 8
|
||||
:space-evenly false
|
||||
:style "color: #FAB387"
|
||||
(progress
|
||||
:orientation "v"
|
||||
:value {100 - power})
|
||||
"電"
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll power :interval "1m"
|
||||
"cat /sys/class/power_supply/BAT1/capacity")
|
||||
Loading…
Add table
Add a link
Reference in a new issue