feat: eww workspaces

This commit is contained in:
hesam-init 2024-06-28 09:56:54 +03:30
parent 2a1ec8967b
commit dccad1e64e
12 changed files with 564 additions and 476 deletions

View file

@ -12,7 +12,7 @@ declare -A PACKAGES=(
["BASE_PACKAGES"]="inetutils v4l2loopback bind-utils zellij bat dust aria2 fzf neofetch bat zsh fish-shell brightnessctl bluez cronie git stow eza dbus seatd elogind polkit NetworkManager gnome-keyring polkit-gnome pipewire wireplumber inotify-tools xorg gnome-keyring polkit-gnome mtpfs ffmpeg libnotify"
["DEVEL_PACKAGES"]="glib pango-devel gdk-pixbuf-devel libdbusmenu-gtk3-devel glib-devel gtk+3-devel gtk-layer-shell-devel base-devel startup-notification-devel cairo-devel xcb-util-devel xcb-util-cursor-devel xcb-util-xrm-devel xcb-util-wm-devel"
["AMD_DRIVERS"]="opencv Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers-32bit mesa-vulkan-radeon mesa-vulkan-radeon-32bit vulkan-loader vulkan-loader-32bit libspa-vulkan libspa-vulkan-32bit amdvlk mesa-dri mesa-vaapi"
["HYPRLAND_PACKAGES"]="eww nerd-fonts-symbols-ttf Waybar avizo dunst swaybg mpvpaper grim jq slurp cliphist wl-clipboard swayidle pavucontrol nemo eog pavucontrol evince xorg-server-xwayland xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils qt5-x11extras qt5-wayland qt6-wayland"
["HYPRLAND_PACKAGES"]="socat eww nerd-fonts-symbols-ttf Waybar avizo dunst swaybg mpvpaper grim jq slurp cliphist wl-clipboard swayidle pavucontrol nemo eog pavucontrol evince xorg-server-xwayland xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils qt5-x11extras qt5-wayland qt6-wayland"
["SYSTEM_APPS"]="alacritty octoxbps blueman wifish wpa_gui glow"
)

View file

@ -1,68 +1,84 @@
.widget {
padding: 5px 5px;
border-radius: 5px;
background-color: $surface0;
margin: 5px 2px;
color: $white0;
// border-style: solid;
// border-color: $white0;
// border-width: 2px;
}
.barwidget {
background-color: $base;
padding: 5px;
background-color: $base;
padding: 5px;
}
.icon {
font-size: 20px;
min-width: 1em;
min-height: 1em;
font-family: "Symbols Nerd Font";
padding: 2px 0px;
font-size: 20px;
min-width: 1em;
min-height: 1em;
font-family: "Symbols Nerd Font";
padding: 2px 0px;
}
.revealtouch {
font-size: 20px;
margin: 5px 0px;
color: $surface2;
font-size: 20px;
margin: 5px 0px;
color: $surface2;
}
.workspaces {
padding: 5px;
}
@extend .widget;
.workspaces label {
font-size: 18;
padding-right: 5px;
padding: 2px 5px 2px 0px;
}
* {
transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 500ms;
}
.widget {
padding: 5px 5px;
border-radius: 5px;
background-color: $surface0;
margin: 5px 2px;
color: $white0;
// border-style: solid;
// border-color: $white0;
// border-width: 2px;
.workspace {
margin: 6px;
border-radius: 4px;
}
.workspacething {
background-color: $surface2;
}
.workspacethingactive {
background-color: $accent;
}
.label {
// font-size: 18;
// padding-right: 5px;
// padding: 2px 5px 2px 0px;
}
}
.clock label {
font-size: 20px;
font-size: 20px;
}
.bat_scale trough{
min-height: 50px;
min-width: 18px;
border-radius: 5px;
slider {
all: unset;
}
.bat_scale trough {
min-height: 50px;
min-width: 18px;
border-radius: 5px;
slider {
all: unset;
}
}
.bat_scale trough highlight{
border-radius: 5px;
background-color: $accent;
.bat_scale trough highlight {
border-radius: 5px;
background-color: $accent;
}
.charging trough highlight {
background-color: $green;
background-color: $green;
}
.dying trough highlight {
background-color: $red;
background-color: $red;
}
// .mpd label {
@ -74,87 +90,73 @@
// }
.mpd_controls label {
font-family: "Symbols Nerd Font";
min-width: 1em;
min-height: 1em;
font-size: 30px;
padding: 15px;
font-family: "Symbols Nerd Font";
min-width: 1em;
min-height: 1em;
font-size: 30px;
padding: 15px;
}
.seektime {
trough {
min-height: 10px;
min-width: 180px;
trough {
min-height: 10px;
min-width: 180px;
slider {
background-color: $white2;
border-radius: 25px;
min-height: 20px;
min-width: 20px;
margin: -10px;
}
highlight {
background-color: $red;
}
slider {
background-color: $white2;
border-radius: 25px;
min-height: 20px;
min-width: 20px;
margin: -10px;
}
highlight {
background-color: $red;
}
}
}
.sidempdctl {
margin: 5px;
label {
font-size: 30px;
padding-right: 5px;
min-height: 1em;
min-width: 1em;
}
margin: 5px;
label {
font-size: 30px;
padding-right: 5px;
min-height: 1em;
min-width: 1em;
}
}
.mpdvolumeseek {
@extend .seektime;
trough {
min-height: 100px;
min-width: 10px;
highlight {
background-color: $white0;
}
@extend .seektime;
trough {
min-height: 100px;
min-width: 10px;
highlight {
background-color: $white0;
}
}
}
.touch label {
font-size: 20px;
font-size: 20px;
}
.mtitle {
color: $white0;
font-size: 20px;
margin-top: 30px;
color: $white0;
font-size: 20px;
margin-top: 30px;
}
.launchicon {
@extend .icon;
color: $accent;
@extend .icon;
color: $accent;
}
.picon {
@extend .icon;
font-size: 18px;
@extend .icon;
font-size: 18px;
}
.lightning {
color: $surface0
}
.workspacething, .workspacethingactive {
transition: 500ms;
border-radius: 5;
margin: 6px;
}
.workspacething {
background-color: $surface2;
}
.workspacethingactive {
background-color: $accent;
color: $surface0;
}

View file

@ -14,6 +14,7 @@
:wm-ignore false
(barstruct))
(defwidget barstruct []
(box
:orientation "h"
@ -66,25 +67,57 @@
:hexpand false
(stray)
(sliders)
(battery)
(clock)
; (battery)
))
(defvar show_no_of_windows false)
(deflisten workspacesdata :initial "[]" "./scripts/workspaces get-all-workspaces")
(defpoll current_workspace :initial "0" :interval "50ms" "./scripts/workspaces get-active-workspace")
(defwidget workspaces []
(eventbox
(eventbox
:cursor "pointer"
:onscroll "./scripts/workspaces change {} ${current_workspace}"
:onhover "eww update show_no_of_windows=true"
:onhoverlost "eww update show_no_of_windows=false"
(box
:class "workspaces widget"
:orientation "v"
:space-evenly false
(for workspace in {workspacejson}
(button
:onclick "swaymsg -t command workspace number ${workspace.name}"
(box
:hexpand false
:width 10
:height { workspace.focused ? 60 : !workspace.empty ? 40 : 30}
:class { workspace.focused ? "workspacethingactive" : "workspacething"}))))))
:class "workspaces"
:space-evenly false
:orientation "v"
(for workspace in {workspacesdata}
(button
:onclick "hyprctl dispatch workspace ${workspace.id}"
(box
:hexpand false
:width 10
:height { workspace.id == current_workspace ? 60 : 35 }
:class "workspace ${workspace.id == current_workspace ? "workspacethingactive" : "workspacething"}"
)
)
)
)
)
)
; (defwidget workspaces []
; (eventbox
; :cursor "pointer"
; (box
; :class "workspaces widget"
; :orientation "v"
; :space-evenly false
; (for workspace in {workspacejson}
; (button
; :onclick "swaymsg -t command workspace number ${workspace.name}"
; (box
; :hexpand false
; :width 10
; :height { workspace.focused ? 60 : !workspace.empty ? 40 : 30}
; :class { workspace.focused ? "workspacethingactive" : "workspacething"}))))))
(defwidget home []
(box

View file

@ -1 +1 @@
@import "./themes/oxocarbon.scss"
@import "./themes/oxocarbon.scss";

View file

@ -1,11 +1,11 @@
(defwindow control_panel
:geometry (geometry
:x 10
:y 10
:width 340
:height 1000
:anchor "top left"
)
:x 10
:y 10
:width 340
:height 1000
:anchor "top left"
)
:stacking "overlay"
:monitor 0
(control_widget))
@ -35,7 +35,7 @@
:visible {!short}
(tricontrol)
(notiweathertoggle))
))
))
(defwidget tricontrol[]
(eventbox
@ -107,19 +107,19 @@
:val gapsouter
:onchange "swaymsg gaps outer all set {}"
:max 300
:reset "${EWW_CMD} update gapsouter=0 && swaymsg gaps outer all set 0")
:reset "${EWW_CMD} update gapsouter=0 && swaymsg gaps outer all set 0")
(wmslider
:name "gaps inner"
:val gapsinner
:onchange "swaymsg gaps inner all set {}"
:max 150
:reset "${EWW_CMD} update gapsinner=15 && swaymsg gaps inner all set 15")
:reset "${EWW_CMD} update gapsinner=15 && swaymsg gaps inner all set 15")
(wmslider
:name "border size"
:val borderpixel
:onchange "swaymsg default_border pixel {} && swaymsg '[app_id=\".*\"] border pixel {}'"
:max 50
:reset "${EWW_CMD} update borderpixel=2 && swaymsg default_border pixel 2 && swaymsg '[app_id=\".*\"] border pixel 2'")
:reset "${EWW_CMD} update borderpixel=2 && swaymsg default_border pixel 2 && swaymsg '[app_id=\".*\"] border pixel 2'")
(box
:orientation "h"
:space-evenly false
@ -128,7 +128,7 @@
(label :text "natural scrolling")
(checkbox
:onchecked "swaymsg input \"type:touchpad\" natural_scroll enable"
:onunchecked "swaymsg input \"type:touchpad\" natural_scroll disable"))
:onunchecked "swaymsg input \"type:touchpad\" natural_scroll disable"))
(box
:orientation "h"
:space-evenly false
@ -150,19 +150,19 @@
:onchecked "swaymsg [app_id='.*'] inhibit_idle open && ${EWW_CMD} update caffeine=true"
:onunchecked "swaymsg [app_id='.*'] inhibit_idle none && ${EWW_CMD} update caffeine=false"
))
))))
))))
(defwidget sysinfo []
(revealer
:reveal reveal5
:transition "slideup"
(box
:orientation "h"
:height 140
(systat :icon "󰻠" :val { EWW_CPU.avg })
(systat :icon "󰍛" :val { EWW_RAM.used_mem_perc })
(systat :icon "" :val { EWW_BATTERY.BAT0.capacity })
)))
(box
:orientation "h"
:height 140
(systat :icon "󰻠" :val { EWW_CPU.avg })
(systat :icon "󰍛" :val { EWW_RAM.used_mem_perc })
(systat :icon "" :val { EWW_BATTERY.BAT0.capacity })
)))
(defwidget wmslider [name val onchange max reset]
(box
@ -174,18 +174,18 @@
:valign "center"
:spacing 10
(label
:text name)
:text name)
(scale
:min 0
:max max
:class "wmctrlslide"
:tooltip val
:value val
:onchange onchange)
:onchange onchange)
(button
:onclick reset
:style "padding: 0px 8px 0px 3px;"
"")))
"")))
(defwidget systat [icon val]
(overlay
@ -194,7 +194,7 @@
:valign "center"
:class "circsys"
:thickness 40
:value val)
:value val)
(box
:class "circiconcontain"
@ -248,19 +248,19 @@
:onclick "${EWW_CMD} update revealweather=true"
(label :class {revealweather ? "titlesel" : "title"} :text "Weather")))
(box
:orientation "h"
:vexpand true
:hexpand true
:space-evenly false
(revealer
:reveal {!revealweather}
:transition "slideright"
(notificationlog))
(revealer
:reveal revealweather
:transition "slideleft"
(weather)))))
(box
:orientation "h"
:vexpand true
:hexpand true
:space-evenly false
(revealer
:reveal {!revealweather}
:transition "slideright"
(notificationlog))
(revealer
:reveal revealweather
:transition "slideleft"
(weather)))))
(defwidget weather[]
(overlay
@ -287,8 +287,8 @@
:hexpand true
:vexpand false
:height 80
:class "fadeoutbox")
))
:class "fadeoutbox")
))
(defwidget weatherhour[hour]
(box
@ -304,7 +304,7 @@
(image
:image-width 50
:image-height 50
:path "./image/weather/${hour.icon}.svg")
:path "./image/weather/${hour.icon}.svg")
(box
:orientation "v"
:space-evenly false
@ -325,7 +325,7 @@
:image-width 100
:image-height 100
:style "margin: 10px;"
:path "./image/weather/${weatherjson.icon}.svg")
:path "./image/weather/${weatherjson.icon}.svg")
(scroll
:hscroll true
:vscroll false
@ -338,7 +338,7 @@
(label :halign "start" :text "← ${weatherjson.windspeedKmph} km/h")
;; (label :halign "start" :text "${weatherjson.visibility} km")
;; (label :halign "start" :text "${weatherjson.precipMM} mm")
))))
))))
(defwidget timer[]
(box
@ -377,10 +377,10 @@
:tooltip "${volume}%"
:max 100
:min 0
:flipped true)
(label
:class "slideicon"
:valign "end"
:flipped true)
(label
:class "slideicon"
:valign "end"
:text {volumemute == 'false' ? "󰕾" : "󰖁"})))
(defwidget bigbright []
@ -394,10 +394,10 @@
:tooltip "${brightness}%"
:max 100
:min 0
:flipped true)
(label
:class "slideicon"
:valign "end"
:flipped true)
(label
:class "slideicon"
:valign "end"
:text "󰃞")))
(defwidget notificationlog []
@ -427,19 +427,19 @@
:hexpand true
:vexpand false
:height 80
:class "fadeoutbox"))
:class "fadeoutbox"))
(box
:orientation "h"
(button
:onclick "./scripts/notifManage --clear"
(label
:class "title"
:text "Clear All"))
:text "Clear All"))
(button
:onclick "./scripts/notifManage --toggle"
(label
:class { notifications.dnd ? "titlesel" : "title"}
:text "Do Not Disturb")))))
:text "Do Not Disturb")))))
(defwidget quote []
(box
@ -454,10 +454,10 @@
:class "quote"
:text {quotejson.content}
:wrap true
:width 300))
:width 300))
(label
:class "quoteauthor"
:text "- ${quotejson.author}")))
:text "- ${quotejson.author}")))
(defwidget coolmpd [h permashow]
(overlay
@ -467,7 +467,7 @@
:height h
:class { pcover != "" ? "mpdcover" : "unbarwidget"}
:style "background-image: url('${pcover}')"
:visible {permashow ? true : pcover != "" })
:visible {permashow ? true : pcover != "" })
(box
:orientation "h"
:space-evenly false

View file

@ -2,11 +2,11 @@
;; Dashboard design is made by tsukki9696
(defwindow dashboard
:geometry (geometry
:x 0
:y 0
:width 800
:height 420
:anchor "center")
:x 0
:y 0
:width 800
:height 420
:anchor "center")
:stacking "overlay"
:monitor 0
(structure))
@ -35,13 +35,13 @@
(dbutt)
(theme))
(dcal)
))
))
(box
:orientation "v"
:space-evenly false
(dnotes)
(quote))
)))
)))
(defwidget duser [name tag pfp]
(box
@ -81,7 +81,7 @@
(box
:class "mpdcover"
:style "background-image: url('${pcover}')"
:height 150)
:height 150)
(box
:orientation "v"
:space-evenly false
@ -96,14 +96,14 @@
:vscroll false
(label :text partist))
;; (scale
;; :hexpand false
;; :width 60
;; :class "seektime"
;; :value current
;; :orientation "h"
;; :min -5
;; :max 100
;; :onscroll "mpc -q seek +1"
;; :hexpand false
;; :width 60
;; :class "seektime"
;; :value current
;; :orientation "h"
;; :min -5
;; :max 100
;; :onscroll "mpc -q seek +1"
;; :tooltip "${ctime}/${ttime}")
(box
:orientation "h"
@ -126,7 +126,7 @@
:show-day-names false
:show-week-numbers false
:day calendar_day
:year calendar_year)))
:year calendar_year)))
(defwidget dbutt[]
(box
@ -152,9 +152,9 @@
(label :style "font-size: 18px;" :text "")))
;; (defwidget dquote []
;; (box
;; :class "unbarwidget"
;; :height "120"
;; :valign "center"
;; (literal
;; :content quoteliteral)))
;; (box
;; :class "unbarwidget"
;; :height "120"
;; :valign "center"
;; (literal
;; :content quoteliteral)))

View file

@ -1,10 +1,10 @@
(defwindow desktopicons
:geometry (geometry
:x 20
:y 20
:width 100
:height 600
:anchor "top right")
:x 20
:y 20
:width 100
:height 600
:anchor "top right")
:stacking "bottom"
:monitor 0
(box

View file

@ -1,11 +1,10 @@
(defwindow dock
:geometry (geometry
:x 0
:y 0
:width 10
:height 54
:anchor "bottom center")
:stacking "overlay"
:x 0
:y 0
:width 10
:height 54
:anchor "bottom center")
:monitor 0
(dockstruct))
@ -18,7 +17,7 @@
:space-evenly false
:valign "end"
(box
:height 4)
:height 4)
(revealer
:reveal revealdock
:transition "slideup"
@ -44,7 +43,7 @@
(image
:image-width iconsize
:image-height iconsize
:path {task.path})
:path {task.path})
(scroll
:hscroll true
@ -59,6 +58,6 @@
:class "dockindicate"
:hexpand false
:width { focus ? 10 : 5 }
:height 3))))
)))))
:height 3))))
)))))

View file

@ -1,139 +1,140 @@
@import './colors.scss';
@import './bar/bar.scss';
// @import './bottom_bar/bar.scss';
@import './control_panel/control_panel.scss';
@import './dashboard/dashboard.scss';
@import './dock/dock.scss';
@import './desktop/desktop.scss';
@import './notification/notification.scss';
@import "./colors.scss";
@import "./bar/bar.scss";
// @import "./bottom_bar/bar.scss";
@import "./control_panel/control_panel.scss";
@import "./dashboard/dashboard.scss";
@import "./dock/dock.scss";
@import "./desktop/desktop.scss";
@import "./notification/notification.scss";
* {
all: unset;
color: $white0;
font-size: 15px;
font-family: "Iosevka Nerd Font";
// font-weight: bold;
// font-smooth: never;
all: unset;
color: $white0;
font-size: 15px;
font-family: "Iosevka Nerd Font";
// font-weight: bold;
// font-smooth: never;
}
tooltip {
background-color: $surface0;
color: $white0;
border-radius: 5px;
border-style: solid;
border-width: 2px;
border-color: $surface2;
background-color: $surface0;
color: $white0;
border-radius: 5px;
border-style: solid;
border-width: 2px;
border-color: $surface2;
}
scale {
all: unset;
trough {
background-color: $surface2;
border-radius: 24px;
min-height: 80px;
min-width: 10px;
margin : 5px;
all: unset;
slider {
background-color: $white2;
border-radius: 25px;
min-height: 15px;
min-width: 15px;
margin: -10px;
}
trough {
background-color: $surface2;
border-radius: 24px;
min-height: 80px;
min-width: 10px;
margin: 5px;
highlight {
background-color: $white0;
border-radius: 24px;
}
slider {
background-color: $white2;
border-radius: 25px;
min-height: 15px;
min-width: 15px;
margin: -10px;
}
highlight {
background-color: $white0;
border-radius: 24px;
}
}
}
button {
transition-duration: 0.5s;
border-radius: 5px;
}
button:hover {
background-color: $surface2;
transition-duration: 0.5s;
border-radius: 5px;
}
button:hover {
background-color: $surface2;
}
calendar {
all: unset;
background-color: $surface0;
font-size: 20;
color: $white0;
all: unset;
background-color: $surface0;
font-size: 20;
color: $white0;
}
calendar:selected {
color: $base;
background-color: $accent;
border-radius: 25px;
color: $base;
background-color: $accent;
border-radius: 25px;
}
calendar.header {
color: $accent;
font-weight: bold;
color: $accent;
font-weight: bold;
}
calendar:indeterminate {
color: $surface2;
color: $surface2;
}
checkbutton {
border-radius: 24px;
background-color: $surface1;
padding: 4px;
check {
min-height: 15px;
min-width: 15px;
color: $white0;
}
border-radius: 24px;
background-color: $surface1;
padding: 4px;
check {
min-height: 15px;
min-width: 15px;
color: $white0;
}
}
checkbutton:checked {
check{
border-radius: 24px;
background-color: $white0;
}
check {
border-radius: 24px;
background-color: $white0;
}
}
.popup {
background-color: $base;
padding: 5px;
border-radius: 5px;
border-style: solid;
border-color: $surface2;
border-width: 2px;
margin: 10px;
background-color: $base;
padding: 5px;
border-radius: 5px;
border-style: solid;
border-color: $surface2;
border-width: 2px;
margin: 10px;
}
entry {
// image: url('./image/screenshot.png');
padding: 5px;
margin: 5px;
border-radius: 5px;
border-style: solid;
border-color: $surface2;
background-color: $surface1;
color: $white0;
// image: url('./image/screenshot.png');
padding: 5px;
margin: 5px;
border-radius: 5px;
border-style: solid;
border-color: $surface2;
background-color: $surface1;
color: $white0;
}
.mainentry {
background-color: $surface1;
padding: 5px;
border-radius: 5px;
margin: 5px;
background-color: $surface1;
padding: 5px;
border-radius: 5px;
margin: 5px;
}
.mainentry label {
font-size: 18px;
color: $white0;
font-size: 18px;
color: $white0;
}
.smallentry {
@extend .mainentry;
label {
font-size: 15px;
}
@extend .mainentry;
label {
font-size: 15px;
}
}

View file

@ -77,14 +77,13 @@ elif [ "$1" = "control" ]; then
elif [ "$1" = "dashboard" ]; then
dashboard
elif [ "$1" = "colourpick" ]; then
COLOUR=$(grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | awk -F ' ' 'NR==2 {print $3}')
wl-copy "$COLOUR"
notify-send -a colourpicker -i ~/.config/eww/carbonmonoxide/image/eyedropper.png -t 3000 "$COLOUR" "Colour copied to clipboard"
hyprpicker -a
notify-send -a colourpicker -i ~/.config/eww/image/eyedropper.png -t 3000 "Colour copied to clipboard"
elif [ "$1" = "scrop" ]; then
# control
# sleep 0.5
grim -g "$(slurp)" - | wl-copy
notify-send -a screenshot -i ~/.config/eww/carbonmonoxide/image/screenshot.png -t 3000 "Screenshot Taken" "Image copied to clipboard"
notify-send -a screenshot -i ~/.config/eww/image/screenshot.png -t 3000 "Screenshot Taken" "Image copied to clipboard"
elif [ "$1" = "sscreen" ]; then
# control
grim - | wl-copy

View file

@ -0,0 +1,54 @@
#!/bin/bash
SOCKET="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
spaces() {
local workspace_windows=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
seq 1 5 | jq --argjson windows "$workspace_windows" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
}
clamp() {
python -c "print(max($1, min($3, $2)))"
}
get_workspaces() {
spaces
socat -u UNIX-CONNECT:"$SOCKET" - | while read -r; do
spaces
done
}
get_active_workspace() {
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:"$SOCKET" - | stdbuf -o0 awk -F '>>|,' '/^workspace>>/ {print $2} /^focusedmon>>/ {print $3}'
}
change_workspace() {
local direction=$1 current=$2 target
if [[ "$direction" == "down" ]]; then
target=$(clamp 1 9 $((current + 1)))
elif [[ "$direction" == "up" ]]; then
target=$(clamp 1 9 $((current - 1)))
else
echo "Invalid direction" >&2
return 1
fi
echo "Jumping to $target"
hyprctl dispatch workspace "$target"
}
main() {
case $1 in
get-all-workspaces) get_workspaces ;;
get-active-workspace) get_active_workspace ;;
change) change_workspace "$2" "$3" ;;
*)
echo "Usage: $0 {gw|ga|c <direction> <current>}" >&2
exit 1
;;
esac
}
main "$@"

View file

@ -1,17 +1,17 @@
(defwindow wallpaperselect
:geometry (geometry
:x 0
:y 0
:width 415
:height 600
:anchor "center")
:x 0
:y 0
:width 415
:height 600
:anchor "center")
:stacking "overlay"
:monitor 0
:focusable true
(box
:class "popup"
(wallpaperselectwidget)))
(wallpaperselectwidget)))
(defwidget wallpaperselectwidget []
(eventbox
@ -26,13 +26,13 @@
(input
:hexpand true
:onaccept "./scripts/wallhaven.py search {}"
:timeout "20000ms")
:timeout "20000ms")
(button
:onclick "${EWW_CMD} update wallpapers=[] && ./scripts/wallhaven.py reset"
;; :style "padding: 0px 8px 0px 3px;"
(label
:class "icon"
:text "")))
:text "")))
(scroll
:hscroll false
@ -51,7 +51,7 @@
(label
:visible {arraylength(wallpapers) == 0}
:text "No wallpapers yet")
:text "No wallpapers yet")
(for wall in wallpapers
(box
@ -67,5 +67,5 @@
:space-evenly true
(label :text "${wall.views} 󰈈")
(label :text "${wall.fav} 󰣐")
))))
))))
))))