Skip to content

Commit

Permalink
update eww to work in second monitor using various hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelospro committed Aug 11, 2023
1 parent f01ca1b commit 703ea2d
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 71 deletions.
60 changes: 38 additions & 22 deletions dot_config/eww/eww.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
/** tooltip!! **/
tooltip.background {
background-color: $transparent;
font-size: 18;
font-size: 18px;
border-radius: 10px;
color: $background;
}
Expand All @@ -79,34 +79,43 @@ tooltip label {

/** Widgets **/

.clock_date_class {
font-size: 24;
.clock_date_class0 {
font-size: 24px;
margin: 0px 20px 0px 0px;
color: $red;
}

.clock_date_class1 {
font-size: 20px;
margin: 0px 20px 0px 0px;
color: $red;
}

.clock_time_class {
.clock_time_class0 {
color: $white;
font-size: 28;
font-size: 28px;
font-weight: bold;
margin: 0px 20px 0px 5px;
}

.notif_button {
font-size: 28;
margin: 0px 20px 0px 0px;
.clock_time_class1 {
color: $white;
font-size: 20px;
font-weight: bold;
margin: 0px 20px 0px 5px;
}

// .powermenu_icon {
// border-radius: 100%;
// }

.powermenu_icon {
background-size: contain;
background-repeat: no-repeat;
background-image: url("images/mainicon.jpg");
background-position: center;
min-height: 52px;
min-width: 52px;
margin: 0px 10px 5px 0px;
border-radius: 60%;
margin: 5px 10px 5px 0px;
font-family: Material\-Design\-Iconic\-Font;
font-size: 28px;
font-weight: bold;
color: $white;
border-radius: 6px;
}

.batbar {
Expand All @@ -122,7 +131,7 @@ tooltip label {
}

.bright_icon {
font-size: 22;
font-size: 22px;
color: $orange;
margin: 0px 10px 0px 0px;
}
Expand Down Expand Up @@ -362,12 +371,12 @@ scale trough {
}

.appnames-no-music {
margin: 25px 100px 0px 0px;
margin: 15px 50px 0px 0px;
padding: 0px 0px 0px 0px;
}

.appnames-music {
margin: -2px 100px 0px 0px;
margin: 0px 50px 0px 0px;
padding: 0px 0px 0px 0px;
}

Expand Down Expand Up @@ -399,15 +408,22 @@ scale trough {
margin: 0px 10px 0px 10px;
}

.app-name {
.app-name0 {
color: $white;
font-size: 20px;
font-weight: bold;
margin: -15px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

.app-name1 {
color: $white;
font-size: 14px;
font-weight: bold;
margin: 0px 0px 0px 0px;
}

.app-icon {
margin:-15px 10px 0px 0px;
margin: 0px 10px 0px 0px;
}

.app-controls {
Expand Down
94 changes: 55 additions & 39 deletions dot_config/eww/eww.yuck
Original file line number Diff line number Diff line change
Expand Up @@ -99,38 +99,40 @@
:class "app-icon"
:image-width "36"
:image-height "36"
:path {monitor == 0 ? appname0_json["icon"] : appname1_json["icon"] })
:path {monitor == 0 ? appname0_json["icon"] : appname1_json["icon"]}
)
(label
:class "app-name"
:class {monitor == 0 ? "app-name0" : "app-name1"}
:xalign 0.5
:limit-width "35"
:show-truncated true
:text {monitor == 0 ? appname0_json["title"] : appname1_json["title"] })
:text {monitor == 0 ? appname0_json["title"] : appname1_json["title"]}
)
(revealer
:transition "slideright"
:reveal control_reveal
:duration "350ms"
(box
:vexpand "false"
:hexpand "false"
:orientation "h"
:space-evenly "false"
(button
:class "app-controls"
:onclick "hyprctl dispatch togglefloating 1"
:tooltip "toggle floating"
"")
(button
:class "app-controls"
:onclick "hyprctl dispatch fullscreen 1"
:tooltip "toggle fullscreen"
"")
(button
:class "app-controls"
:onclick "kill -9 $(hyprctl activewindow | grep 'pid: ' | awk '{print $2}');"
:tooltip "kill app"
"")
)
; (box
; :vexpand "false"
; :hexpand "false"
; :orientation "h"
; :space-evenly "false"
; (button
; :class "app-controls"
; :onclick "hyprctl dispatch togglefloating 1"
; :tooltip "toggle floating"
; "")
; (button
; :class "app-controls"
; :onclick "hyprctl dispatch fullscreen 1"
; :tooltip "toggle fullscreen"
; "")
; (button
; :class "app-controls"
; :onclick "kill -9 $(hyprctl activewindow | grep 'pid: ' | awk '{print $2}');"
; :tooltip "kill app"
; "")
; )
)
)
)
Expand Down Expand Up @@ -296,7 +298,7 @@
:onclick "${EWW_CMD} open --toggle system"
""))))

(defwidget clock_module []
(defwidget clock_module [?monitor]
(eventbox
:onhover "${EWW_CMD} update time_reveal=true"
:onhoverlost "${EWW_CMD} update time_reveal=false"
Expand All @@ -306,19 +308,19 @@
:spacing "0"
(label
:text clock_time
:class "clock_time_class" )
:class {monitor == 0 ? "clock_time_class0" : "clock_time_class1"})
(revealer :transition "slideleft"
:reveal time_reveal
:duration "350ms"
(button
:class "clock_date_class"
:onclick "${EWW_CMD} open --toggle calendar" clock_date)))))
:class {monitor == 0 ? "clock_date_class0" : "clock_date_class1"}
:onclick "${EWW_CMD} open --toggle calendar" clock_date)))))

(defwidget powermenu []
(defwidget powermenu [?monitor]
(button
:class "powermenu_icon"
:onclick "pidof wlogout || wlogout -p layer-shell &"
)
"襤")
)

(defwidget sep []
Expand All @@ -339,7 +341,8 @@


(defwidget tray []
(systray :active-only false
(systray
; :active-only false
:pack-direction "ltr"
)
)
Expand All @@ -350,9 +353,10 @@
:orientation "h"
:space-evenly false
:halign "start"
:hexpand "true"
:class "left_modules"
(launcher)
(rogcontrol)
; (rogcontrol)
(sep)
(workspaces :monitor {monitor})
)
Expand Down Expand Up @@ -384,8 +388,8 @@
(bat)
(mem)
(sep)
(clock_module)
(notification-button)
(clock_module :monitor {monitor})
(notification-button :monitor {monitor})
(powermenu)
))

Expand All @@ -397,9 +401,21 @@
:orientation "h"
:hexpand "false"
:vexpand "false"
(left :monitor {monitor})
(center :monitor {monitor})
(right :monitor {monitor})
(transform
:scale-x {monitor == 0 ? "100%" : "100%"}
:translate-x {monitor == 0 ? "0%" : "0%"}
(left :monitor {monitor})
)
(transform
:scale-x {monitor == 0 ? "100%" : "100%"}
:translate-x {monitor == 0 ? "0%" : "0%"}
(center :monitor {monitor})
)
(transform
:scale-x {monitor == 0 ? "100%" : "100%"}
:translate-x {monitor == 0 ? "0%" : "0%"}
(right :monitor {monitor})
)
)
)

Expand All @@ -424,9 +440,9 @@
)
)

(defwidget notification-button[]
(defwidget notification-button [?monitor]
(button
:class "notification-button"
:class {monitor == 0 ? "notification-button0" : "notification-button1"}
:tooltip "${notificationNum} Notifications}"
:onclick "/home/evangelospro/.config/swaync/pop"
:onrightclick "swaync-client -d"
Expand Down
1 change: 0 additions & 1 deletion dot_config/eww/scripts/executable_stats
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ battery(){
else
percent=$(\cat /sys/class/power_supply/${BAT}/capacity)
status=$(\cat /sys/class/power_supply/${BAT}/status)

case $1 in
--percent) echo $percent;;
--status) echo $status;;
Expand Down
10 changes: 9 additions & 1 deletion dot_config/eww/scss/notifications.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
//Notification Center
.notification-button {
.notification-button0 {
font-family: Material\-Design\-Iconic\-Font;
font-size: 28px;
color: $white;
border-radius: 6px;
margin: 10px 0px;
}

.notification-button1 {
font-family: Material\-Design\-Iconic\-Font;
font-size: 20px;
color: $white;
border-radius: 6px;
margin: 10px 0px;
}

.notification-layout-box {
background-color: $background;
}
Expand Down
1 change: 1 addition & 0 deletions dot_config/eww/yuck/variables/bar.yuck
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; top bar

; Clock / Calendar
(defpoll clock_time :interval "5s" "date '+\%l\%M \%p'")
(defpoll clock_date :interval "10h" "date '+%b %d, %Y'")
Expand Down
14 changes: 8 additions & 6 deletions dot_config/eww/yuck/windows.yuck
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(defwindow bar0
:exclusive true
:stacking "bg"
:wm-ignore "false"
:monitor 0
:geometry (geometry
:x "15px"
:y "9px"
:width "99%"
:x "10px"
:y "3px"
:width "99.5%"
:height "75px"
:anchor "top center")
(bar_layout :monitor 0)
Expand All @@ -14,11 +15,12 @@
(defwindow bar1
:exclusive true
:stacking "bg"
:wm-ignore "false"
:monitor 1
:geometry (geometry
:x "15px"
:y "9px"
:width "99%"
:x "10px"
:y "3px"
:width "99.5%"
:height "75px"
:anchor "top center")
(bar_layout :monitor 1)
Expand Down
2 changes: 1 addition & 1 deletion dot_config/hypr/binds.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bind=ALT_L,F4,killactive
bind=CTRL_SHIFT,ESC,exec,hyprctl kill # xkill like functionality
bind=$MOD,M,exit
bind=$MOD,E,exec,eval $fileManager
bind=$SHIFT_MOD,E,exec,eval $ewwLaunch
bind=$SHIFT_MOD,R,exec,eval $ewwLaunch
bind=$SHIFT_MOD,F,togglefloating,
bind=$MOD,P,exec,~/.config/hypr/scripts/monitors
bind=$MOD,F,fullscreen
Expand Down
2 changes: 1 addition & 1 deletion dot_config/hypr/startup.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exec-once=swayidle
exec-once=avizo-service

exec-once=/usr/bin/flameshot
# exec-once=$HOME/.config/eww/launch
exec-once=$HOME/.config/eww/launch
exec-once=/usr/bin/ulauncher --no-window
{{- if (and (ne .chezmoi.hostname "ELARCH-WORK") (ne .chezmoi.hostname "ELARCH-ISO")) }}
exec-once=fusermount -u $HOME/SeaDrive ; seadrive -c $HOME/.config/seadrive/seadrive.conf -l $HOME/.seadrive/logs/seadrive.log -f -d $HOME/.seadrive/data $HOME/SeaDrive -o allow_root
Expand Down

0 comments on commit 703ea2d

Please sign in to comment.