From 7b077eb1b0c9fd223824dae8bf2c353c8a0b24e3 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Wed, 3 Jul 2024 15:26:02 +0200 Subject: [PATCH] [sway/toggle_touchpad] Show wl-overlay message --- sway/icons/touchpad_disabled.png | Bin 0 -> 3406 bytes sway/icons/touchpad_disabled.svg | 77 +++++++++++++++++++++++++++++++ sway/icons/touchpad_enabled.png | Bin 0 -> 902 bytes sway/icons/touchpad_enabled.svg | 64 +++++++++++++++++++++++++ sway/toggle_touchpad | 10 ++++ 5 files changed, 151 insertions(+) create mode 100644 sway/icons/touchpad_disabled.png create mode 100644 sway/icons/touchpad_disabled.svg create mode 100644 sway/icons/touchpad_enabled.png create mode 100644 sway/icons/touchpad_enabled.svg diff --git a/sway/icons/touchpad_disabled.png b/sway/icons/touchpad_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c54cfb9d69f69d69b7683e86b977fd14d98e53c0 GIT binary patch literal 3406 zcmbVPi$BxdAK%3+3(GAg&2%9=(H^&4lFK}%B%zDkda!8}bDh*OO6AFAsV3yUg@k^& zG#1vyElUzBmn}7km7x}z#_#+5{)FFoz0NtWbNQb4=kqzA_vd`RnciORDhOQ!2n15` zz~g*?z89#B4T?ZpG|__sIwdmRKOO{9eg1C+_rz3(1Cyu(w-X7zF~kJQ-*E&Gg+ehS zMMuSl{Y@sA#l%GvNgQ-RAmwonoU>o@-8sRztRMoaXK_A0LT{XO9~s~?kJ`E~Zu;o(zWleZjJ>CaHu#{DWtByw7SuLq-0sMgIHuBy#KL4HC~($bV* z!&Gu+bIMO~7y#mWy4|2}iNRp>Z#ECU5FpI#P@EqQDf{A4B9U(8;u;pWqFl-5&NoYJ$zlA6BQ zR-7U1B_$h0<-$=iW1D1c$0=j7(%@2Rr`%++j*EPxS6QKX1UI!yPe%bg zpsq?WZ(Zf2?dEDZ*y(A#}{Jjw}$=-;4#C zpgKN8+)2Ic4)R^JpLAkC>@MLqS8|`y61y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f@XTlTSQGg`ictH3w9ho-G7EC262cd5SI1TJy|82!B{KE=(sYn6E zzYGpJ+srCAVXI4qTek&<9xC9JI?3vT0d>$r8j0EE{RUzaj3{hIe`h;qpMBXBXx8i< zV)B&JKGL2<4f^6D-5hG9c>BpE=|B(E`6m;s<%p47G$a+rCgIvYe*6ee`u6@!bNrWq zvs`~s=Z*-`^U4h0_cTu(*VO%Bk-_ul&(DmvWDAADh}Kn>|5p#TONXvEo96kRwI^Iz zAefz-BlI(N-|E*b%BwND>z>0->V}Nwx1tuB5A-?XH3C9#V!gj1f}i(%flJ+ z`m?Qp!uE*QB>^olA1>N(ANV)^`R+mU+S(eBIAnr|OOKb9mU2G}-X@6W=R3Ou+k*o) z-i~sbke>iT=(Dn58SQ9YU0n$9ut*jrTGdL|i_lT;>Wh;L?H`_cnjSL6_f+NA2L<$g z{SXN8d5)ES<_c*k+niLvvCHuu4V)4+zwc&4J%p5Wai&A)803@W-&hR9lzF2$pK5GE zO+g|2g&+c)ulD$0dG{b;Z1@k1h@;tYU0U<0%Ker?+n`RHXJsLvP>7c<@*KgtkK++G zle*!)(VxcU07gV!M{N~0fwaK@7!+{b6tc^6v$N0D_?>iv|Zl=vb z{Z5P?hcZumenn;7kcvI_kse5JymV)@nvYR^( z=3!nX;*h(0uH&P zC^2VUL@PMk*H}6`Eis>3*l!c__1iaxiPr}XWjMmIjc7_IYGrU;eoP}mIuTae68LrRo$MFU7#_F!=k>iVp(^w*$}SwZz0*O!-77(xfU|4rvv;8fjr#2aP=;y(*FzA0)`m? literal 0 HcmV?d00001 diff --git a/sway/icons/touchpad_disabled.svg b/sway/icons/touchpad_disabled.svg new file mode 100644 index 0000000..ccd0178 --- /dev/null +++ b/sway/icons/touchpad_disabled.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + diff --git a/sway/icons/touchpad_enabled.png b/sway/icons/touchpad_enabled.png new file mode 100644 index 0000000000000000000000000000000000000000..82ef6dd51b546b52fe4691b1d771b7f1181f1d55 GIT binary patch literal 902 zcmeAS@N?(olHy`uVBq!ia0vp^CxCbw2OE%_edo9&km4-xh%9Dc;5!V$jK}j=qyPma zOI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kz!zA7WQ;;45^s&_LlAX)MS}s z4}Tj@PIP-zq9WDF6xcD{@42xD$D#`hL|WrqR*Pt<#yfb6c;(M@TkUAwBWakVdB#Nj z`JGia|CbtF4}F^=dVcTZucxEZpQ`|E#{u4)o+VdsdRy*!)k?FI!Jd6>&kY`XP0F8K zv-jGstSX;P%?{ggciW$A_nbHX-l26h^PYU&dhPsVWjE%V+ukNkdOyj=YG?D^Uxp_y zXRm!7%=~Va)sJQ0mHGU>M@;&z#@=J=xGmRu`jhP{)0deQsKs~}ZMpWV`q77z>L(rx zvj2Y{^sjnS&kUX?6Ax~-j6N23_`JXDoF_3mzok#==QC}ItuQ`myF4cQ`>9-0NsrI& zlggL77X++-_Qm0t&;Ksg-D(0FEKIEq3j{bsm>QiF0ytQ>8XXjen4pEd?E?|M*#iRwRc}qtna5=Upkn7E1YyTxBoxo$=idv z!giiT_rG*J{w8&zS0&!3-(th+<97Em@BcscrD1Z#(I!G+^6l6CJ?@_S=ExN$@XPVanLJObc9z+loZK$8$yvNOz5f5>TYHP5eSuDpvzfj5>F<@z*RLG(+?0EJ zy{FuaI|ttV-E^(0;MIqh_LuHU+Rgtfz1Q7sz5+---7{{^y@PtSyRKDL79IE^tl}Bx z^~r70{pIZ&q_0ofGxf>Tmx_=5Cqx5NnDt3v&v_^P>OVc+wtLc(*(&yHw*H$X$IQS` bknx|%G|{b?i&N78l!QH9{an^LB{Ts5JbPgu literal 0 HcmV?d00001 diff --git a/sway/icons/touchpad_enabled.svg b/sway/icons/touchpad_enabled.svg new file mode 100644 index 0000000..3273094 --- /dev/null +++ b/sway/icons/touchpad_enabled.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + diff --git a/sway/toggle_touchpad b/sway/toggle_touchpad index 17ab6a6..9d1f059 100755 --- a/sway/toggle_touchpad +++ b/sway/toggle_touchpad @@ -1,5 +1,7 @@ #!/bin/sh +cd "$(dirname "$0")" + current_state() { swaymsg -t get_inputs | jq -r 'map(select(.type == "touchpad")) | .[0].libinput.send_events' } @@ -12,3 +14,11 @@ if [ "$(current_state)" == disabled_on_external_mouse ]; then else set_state toggle enabled disabled fi + +state=$(current_state) +case $state in + enabled) image=icons/touchpad_enabled.png; ;; + disabled) image=icons/touchpad_disabled.png; ;; + *) image=""; ;; +esac +wl-overlay --time=1000 "$image" "Touchpad $state"