Pull in updated driver IPC package, add nested monitor detection back in
This commit is contained in:
parent
cad0be9698
commit
22ef564500
|
|
@ -2,18 +2,11 @@
|
|||
|
||||
set -e
|
||||
|
||||
USER_HOME=$(realpath ~)
|
||||
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
XDG_DATA_HOME="$USER_HOME/.local/share"
|
||||
fi
|
||||
DATA_DIR="$XDG_DATA_HOME/breezy_gnome"
|
||||
|
||||
# create a string to string mapping, file name to expected file location
|
||||
declare -A file_paths
|
||||
file_paths=(
|
||||
["driver_air_glasses/manifest"]="$USER_HOME/.local/bin/xr_driver/manifest"
|
||||
["breezydesktop@xronlinux.com"]="$XDG_DATA_HOME/gnome-shell/extensions/breezydesktop@xronlinux.com"
|
||||
["xr_driver/manifest"]="{xr_driver_data_dir}/manifest"
|
||||
["breezydesktop@xronlinux.com"]="{gnome_shell_data_dir}/extensions/breezydesktop@xronlinux.com"
|
||||
)
|
||||
|
||||
# verify the file hashes in ./manifest
|
||||
|
|
@ -41,9 +34,9 @@ do
|
|||
echo "Verification failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
done < "$XDG_DATA_HOME/breezy_gnome/manifest"
|
||||
done < "{data_dir}/manifest"
|
||||
|
||||
# if our checks succeeded, run the xr_driver verify script
|
||||
$USER_HOME/.local/bin/xr_driver/verify_installation > /dev/null
|
||||
{bin_dir}/xr_driver_verify > /dev/null
|
||||
|
||||
echo "Verification succeeded"
|
||||
|
|
@ -17,9 +17,17 @@ check_command "gnome-extensions"
|
|||
|
||||
USER_HOME=$(realpath ~)
|
||||
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
XDG_DATA_HOME="$USER_HOME/.local/share"
|
||||
fi
|
||||
XR_DRIVER_DATA_DIR="$XDG_DATA_HOME/xr_driver"
|
||||
GNOME_SHELL_DATA_DIR="$XDG_DATA_HOME/gnome-shell"
|
||||
DATA_DIR="$XDG_DATA_HOME/breezy_gnome"
|
||||
|
||||
if [ -z "$XDG_BIN_HOME" ]; then
|
||||
XDG_BIN_HOME="$USER_HOME/.local/bin"
|
||||
fi
|
||||
BIN_DIR="$XDG_BIN_HOME"
|
||||
|
||||
if [ -d "$XDG_BIN_HOME" ]; then
|
||||
# check ownership and permissions before doing chown and chmod
|
||||
|
|
@ -36,11 +44,6 @@ if [ -d "$XDG_BIN_HOME" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
XDG_DATA_HOME="$USER_HOME/.local/share"
|
||||
fi
|
||||
DATA_DIR="$XDG_DATA_HOME/breezy_gnome"
|
||||
|
||||
UA_EVENT_NAME="breezy_gnome_install"
|
||||
if [ -e "$XDG_BIN_HOME/breezy_gnome_uninstall" ]; then
|
||||
echo "Cleaning up the previous installation"
|
||||
|
|
@ -55,9 +58,20 @@ UA_CLIENT_ID="BreezyGNOME"
|
|||
UA_EVENT_VERSION="$1"
|
||||
#INJECT_UA_CALL
|
||||
|
||||
# escaping sed replace: https://stackoverflow.com/questions/407523/escape-a-string-for-a-sed-replace-pattern
|
||||
ESCAPED_BIN_DIR=$(printf '%s\n' "$BIN_DIR" | sed -e 's/[\/&]/\\&/g')
|
||||
ESCAPED_DATA_DIR=$(printf '%s\n' "$DATA_DIR" | sed -e 's/[\/&]/\\&/g')
|
||||
ESCAPED_XR_DRIVER_DATA_DIR=$(printf '%s\n' "$XR_DRIVER_DATA_DIR" | sed -e 's/[\/&]/\\&/g')
|
||||
ESCAPED_GNOME_SHELL_DATA_DIR=$(printf '%s\n' "$GNOME_SHELL_DATA_DIR" | sed -e 's/[\/&]/\\&/g')
|
||||
|
||||
echo "Copying the breezy_gnome scripts to ${XDG_BIN_HOME}"
|
||||
mkdir -p $XDG_BIN_HOME
|
||||
cp bin/breezy_gnome_uninstall $XDG_BIN_HOME
|
||||
sed -i -e "s/{bin_dir}/$ESCAPED_BIN_DIR/g" \
|
||||
-e "s/{data_dir}/$ESCAPED_DATA_DIR/g" \
|
||||
-e "s/{xr_driver_data_dir}/$ESCAPED_XR_DRIVER_DATA_DIR/g" \
|
||||
-e "s/{gnome_shell_data_dir}/$ESCAPED_GNOME_SHELL_DATA_DIR/g" \
|
||||
bin/breezy_gnome_verify
|
||||
cp bin/breezy_gnome_verify $XDG_BIN_HOME
|
||||
|
||||
echo "Copying the manifest file to ${DATA_DIR}"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ const SUPPORTED_MONITOR_PRODUCTS = [
|
|||
'Air',
|
||||
'Air 2', // guessing this one
|
||||
'Air 2 Pro',
|
||||
'SmartGlasses' // TCL/RayNeo
|
||||
'SmartGlasses', // TCL/RayNeo
|
||||
'MetaMonitor' // nested mode dummy monitor
|
||||
];
|
||||
|
||||
export default class BreezyDesktopExtension extends Extension {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
IFS=: read -ra host_data_dirs < <(flatpak-spawn --host sh -c 'echo "$XDG_DATA_DIRS"')
|
||||
IFS=: read -ra HOST_XDG_STATE_HOME < <(flatpak-spawn --host sh -c 'echo "$XDG_STATE_HOME"')
|
||||
IFS=: read -ra HOST_XDG_CONFIG_HOME < <(flatpak-spawn --host sh -c 'echo "$XDG_CONFIG_HOME"')
|
||||
IFS=: read -ra HOST_XDG_BIN_HOME < <(flatpak-spawn --host sh -c 'echo "$XDG_BIN_HOME"')
|
||||
IFS=: read -ra HOST_XDG_DATA_HOME < <(flatpak-spawn --host sh -c 'echo "$XDG_DATA_HOME"')
|
||||
|
||||
|
|
@ -48,6 +49,12 @@ else
|
|||
XDG_STATE_HOME="$(realpath ~)/.local/state"
|
||||
fi
|
||||
|
||||
if [[ ! -z "${HOST_XDG_CONFIG_HOME}" ]]; then
|
||||
XDG_CONFIG_HOME="${HOST_XDG_CONFIG_HOME}"
|
||||
else
|
||||
XDG_CONFIG_HOME="$(realpath ~)/.config"
|
||||
fi
|
||||
|
||||
if [[ ! -z "${HOST_XDG_DATA_HOME}" ]]; then
|
||||
XDG_DATA_HOME="${HOST_XDG_DATA_HOME}"
|
||||
else
|
||||
|
|
@ -57,5 +64,6 @@ fi
|
|||
export XDG_DATA_DIRS
|
||||
export XDG_BIN_HOME
|
||||
export XDG_STATE_HOME
|
||||
export XDG_CONFIG_HOME
|
||||
export XDG_DATA_HOME
|
||||
exec breezydesktop "$@"
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 34a349d39efc02f4b65550debd193d29d95a84f9
|
||||
Subproject commit a96fdeb1557d8cd24e73cb8e9e2559adfa46e3aa
|
||||
|
|
@ -36,8 +36,12 @@ from .statemanager import StateManager
|
|||
from .window import BreezydesktopWindow
|
||||
from .xrdriveripc import XRDriverIPC
|
||||
|
||||
state_dir = os.path.expanduser("~/.local/state")
|
||||
log_dir = os.path.join(state_dir, 'breezy_gnome/logs/ui')
|
||||
config_home = os.environ.get('XDG_CONFIG_HOME', '~/.config')
|
||||
config_dir = os.path.expanduser(config_home)
|
||||
state_home = os.environ.get('XDG_STATE_HOME', '~/.local/state')
|
||||
state_dir = os.path.expanduser(state_home)
|
||||
breezy_state_dir = os.path.join(state_dir, 'breezy_gnome')
|
||||
log_dir = os.path.join(breezy_state_dir, 'logs/ui')
|
||||
os.makedirs(log_dir, exist_ok=True)
|
||||
|
||||
logger = logging.getLogger('breezy_ui')
|
||||
|
|
@ -54,7 +58,7 @@ def excepthook(exc_type, exc_value, exc_traceback):
|
|||
|
||||
sys.excepthook = excepthook
|
||||
|
||||
XRDriverIPC.set_instance(XRDriverIPC(logger))
|
||||
XRDriverIPC.set_instance(XRDriverIPC(logger, config_dir))
|
||||
|
||||
class BreezydesktopApplication(Adw.Application):
|
||||
"""The main application singleton class."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue