draw preview of a layout

This commit is contained in:
speedie 2023-03-25 20:24:58 +01:00
parent 411affccbb
commit a5fbdc0ef9
18 changed files with 52 additions and 50 deletions

View file

@ -6,7 +6,7 @@ VERSION = 1.9
dist:
mkdir -p speedwm-extras-${VERSION}
cp -R Makefile LICENSE src README.md speedwm-extras-${VERSION}
cp -R Makefile LICENSE src img README.md speedwm-extras-${VERSION}
tar -cf speedwm-extras-${VERSION}.tar speedwm-extras-${VERSION}
gzip speedwm-extras-${VERSION}.tar
rm -rf speedwm-extras-${VERSION}
@ -16,6 +16,7 @@ install:
mkdir -p ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}${PREFIX}/share/speedwm
cp -f src/speedwm* ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm*
cp -r img/* ${DESTDIR}${PREFIX}/share/speedwm/
echo ${VERSION} > ${DESTDIR}${PREFIX}/share/speedwm/speedwm-extras-version
uninstall:

BIN
img/lprev/layout-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
img/lprev/layout-11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
img/lprev/layout-14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
img/lprev/layout-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
img/lprev/layout-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
img/lprev/layout-8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
img/lprev/layout-9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -152,7 +152,7 @@ SWAL_SELWALLPAPER()
fi
if [ "$ARG1" = "" ]; then
SWAL_SELWALLPAPER="$(printf "$(LIST_IMG)\n------\n..\nPreview\nPrevious\nRandom\nFavorites\nAdd used wallpaper to favorites\nOptions\nHelp\nExit" | $RUNLAUNCHER -g 1 -l 100 -p "What wallpaper would you like to set?" $IMG_ARG $SWAL_IMAGE_SIZE $IMG_ARG_2 $SWAL_IMAGE_SIZE)"
SWAL_SELWALLPAPER="$(printf "$(LIST_IMG)\n------\n..\nPreview\nPrevious\nRandom\nFavorites\nAdd used wallpaper to favorites\nOptions\nHelp\nExit" | $RUNLAUNCHER -g 1 -l 30 -p "What wallpaper would you like to set?" $IMG_ARG $SWAL_IMAGE_SIZE $IMG_ARG_2 $SWAL_IMAGE_SIZE)"
fi
}

View file

@ -55,21 +55,22 @@ L13_SYMBOL=" "
L14_SYMBOL=" "
L15_SYMBOL=" "
L1="$(printf "%s: Tiling\n" "$L1_SYMBOL")"
L2="$(printf "%s: Floating\n" "$L2_SYMBOL")"
L3="$(printf "%s: Monocle\n" "$L3_SYMBOL")"
L4="$(printf "%s: Grid\n" "$L4_SYMBOL")"
L5="$(printf "%s: Deck\n" "$L5_SYMBOL")"
L6="$(printf "%s: Centered Master\n" "$L6_SYMBOL")"
L7="$(printf "%s: Tatami\n" "$L7_SYMBOL")"
L8="$(printf "%s: Dwindle\n" "$L8_SYMBOL")"
L9="$(printf "%s: Spiral\n" "$L9_SYMBOL")"
L10="$(printf "%s: Bottom Stack (Vertical)\n" "$L10_SYMBOL")"
L11="$(printf "%s: Bottom Stack (Horizontal)\n" "$L11_SYMBOL")"
L12="$(printf "%s: Grid (Horizontal)\n" "$L12_SYMBOL")"
L13="$(printf "%s: Dynamic Grid\n" "$L13_SYMBOL")"
L14="$(printf "%s: Custom\n" "$L14_SYMBOL")"
L15="$(printf "%s: Empty\n" "$L15_SYMBOL")"
L1="$(printf "%s\t%s: Tiling\n" "IMG:/usr/share/speedwm/lprev/layout-1.png" "$L1_SYMBOL")"
L2="$(printf "%s\t%s: Floating\n" "IMG:/usr/share/speedwm/lprev/layout-2.png" "$L2_SYMBOL")"
L3="$(printf "%s\t%s: Monocle\n" "IMG:/usr/share/speedwm/lprev/layout-3.png" "$L3_SYMBOL")"
L4="$(printf "%s\t%s: Grid\n" "IMG:/usr/share/speedwm/lprev/layout-4.png" "$L4_SYMBOL")"
L5="$(printf "%s\t%s: Deck\n" "IMG:/usr/share/speedwm/lprev/layout-5.png" "$L5_SYMBOL")"
L6="$(printf "%s\t%s: Centered Master\n" "IMG:/usr/share/speedwm/lprev/layout-6.png" "$L6_SYMBOL")"
L7="$(printf "%s\t%s: Tatami\n" "IMG:/usr/share/speedwm/lprev/layout-7.png" "$L7_SYMBOL")"
L8="$(printf "%s\t%s: Dwindle\n" "IMG:/usr/share/speedwm/lprev/layout-8.png" "$L8_SYMBOL")"
L9="$(printf "%s\t%s: Spiral\n" "IMG:/usr/share/speedwm/lprev/layout-9.png" "$L9_SYMBOL")"
L10="$(printf "%s\t%s: Bottom Stack (Vertical)\n" "IMG:/usr/share/speedwm/lprev/layout-10.png" "$L10_SYMBOL")"
L11="$(printf "%s\t%s: Bottom Stack (Horizontal)\n" "IMG:/usr/share/speedwm/lprev/layout-11.png" "$L11_SYMBOL")"
L12="$(printf "%s\t%s: Grid (Horizontal)\n" "IMG:/usr/share/speedwm/lprev/layout-12.png" "$L12_SYMBOL")"
L13="$(printf "%s\t%s: Dynamic Grid\n" "IMG:/usr/share/speedwm/lprev/layout-13.png" "$L13_SYMBOL")"
L14="$(printf "%s\t%s: Custom\n" "IMG:/usr/share/speedwm/lprev/layout-14.png" "$L14_SYMBOL")"
L15="$(printf "%s\t%s: Empty\n" "IMG:/usr/share/speedwm/lprev/layout-15.png" "$L15_SYMBOL")"
EXIT="Exit"
SEPARATOR="------"
LNEXT="Next Layout"
@ -77,42 +78,42 @@ LPREV="Previous Layout"
SEXP="Enter S expression"
case "$1" in
"layout") SEL_LAYOUT=$(printf "Layouts\n------\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n------\n%s\n%s\n%s\n%s\n%s" \
"${L1}" "${L2}" "${L3}" "${L4}" "${L5}" "${L6}" "${L7}" "${L8}" "${L9}" "${L10}" "${L11}" "${L12}" "${L13}" "${L14}" "${L15}" "${LNEXT}" "${LPREV}" "${SEXP}" "${SEPARATOR}" "${EXIT}" | $RUNLAUNCHER -l 50 -p "Pick a layout: " -g 1) ;;
"reloadcolors") libspeedwm --perform core_wm_reload ;;
"list") head -n -1 /usr/share/speedwm/example.signal ;;
"help") HELP ;;
"exec")
if [ "$2" = "" ]; then
exit 0
else
libspeedwm --rsig "$2"
fi ;;
"h") HELP ;;
"general") GENERAL ;;
"") OPT "$@" ;;
"layout") SEL_LAYOUT=$(printf "Layouts\n------\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n------\n%s\n%s\n%s\n%s\n%s" \
"${L1}" "${L2}" "${L3}" "${L4}" "${L5}" "${L6}" "${L7}" "${L8}" "${L9}" "${L10}" "${L11}" "${L12}" "${L13}" "${L14}" "${L15}" "${LNEXT}" "${LPREV}" "${SEXP}" "${SEPARATOR}" "${EXIT}" | $RUNLAUNCHER -l 50 -p "Pick a layout: " -g 1 -is 400) ;;
"reloadcolors") libspeedwm --perform core_wm_reload ;;
"list") head -n -1 /usr/share/speedwm/example.signal ;;
"help") HELP ;;
"exec")
if [ "$2" = "" ]; then
exit 0
else
libspeedwm --rsig "$2"
fi ;;
"h") HELP ;;
"general") GENERAL ;;
"") OPT "$@" ;;
esac
case "$SEL_LAYOUT" in
"${EXIT}") exit 0 ;;
"${LPREV}") libspeedwm --perform layout_cycle_down; exit ;;
"${LNEXT}") libspeedwm --perform layout_cycle_up; exit ;;
"${L1}") libspeedwm --perform layout_setlayout_tile; CURLT="${L1}" ;;
"${L2}") libspeedwm --perform layout_setlayout_float; CURLT="${L2}" ;;
"${L3}") libspeedwm --perform layout_setlayout_monocle; CURLT="${L3}" ;;
"${L4}") libspeedwm --perform layout_setlayout_grid; CURLT="${L4}" ;;
"${L5}") libspeedwm --perform layout_setlayout_deck; CURLT="${L5}" ;;
"${L6}") libspeedwm --perform layout_setlayout_cm; CURLT="${L6}" ;;
"${L7}") libspeedwm --perform layout_setlayout_tatami; CURLT="${L7}" ;;
"${L8}") libspeedwm --perform layout_setlayout_dwindle; CURLT="${L8}" ;;
"${L9}") libspeedwm --perform layout_setlayout_spiral; CURLT="${L9}" ;;
"${L10}") libspeedwm --perform layout_setlayout_bs; CURLT="${L10}" ;;
"${L11}") libspeedwm --perform layout_setlayout_hbs; CURLT="${L11}" ;;
"${L12}") libspeedwm --perform layout_setlayout_hgrid; CURLT="${L12}" ;;
"${L13}") libspeedwm --perform layout_setlayout_dgrid; CURLT="${L13}" ;;
"${L14}") libspeedwm --perform layout_setlayout_custom; CURLT="${L14}" ;;
"${L15}") libspeedwm --perform layout_setlayout_empty; CURLT="${L15}" ;;
"Enter S expression") libspeedwm --perform layout_custom_express; exit ;;
"${EXIT}") exit 0 ;;
"${LPREV}") libspeedwm --perform layout_cycle_down; exit ;;
"${LNEXT}") libspeedwm --perform layout_cycle_up; exit ;;
"${L1}") libspeedwm --perform layout_setlayout_tile; CURLT="${L1}" ;;
"${L2}") libspeedwm --perform layout_setlayout_float; CURLT="${L2}" ;;
"${L3}") libspeedwm --perform layout_setlayout_monocle; CURLT="${L3}" ;;
"${L4}") libspeedwm --perform layout_setlayout_grid; CURLT="${L4}" ;;
"${L5}") libspeedwm --perform layout_setlayout_deck; CURLT="${L5}" ;;
"${L6}") libspeedwm --perform layout_setlayout_cm; CURLT="${L6}" ;;
"${L7}") libspeedwm --perform layout_setlayout_tatami; CURLT="${L7}" ;;
"${L8}") libspeedwm --perform layout_setlayout_dwindle; CURLT="${L8}" ;;
"${L9}") libspeedwm --perform layout_setlayout_spiral; CURLT="${L9}" ;;
"${L10}") libspeedwm --perform layout_setlayout_bs; CURLT="${L10}" ;;
"${L11}") libspeedwm --perform layout_setlayout_hbs; CURLT="${L11}" ;;
"${L12}") libspeedwm --perform layout_setlayout_hgrid; CURLT="${L12}" ;;
"${L13}") libspeedwm --perform layout_setlayout_dgrid; CURLT="${L13}" ;;
"${L14}") libspeedwm --perform layout_setlayout_custom; CURLT="${L14}" ;;
"${L15}") libspeedwm --perform layout_setlayout_empty; CURLT="${L15}" ;;
"Enter S expression") libspeedwm --perform layout_custom_express; exit ;;
esac
[ -n "${CURLT}" ] && command -v notify-send > /dev/null && notify-send "Layout" "${CURLT}"