-
Notifications
You must be signed in to change notification settings - Fork 6
/
mxfb-tiles
executable file
·139 lines (119 loc) · 5.4 KB
/
mxfb-tiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#! /bin/bash
# This script installs commands for tiling to the end of the keys file
# it was created by user PPC and released in January 2020 under GPLv3
# One-third tiling, alternate methods and other changes were added by MX Linux Devs October 2020
TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN="mxfb-accessories"
MESSAGE1=$"This script will back up your current keys file, then install commands for tiling to the end of the file. \n
</b>"
HINT1=$"Features: 1/2 screen, 1/4 screen, 1/3 screen and restore \n"
HINT2=$"Multiple options for number keys and keyboard"
TITLE1=$"OK to proceed?"
MESSAGE2=$"The code has been inserted successfully. Now there are 3 methods to do the tiling</b>"
METHOD1=$"<u>Number keys</u>
Control + 1-4: half
Control + 5-8: quarter
Control + 9: third
Control + 0: toggle maximize"
METHOD2=$"<u>Arrow keys</u>
Alt + Arrow: half
Alt + LogoKey + Arrow: quarter\n"
METHOD3=$"<u>Keypad</u>
Alt + 2,4,6,8: half
Alt + 1,3,7,9: quarter
Alt + 5: center
Alt + 0: toggle maximize"
TITLE2=$"Usage options"
##begin first message box
yad --text="
<b>$MESSAGE1 \n
<b>$HINT1
$HINT2</b>" --title=$"$TITLE1" --window-icon=/usr/share/icons/mxflux.png --geometry=400x40 --text-align=center
##end first message box
if [ ! "$?" = "0" ]; then
exit 0
fi
mkdir -p ~/.restore/fluxbox
cp ~/.fluxbox/keys ~/.restore/fluxbox/keys_"$(date +%Y%m%d-%H%M%S)"
echo "## BASIC WINDOW TILING ##
#---------------------------------------------------------------
# Control + number keys
#---------------------------------------------------------------
# Make active window 1/2 of the screen
Control 1 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left}
Control 2 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right}
Control 3 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up}
Control 4 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom}
# Make active window 1/4 of the screen on the upper left
Control 5 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 Up}
Control 6 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 TopRight}
Control 7 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 BottomLeft}
Control 8 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 BottomRight}
# Make active window 1/3 of the screen on the left
Control 9 :MacroCmd {ResizeTo 33% 100%} {MoveTo 00 00 Left}
# toggle active window: Maximized/ last size
Control 0 :ToggleCmd {Maximize} {Restore}
#---------------------------------------------------------------
# Alt/Alt-LogoKey + arrow keys
#---------------------------------------------------------------
# Make active window 1/2 of the screen
Mod1 Left :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left}
Mod1 Right :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right}
Mod1 Up :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up}
Mod1 Down :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom}
# Make active window 1/4 of the screen on top/bottom left/right
Mod1 Mod4 Left :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 TopLeft}
Mod1 Mod4 Up :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 TopRight}
Mod1 Mod4 Down :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 BottomLeft}
Mod1 Mod4 Right :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 BottomRight}
# Make active window 1/3 of the screen on the left
# Unavailable
# toggle center / restore
# Unavailable
# keypad key layout
# +-------------+
# | 7 8 9 |
# | 4 5 6 |
# | 1 2 3 |
# | 0 |
# +-------------+
#---------------------------------------------------------------
# ALt and numpad keys : NumLock off
#---------------------------------------------------------------
Mod1 KP_1 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 BottomLeft}
Mod1 KP_2 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom}
Mod1 KP_3 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 BottomRight}
Mod1 KP_4 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left}
Mod1 KP_6 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right}
Mod1 KP_7 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 TopLeft}
Mod1 KP_8 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up}
Mod1 KP_9 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00 00 TopRight}
# center and resize 70%
Mod1 KP_5 :MacroCmd {ResizeTo 70% 70% } {MoveTo 00 00 Center}
# toggle full screen / restore
Mod1 KP_0 :ToggleCmd {Maximize} {Restore}
#---------------------------------------------------------------
# ALt and numpad keys : NumLock on
#---------------------------------------------------------------
Mod1 KP_End :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 BottomLeft}
Mod1 KP_Down :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom}
Mod1 KP_Next :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 BottomRight}
Mod1 KP_Left :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left}
Mod1 KP_Right :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right}
Mod1 KP_Home :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 TopLeft}
Mod1 KP_Up :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up}
Mod1 KP_Prior :MacroCmd {ResizeTo 50% 50% } {MoveTo 00 00 TopRight}
# center and resize 70%
Mod1 KP_Begin :MacroCmd {ResizeTo 70% 70% } {MoveTo 00 00 Center}
# toggle full screen / restore
Mod1 KP_Insert :ToggleCmd {Maximize} {Restore}
#---------------------------------------------------------------" >> ~/.fluxbox/keys
fluxbox-remote restart
idesktoggle idesk refresh
##begin second message box
yad --text="
<b>$MESSAGE2 \n
<b>$METHOD1 \n
$METHOD2
$METHOD3</b>" --title=$"$TITLE2" --window-icon=/usr/share/icons/mxflux.png --geometry=400x40 --text-align=center
##end second message box