-
Notifications
You must be signed in to change notification settings - Fork 11
/
nosp
43 lines (35 loc) · 1.57 KB
/
nosp
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
#!/bin/bash
#----------------------------------------------------------------------------------
# Project Name - nosp
# Started On - Sat 16 Sep 20:03:52 BST 2017
# Last Change - Mon 2 Apr 04:08:30 BST 2018
# Author E-Mail - [email protected]
# Author GitHub - https://github.com/terminalforlife
#----------------------------------------------------------------------------------
# A workaround for the issue in XFCE wherein Smart Placement refuses to go away.
#----------------------------------------------------------------------------------
XERR(){ printf "[L%0.4d] ERROR: %s\n" "$1" "$2" 1>&2; exit 1; }
ERR(){ printf "[L%0.4d] ERROR: %s\n" "$1" "$2" 1>&2; }
[ $# -eq 0 ] || XERR "$LINENO" "No arguments are required."
declare -i DEPCOUNT=0
for DEP in /usr/bin/xfconf-query /bin/sleep; {
if ! [ -x "$DEP" ]; then
ERR "$LINENO" "Dependency '$DEP' not met."
DEPCOUNT+=1
fi
}
[ $DEPCOUNT -gt 0 ] && exit 1
LOCAL_XML_FILE="$HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml"
CURRENT_VALUE=`/usr/bin/xfconf-query -c xfwm4 -p /general/placement_ratio -t int`
if [ -f "$LOCAL_XML_FILE" -a -w "$LOCAL_XML_FILE" ]; then
# This command group waits, sets value to 90, waits, then sets back to 100.
{
/bin/sleep 3s
/usr/bin/xfconf-query -c xfwm4 -p /general/placement_ratio -s 90 -t int
/bin/sleep 0.3 # Removing wait time results in this fix not working.
/usr/bin/xfconf-query -c xfwm4 -p /general/placement_ratio -s 100 -t int
} &
else
XERR "$LINENO" "Unable to fix Smart Placement."
fi
# vim: noexpandtab colorcolumn=84 tabstop=8 noswapfile nobackup