forked from Shinonome/dots-hyprland
154 lines
5.0 KiB
Plaintext
Executable File
154 lines
5.0 KiB
Plaintext
Executable File
(defwidget winacts []
|
|
(box
|
|
:space-evenly false
|
|
:orientation "v"
|
|
:style "
|
|
${anim_open_winactions ? 'transition: 150ms cubic-bezier(0.05, 0.7, 0.1, 1);' : 'transition: 150ms cubic-bezier(0.3, 0, 0.8, 0.15);'}
|
|
${rev_winactions ? '' : 'margin-bottom: -700px;'}
|
|
"
|
|
(eventbox
|
|
:onclick "scripts/toggle-winactions.sh --close &"
|
|
:onmiddleclick "scripts/toggle-winactions.sh --close &"
|
|
:onrightclick "scripts/toggle-winactions.sh --close &"
|
|
(box
|
|
:class "box-that-is-there" :style "min-height: 1px;"
|
|
)
|
|
)
|
|
(box
|
|
:class "winwin-top"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
; Row 1: Network, Bluetooth, Airplane
|
|
(box
|
|
:class "winactions-togglerow"
|
|
:space-evenly false
|
|
(box :orientation "v" :space-evenly false
|
|
(box
|
|
:class "winactions-toggle winactions-toggle-${net.level != '0' && net.essid != 'lo'}"
|
|
:orientation "h"
|
|
(button
|
|
:onclick "scripts/net toggle"
|
|
:class "winactions-toggle-icon winactions-toggle-icon-left winwifi${net.level}${net.essid != 'lo' ? '-activated' : ''}"
|
|
)
|
|
(button
|
|
:onclick "gnome-control-center wifi &"
|
|
:class "winactions-toggle-icon winactions-toggle-arrow${(net.essid != 'lo') ? '-activated' : ''}"
|
|
)
|
|
)
|
|
(label :class "wintoggle-text" :text "${net.essid}")
|
|
)
|
|
(box :orientation "v" :space-evenly false
|
|
(box
|
|
:class "winactions-toggle winactions-toggle${bluetooth.text == 'Bluetooth off' ? '' : '-true'}"
|
|
:orientation "h"
|
|
(button
|
|
:onclick "scripts/bluetooth toggle &"
|
|
:class "winactions winactions-toggle-icon-left winbluetooth${bluetooth.text == 'Disconnected' ? '' : (bluetooth.text == 'Bluetooth off' ? '-false' : '-true')}"
|
|
)
|
|
(button
|
|
:onclick "blueberry &"
|
|
:class "winactions-toggle-icon-right winactions-toggle-arrow${bluetooth.text == 'Bluetooth off' ? '' : '-activated'}"
|
|
)
|
|
)
|
|
(label :class "wintoggle-text" :text "${bluetooth.text}")
|
|
)
|
|
(box :orientation "v" :space-evenly false
|
|
(box
|
|
:class "winactions-toggle winactions-toggle-center"
|
|
(button
|
|
:onclick "scripts/airplane toggle &"
|
|
:class "winactions-toggle-icon winactions-toggle-icon-center winactions-airplane"
|
|
)
|
|
)
|
|
(label :class "wintoggle-text" :text "Flight Mode")
|
|
)
|
|
)
|
|
; Row 2: Night light
|
|
(box
|
|
:class "winactions-togglerow"
|
|
:space-evenly false
|
|
(box
|
|
:orientation "v" :space-evenly false
|
|
(box
|
|
:class "winactions-toggle winactions-toggle-center winactions-toggle-${hyprjson.nightlight}"
|
|
(button
|
|
:onclick "scripts/toggle-nightlight.sh &"
|
|
:class "winactions-toggle-icon winactions-toggle-icon-center winactions-nightlight${hyprjson.nightlight ? '-activated' : ''}"
|
|
)
|
|
)
|
|
(label :class "wintoggle-text" :text "Night Light")
|
|
)
|
|
)
|
|
(box :height 30)
|
|
; Slider 1: brightness
|
|
(box
|
|
:space-evenly false
|
|
:orientation "h"
|
|
:class "winactions-sliderrow "
|
|
(box :class "winicon winbrightness winactions-element")
|
|
(scale
|
|
:value "${brightness.level}"
|
|
:onchange "light -S {}"
|
|
:class "winslider winslider-winactions"
|
|
)
|
|
)
|
|
; Slider 1: Volume
|
|
(box
|
|
:space-evenly false
|
|
:orientation "h"
|
|
:class "winactions-sliderrow"
|
|
(button
|
|
:class "winicon winvol${volume.audio == 1 ? round(volume.percent / 33, 0) : 'mute'} winactions-element"
|
|
:onclick "scripts/volume mute SINK &"
|
|
)
|
|
(scale
|
|
:value "${volume.percent}"
|
|
:onchange "scripts/volume setvol SINK {}"
|
|
:class "winslider winslider-winactions"
|
|
)
|
|
)
|
|
)
|
|
(box
|
|
:class "winwin-bottom"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(centerbox
|
|
:space-evenly false
|
|
:orientation "h"
|
|
:class "winwin-bottom-pad"
|
|
(button
|
|
:class "winactions-bottom-button"
|
|
:halign "start"
|
|
:style "padding: 0 13px;"
|
|
:onclick "scripts/toggle-winactions.sh --close power &"
|
|
(box
|
|
:space-evenly false
|
|
:orientation "h"
|
|
(box :class "winicon winbat${round(battery.percentage / 10, 0)}")
|
|
(label :class "wintoggle winbartext" :text "${battery.percentage}%")
|
|
)
|
|
)
|
|
(box)
|
|
(box
|
|
(button
|
|
:halign "end"
|
|
:onclick "scripts/toggle-winactions.sh --close settings &"
|
|
:class "winactions-bottom-button wincog winicon"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwindow winactions
|
|
:wm-ignore true
|
|
:monitor 0
|
|
:focusable true
|
|
:geometry (geometry
|
|
:x "0px"
|
|
:y "50px"
|
|
:anchor "bottom right"
|
|
)
|
|
(winacts)
|
|
) |