lightmode
E. Almqvist 2 years ago
parent efe8649a50
commit cc6d22b14e
  1. 67
      eww/.config/eww/eww.scss
  2. 26
      eww/.config/eww/eww.yuck
  3. 42
      eww/.config/eww/scripts/workspace.py

@ -1,16 +1,9 @@
// Font stuff // Font stuff
$font-size: 16px; $font-size: 16px;
$icon-size: 20px; $icon-size: 18px;
$logo-size: 24px; $logo-size: 28px;
// Basic color // Basic colors
$bg-color: #181818;
$bg-alt-color: #242424;
$fg-color: #ebdbb2;
$fg-alt-color: #635c4b;
$border-color: #484848;
// Colors
$black: #121212; $black: #121212;
$red: #f7768c; $red: #f7768c;
$green: #9ece6a; $green: #9ece6a;
@ -20,13 +13,20 @@ $magenta: #ad8ee6;
$cyan: #449dab; $cyan: #449dab;
$white: #787c99; $white: #787c99;
// Colors
$bg-color: #181818;
$bg-alt-color: #242424;
$fg-color: #ebdbb2;
$fg-alt-color: #635c4b;
$fg-sel-color: $blue;
$border-color: #484848;
// Misc // Misc
$anim-delay: 250ms; $anim-transition: 250ms;
* { * {
all: unset; //Unsets everything so you can style everything from scratch all: unset; //Unsets everything so you can style everything from scratch
font-family: "Hack Mono"; font-family: "Hack Mono", "Font Awesome";
transition: opacity $anim-delay;
// color: $fg-color; // color: $fg-color;
} }
@ -42,9 +42,23 @@ $anim-delay: 250ms;
} }
// Styles on classes (see eww.yuck for more information) // Styles on classes (see eww.yuck for more information)
button {
transition-property: opacity, color;
transition-duration: $anim-transition;
}
// Workspaces
.ws-active { font-weight: bold; }
.ws-inactive { opacity: 0.2; }
.workspaces {
// background-color: $black;
// border-radius: $font-size;
// border: 1px solid $border-color;
}
button.ws { button.ws {
color: $fg-color; // color: $fg-color;
font-size: $font-size; font-size: $font-size;
margin: 4px; margin: 4px;
} }
@ -54,6 +68,11 @@ button.ws:hover {
opacity: 1.0; opacity: 1.0;
} }
// Control
.control {
margin-bottom: $logo-size;
}
.icon { .icon {
opacity: 0.8; opacity: 0.8;
font-size: $icon-size; font-size: $icon-size;
@ -61,28 +80,16 @@ button.ws:hover {
.icon:hover { .icon:hover {
opacity: 1.0; opacity: 1.0;
color: red;
} }
// Logo button
.logo { .logo {
margin-top: $font-size; margin-top: 6px;
font-size: $icon-size; font-size: $logo-size;
// opacity: 0.8; // opacity: 0.8;
} }
.logo:hover { .logo:hover {
color: red; color: red;
} }
.workspaces {
// background-color: $black;
// border-radius: $font-size;
// border: 1px solid $border-color;
}
.ws-active {
font-weight: bold;
}
.ws-inactive {
opacity: 0.2;
}

@ -1,12 +1,12 @@
(defwidget bar [screen] (defwidget bar [screen]
(centerbox :orientation "v" (centerbox :orientation "v"
(box :class "segment-start" :valign "start" (box :class "segment-start" :valign "start" :space-evenly false :orientation "v"
(logo) (logo)
) )
(box :class "segment-mid" :valign "middle" (box :class "segment-mid" :valign "center" :orientation "v"
(workspaces :wsp workspaces-data :ori "v") (workspaces :wsp workspaces-data :ori "v")
) )
(box :class "segment-end" :valign "end" (box :class "segment-end" :valign "end" :orientation "v"
(control) (control)
) )
) )
@ -15,13 +15,21 @@
;; Logo ;; Logo
(defwidget logo [] (defwidget logo []
(button :class "logo" (button :class "logo"
"Λ" "Λ"
)) ))
(defwidget control [] (defwidget control []
(button :class "icon volume" :valign "start" (box :class "control" :spacing 16 :orientation "v"
(button :class "icon volume" :valign "start"
"" ""
) )
(button :class "icon music" :valign "start"
""
)
(button :class "icon date" :valign "start"
""
)
)
) )
;; Workspaces container ;; Workspaces container
@ -64,10 +72,10 @@
:windowtype "dock" :windowtype "dock"
:geometry (geometry :x "0%" :geometry (geometry :x "0%"
:y "0%" :y "0%"
:width "42px" :width "38px"
:height "100%" :height "100%"
:anchor "left center") :anchor "left center")
:reserve (struts :side "left" :distance "42px") :reserve (struts :side "left" :distance "38px")
(bar :screen 1)) (bar :screen 1))
(defwindow bar-2 (defwindow bar-2
@ -86,7 +94,7 @@
:geometry (geometry :x "0%" :geometry (geometry :x "0%"
:y "0%" :y "0%"
:width "182px" :width "182px"
:height "32px" :height "38px"
:anchor "right top" :anchor "right top"
) )
:reserve (struts :side "right" :distance "0px" :orientation "h") :reserve (struts :side "right" :distance "0px" :orientation "h")

@ -8,19 +8,21 @@ data using wmctrl.
import re import re
import sys import sys
import json import json
from subprocess import check_output from subprocess import check_output, CalledProcessError
# Config # Config
HIDE_EMPTY_WS = True # Exclude empty workspaces HIDE_EMPTY_WS = True # Exclude empty workspaces
OVERIDE_ALL_NAMES = False OVERIDE_ALL_NAMES = False # Override all the WS names and use the name below
OVERIDE_ALL_NAME = "" OVERIDE_ALL_NAME = "" # Name to use when overriding names
NAME_MAPS = { NAME_MAPS: dict[int, str] = { # Replace the indexs name with the given string
# 0: "", # 0: "",
# 1: "" # 1: ""
} }
LOG_FILE = "/tmp/eww_workspace.log" # Log file (in case of errors etc)
# NOTE: DO NOT TOUCH # ------------ NOTE: DO NOT TOUCH ------------
WMCTRL_SCRIPT = "wmctrl -d" WMCTRL_SCRIPT = "wmctrl -d"
PARSE_REGEX = r"^(\d+)\s+(\*|\-).+\s+(\w+)$" PARSE_REGEX = r"^(\d+)\s+(\*|\-).+\s+(\w+)$"
@ -63,16 +65,26 @@ def parse_workspaces():
Function to get all the workspaces Function to get all the workspaces
""" """
inp = check_output(WMCTRL_SCRIPT.split(" ")) try:
inp = inp.decode("utf-8") nonempty = check_output(WMCTRL_NONEMPTY_SCRIPT.split(" "))
nonempty = nonempty.decode("utf-8")
nonempty = check_output(WMCTRL_NONEMPTY_SCRIPT.split(" "))
nonempty = nonempty.decode("utf-8") nonempty_workspaces = re.findall(NONEMPTY_REGEX,
nonempty,
nonempty_workspaces = re.findall(NONEMPTY_REGEX, flags=re.MULTILINE)
nonempty, nonempty_workspaces = list(map(int, nonempty_workspaces))
flags=re.MULTILINE) except CalledProcessError:
nonempty_workspaces = list(map(int, nonempty_workspaces)) nonempty_workspaces = []
try:
inp = check_output(WMCTRL_SCRIPT.split(" "))
inp = inp.decode("utf-8")
except CalledProcessError as err:
logfile = open(LOG_FILE, "a")
logfile.write("ERROR! COULD NOT PARSE WORKSPACES OR SOMETHING! YOU ARE ON YOUR OWN.")
logfile.write(f"{err}")
inp = ""
out = [] out = []

Loading…
Cancel
Save