Update: Add a LOT of fsignal signals, change older ones, update scripts.

I apologize for potentially breaking old scripts but this should be much
easier to maintain and update.
This commit is contained in:
speediegq 2022-09-17 14:02:14 +02:00
parent d25c884477
commit 88c318e655
7 changed files with 146 additions and 231 deletions

View file

@ -12,29 +12,53 @@
- xsetroot -name "fsignal:12" | Switch to the Bottom Stack Horizontal layout
- xsetroot -name "fsignal:13" | Switch to the Horizontal Grid layout
- xsetroot -name "fsignal:14" | Switch to the Tatami layout
- xsetroot -name "fsignal:15" | To be added
- xsetroot -name "fsignal:16" | Cycle layout (Previous)
- xsetroot -name "fsignal:17" | Cycle layout (Next)
- xsetroot -name "fsignal:18" | Reload colors from .Xresources
- xsetroot -name "fsignal:19" | Set mfact (-0.05)
- xsetroot -name "fsignal:20" | Set mfact (+0.05)
- xsetroot -name "fsignal:21" | Toggle Scratchpad
- xsetroot -name "fsignal:22" | Toggle Sticky
- xsetroot -name "fsignal:23" | Toggle Bar
- xsetroot -name "fsignal:24" | Toggle Fullscreen
- xsetroot -name "fsignal:25" | Restart speedwm keeping all your applications open.
- xsetroot -name "fsignal:26" | Unused at the moment.
- xsetroot -name "fsignal:27" | Switch to the Stairs layout
- xsetroot -name "fsignal:28" | Reset layout and mfact
- xsetroot -name "fsignal:29" | Reorganize tags
- xsetroot -name "fsignal:30" | Restart speedwm
- xsetroot -name "fsignal:31" | Shutdown speedwm
- xsetroot -name "fsignal:32" | To be added
- xsetroot -name "fsignal:33" | To be added
- xsetroot -name "fsignal:34" | To be added
- xsetroot -name "fsignal:35" | Switch to the Tiling (5:4) layout
- xsetroot -name "fsignal:36" | Switch to the Column layout
- xsetroot -name "fsignal:37" | Switch to the Dynamic Grid layout
- xsetroot -name "fsignal:38" | Show the focused window if it's hidden
- xsetroot -name "fsignal:39" | Hide the focused window if it isn't already
- xsetroot -name "fsignal:15" | Switch to the Tilewide layout
- xsetroot -name "fsignal:16" | Switch to the Stairs layout
- xsetroot -name "fsignal:17" | Switch to the 5:4 tiling layout
- xsetroot -name "fsignal:18" | Switch to the Column layout
- xsetroot -name "fsignal:19" | Switch to the Dynamic Grid layout
- xsetroot -name "fsignal:20" | Switch to the next layout
- xsetroot -name "fsignal:21" | Switch to the previous layout
- xsetroot -name "fsignal:22" | Increase mfact by 0.05
- xsetroot -name "fsignal:23" | Decrease mfact by 0.05
- xsetroot -name "fsignal:24" | Toggle sticky
- xsetroot -name "fsignal:25" | Toggle the bar
- xsetroot -name "fsignal:26" | Toggle fullscreen
- xsetroot -name "fsignal:27" | Toggle floating
- xsetroot -name "fsignal:28" | Swap the current window with the next
- xsetroot -name "fsignal:29" | Reorganize tags (Reorder them)
- xsetroot -name "fsignal:30" | Shutdown speedwm
- xsetroot -name "fsignal:31" | Restart speedwm
- xsetroot -name "fsignal:32" | Show the focused window
- xsetroot -name "fsignal:33" | Hide the focused window
- xsetroot -name "fsignal:34" | Kill the focused window
- xsetroot -name "fsignal:35" | Rotate the stack up
- xsetroot -name "fsignal:36" | Rotate the stack down
- xsetroot -name "fsignal:37" | Increase number of clients in the master stack
- xsetroot -name "fsignal:38" | Decrease number of clients in the master stack
- xsetroot -name "fsignal:39" | Focus the Master client
- xsetroot -name "fsignal:40" | Switch focus between windows +1
- xsetroot -name "fsignal:41" | Switch focus between windows -1
- xsetroot -name "fsignal:42" | Switch focus between hidden windows +1
- xsetroot -name "fsignal:43" | Switch focus between hidden windows -1
- xsetroot -name "fsignal:44" | Toggle opacity for windows
- xsetroot -name "fsignal:45" | Increase cfact by 0.05
- xsetroot -name "fsignal:46" | Decrease cfact by 0.05
- xsetroot -name "fsignal:47" | Switch to the previous tag
- xsetroot -name "fsignal:48" | Switch to the next tag
- xsetroot -name "fsignal:49" | Reset gaps to the default size
- xsetroot -name "fsignal:50" | Toggle gaps
- xsetroot -name "fsignal:51" | Increase gaps by 1
- xsetroot -name "fsignal:52" | Decrease gaps by 1
- xsetroot -name "fsignal:53" | Increase inner gaps by 1
- xsetroot -name "fsignal:54" | Decrease inner gaps by 1
- xsetroot -name "fsignal:55" | Increase outer gaps by 1
- xsetroot -name "fsignal:56" | Decrease outer gaps by 1
- xsetroot -name "fsignal:57" | Kill all clients except focused
- xsetroot -name "fsignal:58" | Focus the next monitor
- xsetroot -name "fsignal:59" | Focus the previous monitor
- xsetroot -name "fsignal:60" | Show the scratchpad
- xsetroot -name "fsignal:61" | Hide the scratchpad
- xsetroot -name "fsignal:62" | Remove the scratchpad
- xsetroot -name "fsignal:63" | Reset layout/mfact

100
fsignal.h
View file

@ -4,77 +4,105 @@
*
* Once you're done with your edits, run 'make clean install'. */
static Signal signals[] = {
/* signum function argument */
{ 16, cyclelayout, {.i = -1 } }, // Cycle layout (back)
{ 17, cyclelayout, {.i = +1 } }, // Cycle layout (forward)
{ 18, livereloadxrdb, {0} },
{ 19, setmfact, {.f = -0.05} },
{ 20, setmfact, {.f = +0.05} },
{ 21, togglescratch, {.v = scratchpadcmd } },
{ 22, togglesticky, {0} },
{ 23, togglebar, {0} },
{ 24, togglefullscr, {0} },
{ 25, self_restart, {0} },
{ 28, reset_layout, {0} },
{ 29, reorganizetags, {0} },
{ 30, quit, {1} },
{ 31, quit, {0} },
{ 38, show, {0} },
{ 39, hide, {0} },
/* signum function argument */
{ 20, cyclelayout, {.i = +1 } },
{ 21, cyclelayout, {.i = -1 } },
{ 22, setmfact, {.f = -0.05} },
{ 23, setmfact, {.f = +0.05} },
{ 24, togglesticky, {0} },
{ 25, togglebar, {0} },
{ 26, togglefullscr, {0} },
{ 27, togglefloating, {0} },
{ 28, zoom, {0} },
{ 29, reorganizetags, {0} },
{ 30, quit, {1} },
{ 31, quit, {0} },
{ 32, show, {0} },
{ 33, hide, {0} },
{ 34, killclient, {0} },
{ 35, inplacerotate, {.i = +1 } },
{ 36, inplacerotate, {.i = -1 } },
{ 37, incnmaster, {.i = +1 } },
{ 38, incnmaster, {.i = -1 } },
{ 39, focusmaster, {0} },
{ 40, focusstackvis, {.i = +1 } },
{ 41, focusstackvis, {.i = -1 } },
{ 42, focusstackhid, {.i = +1 } },
{ 43, focusstackhid, {.i = -1 } },
{ 44, toggleopacity, {0} },
{ 45, setcfact, {.f = +0.05 } },
{ 46, setcfact, {.f = -0.05 } },
{ 47, viewtoleft, {0} },
{ 48, viewtoright, {0} },
{ 49, defaultgaps, {0} },
{ 50, togglegaps, {0} },
{ 51, incrgaps, {.i = +1 } },
{ 52, incrgaps, {.i = -1 } },
{ 53, incrigaps, {.i = +1 } },
{ 54, incrigaps, {.i = -1 } },
{ 55, incrogaps, {.i = +1 } },
{ 56, incrogaps, {.i = -1 } },
{ 57, killunsel, {0} },
{ 58, focusmon, {.i = +1 } },
{ 59, focusmon, {.i = -1 } },
{ 60, scratchpad_show, {0} },
{ 61, scratchpad_hide, {0} },
{ 62, scratchpad_remove, {0} },
{ 63, reset_layout, {0} },
#if LAYOUT_TILE
{ 1, setlayout, {.v = &layouts[0]} }, // Tiling layout
{ 1, setlayout, {.v = &layouts[0]} }, /* Tiling layout */
#endif
{ 2, setlayout, {.v = &layouts[1]} }, // Floating layout
{ 2, setlayout, {.v = &layouts[1]} }, /* Floating layout */
#if LAYOUT_MONOCLE
{ 3, setlayout, {.v = &layouts[2]} }, // Monocle layout
{ 3, setlayout, {.v = &layouts[2]} }, /* Monocle layout */
#endif
#if LAYOUT_GRID
{ 4, setlayout, {.v = &layouts[3]} }, // Grid layout
{ 4, setlayout, {.v = &layouts[3]} }, /* Grid layout */
#endif
#if LAYOUT_DECK
{ 5, setlayout, {.v = &layouts[4]} }, // Deck layout
{ 5, setlayout, {.v = &layouts[4]} }, /* Deck layout */
#endif
#if LAYOUT_CM
{ 6, setlayout, {.v = &layouts[5]} }, // Centered Master layout
{ 6, setlayout, {.v = &layouts[5]} }, /* Centered Master layout */
#endif
#if LAYOUT_CFM
{ 7, setlayout, {.v = &layouts[6]} }, // Centered Floating Master layout
{ 7, setlayout, {.v = &layouts[6]} }, /* Centered Floating Master layout */
#endif
#if LAYOUT_SPIRAL
{ 8, setlayout, {.v = &layouts[7]} }, // Fibonacci Spiral layout
{ 8, setlayout, {.v = &layouts[7]} }, /* Fibonacci Spiral layout */
#endif
#if LAYOUT_DWINDLE
{ 9, setlayout, {.v = &layouts[8]} }, // Fibonacci Dwindle layout
{ 9, setlayout, {.v = &layouts[8]} }, /* Fibonacci Dwindle layout */
#endif
#if LAYOUT_TCL
{ 10, setlayout, {.v = &layouts[9]} }, // Three Column layout
{ 10, setlayout, {.v = &layouts[9]} }, /* Three Column layout */
#endif
#if LAYOUT_BSTACK
{ 11, setlayout, {.v = &layouts[10]} }, // Bottom Stack layout
{ 11, setlayout, {.v = &layouts[10]} }, /* Bottom Stack layout */
#endif
#if LAYOUT_BSTACKH
{ 12, setlayout, {.v = &layouts[11]} }, // Horizontal Bottom Stack layout
{ 12, setlayout, {.v = &layouts[11]} }, /* Horizontal Bottom Stack layout */
#endif
#if LAYOUT_HGRID
{ 13, setlayout, {.v = &layouts[12]} }, // Horizontal Grid layout
{ 13, setlayout, {.v = &layouts[12]} }, /* Horizontal Grid layout */
#endif
#if LAYOUT_TATAMI
{ 14, setlayout, {.v = &layouts[13]} }, // Tatami layout
{ 14, setlayout, {.v = &layouts[13]} }, /* Tatami layout */
#endif
#if LAYOUT_TW
{ 15, setlayout, {.v = &layouts[14]} }, // Tilewide layout
{ 15, setlayout, {.v = &layouts[14]} }, /* Tilewide layout */
#endif
#if LAYOUT_STAIRS
{ 27, setlayout, {.v = &layouts[15]} }, // Stairs layout
{ 16, setlayout, {.v = &layouts[15]} }, /* Stairs layout */
#endif
#if LAYOUT_TILE54
{ 35, setlayout, {.v = &layouts[16]} }, // 5:4 tiling layout
{ 17, setlayout, {.v = &layouts[16]} }, /* 5:4 tiling layout */
#endif
#if LAYOUT_COL
{ 36, setlayout, {.v = &layouts[17]} }, // Column layout
{ 18, setlayout, {.v = &layouts[17]} }, /* Column layout */
#endif
#if LAYOUT_DGRID
{ 37, setlayout, {.v = &layouts[18]} }, // Dynamic Grid layout
{ 19, setlayout, {.v = &layouts[18]} }, /* Dynamic Grid layout */
#endif
};

View file

@ -77,7 +77,6 @@ static const Key keys[] = {
{ MODIFIER1, -1, XK_minus, scratchpad_show, {0} },
{ MODIFIER1|SHIFT, -1, XK_minus, scratchpad_hide, {0} },
{ MODIFIER1, -1, XK_equal, scratchpad_remove, {0} },
{ MODIFIER1|SHIFT, -1, XK_equal, togglescratch, {.v = scratchpadcmd } },
/* speedwm general binds */
{ MODIFIER1, -1, XK_f, togglefullscr, {0} },
@ -100,7 +99,6 @@ static const Key keys[] = {
{ MODIFIER1, -1, XK_period, focusmon, {.i = +1 } },
{ MODIFIER1|SHIFT, -1, XK_d, tagmon, {.i = -1 } },
{ MODIFIER1|SHIFT, -1, XK_period, tagmon, {.i = +1 } },
{ MODIFIER1|SHIFT, -1, XK_Tab, livereloadxrdb, {0} },
{ MODIFIER1|SHIFT, -1, XK_j, inplacerotate, {.i = +1} },
{ MODIFIER1|SHIFT, -1, XK_k, inplacerotate, {.i = -1} },
{ MODIFIER1|SHIFT, -1, XK_h, inplacerotate, {.i = +2} },

View file

@ -195,7 +195,6 @@ static char *alttrayname = "tray"; /* Polybar tray instance
/* Misc */
static char shell[] = "/bin/sh"; /* Shell to use */
static char *scratchpadcmd[] = {"s", TERMINAL, "-t", "scratchpad", NULL};
static int warpcursor = 1; /* Warp cursor when switching client/monitor */
static int pertag = 1; /* Use different mfact and layout for each layout */
static int wmclass = 1; /* Enable (1) workaround for when a class cannot be grabbed */

View file

@ -14,7 +14,6 @@ SWAL_DEFAULT_CONFIG()
SWAL_OPT=xwallpaper
SWAL_BINDIR=$BINDIR # compatibility with old config files
SWAL_EXPORTDIR=$HOME/.config/speedwm-de/swal # Config directory
SWAL_FSIGNAL_RELOAD_XRESOURCES=18 # Fsignal signum when reloading
SWAL_IMAGE_VIEWER="sxiv -to" # Image viewer to use (<char>)
SWAL_ASK_WAL=false # Ask whether or not to use Pywal if possible (true/false)
SWAL_RANDOMIZE=false # Select a random wallpaper on login
@ -289,7 +288,7 @@ SWAL_EXPORT_SCRIPT()
SWAL_EXPORT_SCRIPT_WAL()
{
if [ "$SWAL_RANDOMIZE" = "false" ]; then
printf "#!/bin/sh\n$SWAL_OPT $SWAL_TYPE ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'""\nwal -qi ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'"" || rm -rf $HOME/.cache/wal ; xrdb -remove\nxrdb ~/.cache/wal/colors.Xresources\nxsetroot -name 'fsignal:$SWAL_FSIGNAL_RELOAD_XRESOURCES'" > $SWAL_EXPORTDIR/swal_wm
printf "#!/bin/sh\n$SWAL_OPT $SWAL_TYPE ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'""\nwal -qi ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'"" || rm -rf $HOME/.cache/wal ; xrdb -remove\nxrdb ~/.cache/wal/colors.Xresources" > $SWAL_EXPORTDIR/swal_wm
else
printf "#!/bin/sh" > $SWAL_EXPORTDIR/swal_wm
printf "\nSWAL_WALLPAPERDIR=""'$SWAL_OLDWALLPAPERDIR'""" >> $SWAL_EXPORTDIR/swal_wm
@ -298,7 +297,6 @@ SWAL_EXPORT_SCRIPT_WAL()
printf "\n$SWAL_OPT $SWAL_TYPE " >> $SWAL_EXPORTDIR/swal_wm
printf '"$SWAL_SELWALLPAPER"' >> $SWAL_EXPORTDIR/swal_wm
printf '\nwal -nqi "$SWAL_SELWALLPAPER" || rm -rf $HOME/.cache/wal ; xrdb -remove\nxrdb $HOME/.cache/wal/colors.Xresources\nxrdb $HOME/.cache/wal/colors.Xresources' >> $SWAL_EXPORTDIR/swal_wm
printf "\nxsetroot -name "fsignal:$SWAL_FSIGNAL_RELOAD_XRESOURCES"" >> $SWAL_EXPORTDIR/swal_wm
printf "\nrm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm
printf '\nln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" ' >> $SWAL_EXPORTDIR/swal_wm
printf "$SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm
@ -309,7 +307,7 @@ SWAL_EXPORT_SCRIPT_WAL()
chmod +x $SWAL_EXPORTDIR/swal_wm
rm -rf $HOME/.cache/wal # Delete previous colors
wal -nqi "'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'" && xrdb ~/.cache/wal/colors.Xresources && xsetroot -name "fsignal:$SWAL_FSIGNAL_RELOAD_XRESOURCES" || xrdb -remove # Compatibility with my speedwm build
wal -nqi "'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'" && xrdb ~/.cache/wal/colors.Xresources || xrdb -remove # Compatibility with my speedwm build
if [ -e "$SWAL_EXPORTDIR/CurrentWallpaper" ]; then
rm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev ; ln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" $SWAL_EXPORTDIR/CurrentWallpaper_prev
fi

View file

@ -25,60 +25,21 @@ fi
VARS() {
BINDIR=$(cat /usr/share/speedwm-bindir)
SIGNAL_1=1 # Layout: Tiling
SIGNAL_2=2 # Layout: Floating
SIGNAL_3=3 # Layout: Monocle
SIGNAL_4=4 # Layout: Grid
SIGNAL_5=5 # Layout: Deck
SIGNAL_6=6 # Layout: Centered Master
SIGNAL_7=7 # Layout: Centered Floating Master
SIGNAL_8=8 # Layout: Fibonacci Spiral
SIGNAL_9=9 # Layout: Fibonacci Dwindle
SIGNAL_10=10 # Layout: Three Column
SIGNAL_11=11 # Layout: Bottom Stack Vertical
SIGNAL_12=12 # Layout: Bottom Stack Horizontal
SIGNAL_13=13 # Layout: Horizontal Grid
SIGNAL_14=14 # Layout: Tatami
SIGNAL_15=15 # Layout: Tilewide
SIGNAL_16=16 # Layout: Previous
SIGNAL_17=17 # Layout: Next
SIGNAL_18=18 # General: Reload resources (xrdb)
SIGNAL_19=19 # General: Set mfact (-0.05)
SIGNAL_20=20 # General: Set mfact (+0.05)
SIGNAL_21=21 # General: Toggle Scratchpad
SIGNAL_22=22 # General: Toggle Sticky
SIGNAL_23=23 # General: Toggle Bar
SIGNAL_24=24 # General: Toggle Fullscreen
SIGNAL_25=25 # General: Restart speedwm
SIGNAL_26=26 # Unused: Unused 26
SIGNAL_27=27 # Layout: Stairs
SIGNAL_28=28 # General: Reset layout/mfact
SIGNAL_29=29 # General: Reorganize Tags
SIGNAL_30=30 # General: Quit speedwm
SIGNAL_31=31 # General: Restart speedwm
SIGNAL_32=32 # Unused: Unused 32
SIGNAL_33=33 # Unused: Unused 33
SIGNAL_34=34 # Unused: Unused 34
SIGNAL_35=35 # Layout: Tiling 5:4
SIGNAL_36=36 # Layout: Columns
SIGNAL_37=37 # Layout: Dynamic Grid
}
VARS
GENERAL() {
GENERALOPTS=$(printf "mfact +\nmfact -\nToggle Scratchpad\nToggle Sticky\nToggle Bar\nToggle Fullscreen\nToggle rmaster\nReset Layout/mfact\nReorganize Tags" | $RUNLAUNCHER -l 20 -p 'What do you want to do?')
GENERALOPTS=$(printf "mfact +\nmfact -\nToggle Scratchpad\nToggle Sticky\nToggle Bar\nToggle Fullscreen\nReset Layout/mfact\nReorganize Tags" | $RUNLAUNCHER -l 20 -p 'What do you want to do?')
case "$GENERALOPTS" in
"mfact +") xsetroot -name "fsignal:$SIGNAL_20" ;;
"mfact -") xsetroot -name "fsignal:$SIGNAL_19" ;;
"Toggle Scratchpad") xsetroot -name "fsignal:$SIGNAL_21" ;;
"Toggle Sticky") xsetroot -name "fsignal:$SIGNAL_22" ;;
"Toggle Bar") xsetroot -name "fsignal:$SIGNAL_23" ;;
"Toggle Fullscreen") xsetroot -name "fsignal:$SIGNAL_24" ;;
"Toggle rmaster") xsetroot -name "fsignal:$SIGNAL_26" ;;
"Reorganize Tags") xsetroot -name "fsignal:$SIGNAL_29" ;;
"Reset Layout/mfact") xsetroot -name "fsignal:$SIGNAL_28" ;;
"mfact +") xsetroot -name "fsignal:22" ;;
"mfact -") xsetroot -name "fsignal:23" ;;
"Toggle Scratchpad") xsetroot -name "fsignal:60" ;;
"Toggle Sticky") xsetroot -name "fsignal:24" ;;
"Toggle Bar") xsetroot -name "fsignal:25" ;;
"Toggle Fullscreen") xsetroot -name "fsignal:26" ;;
"Reorganize Tags") xsetroot -name "fsignal:29" ;;
"Reset Layout/mfact") xsetroot -name "fsignal:63" ;;
esac
}
@ -199,7 +160,7 @@ case "$1" in
"-layout") SEL_LAYOUT=$(printf "${L1}\nL2: Floating\n${L3}\n${L4}\n${L5}\n${L6}\n${L7}\n${L8}\n${L9}\n${L10}\n${L11}\n${L12}\n${L13}\n${L14}\n${L15}\n${L16}\n${L17}\n${L18}\n${L19}\nPrevious Layout\nNext Layout" | $RUNLAUNCHER -l 21 -p "Pick a layout: ") ;;
"-spawn") printf "Not complete" ;;
"-list") sed 's|xsetroot -name "fsignal:||g' /usr/share/speedwm-fsignal | sed 's|"||g' ;;
"-reloadxrdb") xsetroot -name "fsignal:$SIGNAL_31" ;;
"-reloadxrdb") xsetroot -name "fsignal:31" ;;
"-help") HELP ;;
"-exec")
if [ "$2" = "" ]; then
@ -214,25 +175,25 @@ esac
case "$SEL_LAYOUT" in
"Exit") exit 0 ;;
"L1: Tiling") xsetroot -name "fsignal:$SIGNAL_1" ;;
"L2: Floating") xsetroot -name "fsignal:$SIGNAL_2" ;;
"L3: Monocle") xsetroot -name "fsignal:$SIGNAL_3" ;;
"L4: Grid") xsetroot -name "fsignal:$SIGNAL_4" ;;
"L5: Deck") xsetroot -name "fsignal:$SIGNAL_5" ;;
"L6: Centered Master") xsetroot -name "fsignal:$SIGNAL_6" ;;
"L7: Centered Floating Master") xsetroot -name "fsignal:$SIGNAL_7" ;;
"L8: Fibonacci Spiral") xsetroot -name "fsignal:$SIGNAL_8" ;;
"L9: Fibonacci Dwindle") xsetroot -name "fsignal:$SIGNAL_9" ;;
"L10: Three Column") xsetroot -name "fsignal:$SIGNAL_10" ;;
"L11: Bottom Stack Vertical") xsetroot -name "fsignal:$SIGNAL_11" ;;
"L12: Bottom Stack Horizontal") xsetroot -name "fsignal:$SIGNAL_12" ;;
"L13: Horizontal Grid") xsetroot -name "fsignal:$SIGNAL_13" ;;
"L14: Tatami") xsetroot -name "fsignal:$SIGNAL_14" ;;
"L15: Tilewide") xsetroot -name "fsignal:$SIGNAL_15" ;;
"L16: Stairs") xsetroot -name "fsignal:$SIGNAL_27" ;;
"L17: Tiling (5:4)") xsetroot -name "fsignal:$SIGNAL_35" ;;
"L18: Column") xsetroot -name "fsignal:$SIGNAL_36" ;;
"L19: Dynamic Grid") xsetroot -name "fsignal:$SIGNAL_37" ;;
"Previous Layout") xsetroot -name "fsignal:$SIGNAL_16" ;;
"Next Layout") xsetroot -name "fsignal:$SIGNAL_17" ;;
"L1: Tiling") xsetroot -name "fsignal:1" ;;
"L2: Floating") xsetroot -name "fsignal:2" ;;
"L3: Monocle") xsetroot -name "fsignal:3" ;;
"L4: Grid") xsetroot -name "fsignal:4" ;;
"L5: Deck") xsetroot -name "fsignal:5" ;;
"L6: Centered Master") xsetroot -name "fsignal:6" ;;
"L7: Centered Floating Master") xsetroot -name "fsignal:7" ;;
"L8: Fibonacci Spiral") xsetroot -name "fsignal:8" ;;
"L9: Fibonacci Dwindle") xsetroot -name "fsignal:9" ;;
"L10: Three Column") xsetroot -name "fsignal:10" ;;
"L11: Bottom Stack Vertical") xsetroot -name "fsignal:11" ;;
"L12: Bottom Stack Horizontal") xsetroot -name "fsignal:12" ;;
"L13: Horizontal Grid") xsetroot -name "fsignal:13" ;;
"L14: Tatami") xsetroot -name "fsignal:14" ;;
"L15: Tilewide") xsetroot -name "fsignal:15" ;;
"L16: Stairs") xsetroot -name "fsignal:16" ;;
"L17: Tiling (5:4)") xsetroot -name "fsignal:17" ;;
"L18: Column") xsetroot -name "fsignal:18" ;;
"L19: Dynamic Grid") xsetroot -name "fsignal:19" ;;
"Previous Layout") xsetroot -name "fsignal:21" ;;
"Next Layout") xsetroot -name "fsignal:20" ;;
esac

View file

@ -292,9 +292,7 @@ static void getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int
static void stairs(Monitor *m);
#endif
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
static void spawnscratch(const Arg *arg);
static void inplacerotate(const Arg *arg);
static void togglescratch(const Arg *arg);
static void settagsatom(Window w, unsigned int tags);
static void togglesticky(const Arg *arg);
static void previewtag(const Arg *arg);
@ -324,7 +322,6 @@ static void col(Monitor *);
#endif
static void configure(Client *c);
static void configurenotify(XEvent *e);
static void livereloadxrdb(const Arg *arg);
static void configurerequest(XEvent *e);
static void copyvalidchars(char *text, char *rawtext);
static void autostart_exec(void);
@ -648,52 +645,6 @@ static const char *statuscmd[] = { shell, "-c", NULL, NULL };
#include "mouse.h" /* Include mouse support */
#endif
char *get_speedwm_path(){
struct stat s;
int r, length, rate = 42;
char *path = NULL;
if(lstat("/proc/self/exe", &s) == -1){
perror("lstat:");
return NULL;
}
length = s.st_size + 1 - rate;
do{
length+=rate;
free(path);
path = malloc(sizeof(char) * length);
if(path == NULL){
perror("malloc:");
return NULL;
}
r = readlink("/proc/self/exe", path, length);
if(r == -1){
perror("readlink:");
return NULL;
}
}while(r >= length);
path[r] = '\0';
return path;
}
void self_restart(const Arg *arg) {
char *const argv[] = {get_speedwm_path(), NULL};
if(argv[0] == NULL){
return;
}
execv(argv[0], argv);
}
#include "fsignal.h" /* Include fsignal support */
unsigned int tagw[LENGTH(tags)];
@ -3747,17 +3698,6 @@ run(void)
#endif
}
void spawnscratch(const Arg *arg)
{
if (fork() == 0) {
if (dpy)
close(ConnectionNumber(dpy));
setsid();
execvp(((char **)arg->v)[1], ((char **)arg->v)+1);
die("speedwm: execvp '%s' failed", ((char **)arg->v)[1]);
}
}
void
scan(void)
{
@ -4495,28 +4435,6 @@ togglebar(const Arg *arg)
arrange(selmon);
}
void
togglescratch(const Arg *arg)
{
Client *c;
unsigned int found = 0;
for (c = selmon->clients; c && !(found = c->scratchkey == ((char**)arg->v)[0][0]); c = c->next);
if (found) {
c->tags = ISVISIBLE(c) ? 0 : selmon->tagset[selmon->seltags];
focus(NULL);
arrange(selmon);
if (ISVISIBLE(c)) {
focus(c);
restack(selmon);
}
} else{
spawnscratch(arg);
}
}
void
togglefloating(const Arg *arg)
{
@ -5614,17 +5532,6 @@ main(int argc, char *argv[])
}
void
livereloadxrdb(const Arg *arg)
{
load_xresources();
int i;
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
focus(NULL);
arrange(NULL);
}
void
insertclient(Client *item, Client *insertItem, int after) {
Client *c;