---
scripts/appscripts/sxmo_scaledisplay.sh | 34 +++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100755 scripts/appscripts/sxmo_scaledisplay.sh
diff --git a/scripts/appscripts/sxmo_scaledisplay.sh b/scripts/appscripts/sxmo_scaledisplay.sh
new file mode 100755
index 0000000..0b1c52d
--- /dev/null
+++ b/scripts/appscripts/sxmo_scaledisplay.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# title="$icon_fnd Scale Display"
+# Description: select display scale factor
+# Note: v0.2
+menu() {
+ # TODO: export WVKBD_LAYERS to a number layout when one exists.
+ SCALEINPUT="$(
+ echo "
+ 4
+ 3.5
+ 3
+ 2.5
+ 2
+ 1.75
+ 1.5
+ 1.25
+ 1
+ Close Menu
+ " | awk 'NF' | awk '{$1=$1};1' | sxmo_dmenu.sh -p Select scale factor
+ )"
+ [ "Close Menu" = "$SCALEINPUT" ] && exit 0
+
+ case "$SXMO_WM" in
+ sway)
+ swaymsg "output \"DSI-1\" scale $SCALEINPUT"
+ ;;
+ *)
+ notify-send "Scale Display only supports sway."
+ exit 1
+ ;;
+ esac
+}
+
+menu
--
2.45.2
This seems like a good idea, but I'm not sure appscripts are the right
place for it. This seems better suited to be part of sxmo_wmmenu.sh.
Also that commit message doesn't describe at all what this patch does,
something like this would be a lot more useful:
```
appscripts: add scaledisplay script to adjust screen scale
It is sometimes necessary to adjust the screen scale in order to fit
applications that aren't optimized for small screens. Add a menu entry
to make this easier.
```
On Sat, Jun 15, 2024 at 08:34:01PM GMT, magdesign wrote:
> ---
> scripts/appscripts/sxmo_scaledisplay.sh | 34 +++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
> create mode 100755 scripts/appscripts/sxmo_scaledisplay.sh
>
> diff --git a/scripts/appscripts/sxmo_scaledisplay.sh b/scripts/appscripts/sxmo_scaledisplay.sh
> new file mode 100755
> index 0000000..0b1c52d
> --- /dev/null
> +++ b/scripts/appscripts/sxmo_scaledisplay.sh
> @@ -0,0 +1,34 @@
> +#!/bin/sh
> +# title="$icon_fnd Scale Display"
> +# Description: select display scale factor
> +# Note: v0.2
No need for version information, git tracks that for us.
> +menu() {
> + # TODO: export WVKBD_LAYERS to a number layout when one exists.
wvkbd should never be started from this script, there's not much we can
do besides having bemenu report a numeric field via the input method
protocol, which is totally unimplemented.
> + SCALEINPUT="$(
> + echo "
> + 4
> + 3.5
> + 3
> + 2.5
> + 2
> + 1.75
> + 1.5
> + 1.25
> + 1
> + Close Menu
> + " | awk 'NF' | awk '{$1=$1};1' | sxmo_dmenu.sh -p Select scale factor
> + )"
> + [ "Close Menu" = "$SCALEINPUT" ] && exit 0
prefer an if / case statement here, if we add `set -e` to this script,
this statement will always exit.
> + case "$SXMO_WM" in
> + sway)
> + swaymsg "output \"DSI-1\" scale $SCALEINPUT"
> + ;;
> + *)
> + notify-send "Scale Display only supports sway."
> + exit 1
> + ;;
> + esac
If this is included in sxmo_wmmenu as a submenu, we can hide it if we
don't support the environment, then we wouldn't need any of this logic.
> +}
> +
> +menu
> --
> 2.45.2
>
Marking as needs revision due to a lack of response to my earlier
feedback. Please either explain why this should be in the scripts menu
instead of the windows menu, or send a new version that moves it there.