Browse Source

Merge pull request #18 from JezerM/#17-fix

Possible bugfix
sisyphus
Jezer Mejía 3 years ago committed by GitHub
parent
commit
54220f56b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      README.md
  2. 51
      build/utils.sh
  3. 4
      web-greeter/browser/browser.py

15
README.md

@ -22,12 +22,13 @@ Gruvbox and Dracula themes!
- Tab completion for zsh and bash. - Tab completion for zsh and bash.
## Dependencies ## Dependencies
| | arch | ubuntu | fedora | openSUSE | | | arch | ubuntu | fedora | openSUSE |
|-----------------------|---------------|----------------------|---------------------|-----------------------| |--------------------------|---------------------|----------------------|---------------------|----------------------|
|**liblightdm-gobject** |lightdm |liblightdm-gobject-dev|lightdm-gobject-devel|liblightdm-gobject-1-0 | |**liblightdm-gobject** |lightdm |liblightdm-gobject-dev|lightdm-gobject-devel|liblightdm-gobject-1-0|
|**pygobject** |python-gobject |python3-gi |pygobject3 |python3-gobject | |**pygobject** |python-gobject |python3-gi |pygobject3 |python3-gobject |
|**pyqt5** |python-pyqt5 |python3-pyqt5 |python3-qt5 |python3-qt5 | |**pyqt5** |python-pyqt5 |python3-pyqt5 |python3-qt5 |python3-qt5 |
|**qt5-webengine** |qt5-webengine |libqt5webengine5 |qt5-qtwebengine |libqt5-qtwebengine | |**qt5-webengine** |qt5-webengine |libqt5webengine5 |qt5-qtwebengine |libqt5-qtwebengine |
|**gobject-introspection** |gobject-introspection|gobject-introspection |gobject-introspection|gobject-introspection |
### PIP ### PIP
- PyGObject - PyGObject
@ -52,7 +53,7 @@ sudo pip install -r requirements.txt
sudo make install sudo make install
``` ```
Whis will build and install **web-greeter** in a zippy way, which compresses the python code as a zip and uses it as a binary. Either `sudo make install_freeze` to build and install with cx_freeze. The zippy method depends on the actual python interpreter and its libraries, so you could have problems when updating python or removing any dependency, while the cx_freeze method tries to fix this "problem". This will build and install **web-greeter** in a zippy way, which compresses the python code as a zip and uses it as a binary. Either `sudo make install_freeze` to build and install with cx_freeze. The zippy method depends on the actual python interpreter and its libraries, so you could have problems when updating python or removing any dependency, while the cx_freeze method tries to fix this "problem".
See [latest release][releases]. See [latest release][releases].

51
build/utils.sh

@ -51,7 +51,11 @@ do_build_freeze() {
do_install() { do_install() {
[[ -e "${DESTDIR}" ]] || mkdir -p "${DESTDIR}" [[ -e "${DESTDIR}" ]] || mkdir -p "${DESTDIR}"
cp -R "${INSTALL_ROOT}"/* "${DESTDIR}" cp -R "${INSTALL_ROOT}"/* "${DESTDIR}"
[[ -e "${DESTDIR}"/opt/web-greeter ]] && ln -sf "${DESTDIR}"/opt/web-greeter/web-greeter ${DESTDIR}${PREFIX}/bin/web-greeter if [[ -e "${DESTDIR}"/opt/web-greeter ]]; then
opt_web=$(echo "${DESTDIR}"/opt/web-greeter/web-greeter | sed -E 's/\/\//\//g')
dest_bin=$(echo "${DESTDIR}"/"${PREFIX}"/bin/web-greeter | sed -E 's/\/\//\//g')
ln -sf "${opt_web}" "${dest_bin}"
fi
} }
init_build_dir() { init_build_dir() {
@ -64,37 +68,39 @@ init_build_dir() {
prepare_install() { prepare_install() {
cd "${BUILD_DIR}" cd "${BUILD_DIR}"
INSTALL_PREFIX=$(echo ${INSTALL_ROOT}/${PREFIX} | sed -E 's/\/\//\//g')
mkdir -p \ mkdir -p \
"${INSTALL_ROOT}${PREFIX}"/share/{man/man1,metainfo,web-greeter,xgreeters,applications,zsh/vendor-completions,bash-completion/completions} \ "${INSTALL_PREFIX}"/share/{man/man1,metainfo,web-greeter,xgreeters,applications,zsh/vendor-completions,bash-completion/completions} \
"${INSTALL_ROOT}"/etc/{lightdm,xdg/lightdm/lightdm.conf.d} "${INSTALL_ROOT}"/etc/{lightdm,xdg/lightdm/lightdm.conf.d} \
"${INSTALL_PREFIX}"/bin
# Themes # Themes
(cp -R "${REPO_DIR}/themes" "${INSTALL_ROOT}${PREFIX}/share/web-greeter" \ (cp -R "${REPO_DIR}/themes" "${INSTALL_PREFIX}/share/web-greeter" \
&& cd "${INSTALL_ROOT}${PREFIX}/share/web-greeter" \ && cd "${INSTALL_PREFIX}/share/web-greeter" \
&& mv themes/_vendor .) && mv themes/_vendor .)
# Man Page # Man Page
cp "${BUILD_DIR}/dist/${PKGNAME}.1" "${INSTALL_ROOT}${PREFIX}/share/man/man1" cp "${BUILD_DIR}/dist/${PKGNAME}.1" "${INSTALL_PREFIX}/share/man/man1"
# Command line completions # Command line completions
if [[ -f /usr/bin/bash ]]; then if [[ -f /usr/bin/bash ]]; then
cp "${BUILD_DIR}/dist/${PKGNAME}-bash" "${INSTALL_ROOT}${PREFIX}/share/bash-completion/completions/${PKGNAME}" cp "${BUILD_DIR}/dist/${PKGNAME}-bash" "${INSTALL_PREFIX}/share/bash-completion/completions/${PKGNAME}"
fi fi
if [[ -f /usr/bin/zsh ]]; then if [[ -f /usr/bin/zsh ]]; then
cp "${BUILD_DIR}/dist/${PKGNAME}-zsh" "${INSTALL_ROOT}${PREFIX}/share/zsh/vendor-completions/_${PKGNAME}" cp "${BUILD_DIR}/dist/${PKGNAME}-zsh" "${INSTALL_PREFIX}/share/zsh/vendor-completions/_${PKGNAME}"
fi fi
# Greeter Config # Greeter Config
cp "${BUILD_DIR}/dist/${PKGNAME}.yml" "${INSTALL_ROOT}/etc/lightdm" cp "${BUILD_DIR}/dist/${PKGNAME}.yml" "${INSTALL_ROOT}/etc/lightdm"
# AppData File # AppData File
cp "${BUILD_DIR}/dist/${PKGNAME}.appdata.xml" "${INSTALL_ROOT}${PREFIX}/share/metainfo" cp "${BUILD_DIR}/dist/${PKGNAME}.appdata.xml" "${INSTALL_PREFIX}/share/metainfo"
# Greeter desktop File # Greeter desktop File
cp "${BUILD_DIR}/dist/web-xgreeter.desktop" "${INSTALL_ROOT}${PREFIX}/share/xgreeters/web-greeter.desktop" cp "${BUILD_DIR}/dist/web-xgreeter.desktop" "${INSTALL_PREFIX}/share/xgreeters/web-greeter.desktop"
# Application desktop File # Application desktop File
cp "${BUILD_DIR}/dist/web-greeter.desktop" "${INSTALL_ROOT}${PREFIX}/share/applications/web-greeter.desktop" cp "${BUILD_DIR}/dist/web-greeter.desktop" "${INSTALL_PREFIX}/share/applications/web-greeter.desktop"
# Xgreeter wrapper # Xgreeter wrapper
cp "${BUILD_DIR}/dist/90-greeter-wrapper.conf" \ cp "${BUILD_DIR}/dist/90-greeter-wrapper.conf" \
@ -104,7 +110,7 @@ prepare_install() {
# Don't install hidden files # Don't install hidden files
find "${INSTALL_ROOT}" -type f -name '.git*' -delete find "${INSTALL_ROOT}" -type f -name '.git*' -delete
rm -rf "${INSTALL_ROOT}/usr/share/web-greeter/themes/default/.tx" rm -rf "${INSTALL_PREFIX}/share/web-greeter/themes/default/.tx"
if [[ "${DESTDIR}" != '/' ]]; then if [[ "${DESTDIR}" != '/' ]]; then
# Save a list of installed files for uninstall command # Save a list of installed files for uninstall command
@ -114,7 +120,7 @@ prepare_install() {
do do
[[ -d "${_file}" && *'/web-greeter/'* != "${_file}" ]] && continue [[ -d "${_file}" && *'/web-greeter/'* != "${_file}" ]] && continue
echo "${_file##*/install_root}" >> "${INSTALL_ROOT}${PREFIX}/share/web-greeter/.installed_files" echo "${_file##*/install_root}" >> "${INSTALL_PREFIX}/share/web-greeter/.installed_files"
done < /tmp/.installed_files done < /tmp/.installed_files
@ -124,41 +130,42 @@ prepare_install() {
do_uninstall() { do_uninstall() {
# Man Page # Man Page
rm -f ${DESTDIR}${PREFIX}/share/man/man1/web-greeter.1 DESTDIR_PREFIX=$(echo ${DESTDIR}/${PREFIX} | sed -E 's/\/\//\//g')
rm -f ${DESTDIR_PREFIX}/share/man/man1/web-greeter.1
# Command line completions # Command line completions
if [[ -f /usr/bin/bash ]]; then if [[ -f /usr/bin/bash ]]; then
rm -f ${DESTDIR}${PREFIX}/share/bash-completion/completions/${PKGNAME} rm -f ${DESTDIR_PREFIX}/share/bash-completion/completions/${PKGNAME}
fi fi
if [[ -f /usr/bin/zsh ]]; then if [[ -f /usr/bin/zsh ]]; then
rm -f ${DESTDIR}${PREFIX}/share/zsh/vendor-completions/_${PKGNAME} rm -f ${DESTDIR_PREFIX}/share/zsh/vendor-completions/_${PKGNAME}
fi fi
# Greeter Config # Greeter Config
#rm ${DESTDIR}/etc/lightdm/${PKGNAME}.yml #rm ${DESTDIR}/etc/lightdm/${PKGNAME}.yml
# Themes # Themes
#rm -rf ${DESTDIR}${PREFIX}/share/web-greeter #rm -rf ${DESTDIR_PREFIX}/share/web-greeter
# AppData File # AppData File
rm -f ${DESTDIR}${PREFIX}/share/metainfo/${PKGNAME}.appdata.xml rm -f ${DESTDIR_PREFIX}/share/metainfo/${PKGNAME}.appdata.xml
# Greeter desktop file # Greeter desktop file
rm -f ${DESTDIR}${PREFIX}/share/xgreeters/web-greeter.desktop rm -f ${DESTDIR_PREFIX}/share/xgreeters/web-greeter.desktop
# Application desktop file # Application desktop file
rm -f ${DESTDIR}${PREFIX}/share/applications/web-greeter.desktop rm -f ${DESTDIR_PREFIX}/share/applications/web-greeter.desktop
# XGreeter wrapper # XGreeter wrapper
rm -f ${DESTDIR}/etc/xdg/lightdm/lightdm.conf.d/90-greeter-wrapper.conf rm -f ${DESTDIR}/etc/xdg/lightdm/lightdm.conf.d/90-greeter-wrapper.conf
rm -f ${DESTDIR}/etc/lightdm/Xgreeter rm -f ${DESTDIR}/etc/lightdm/Xgreeter
# Binary # Binary
rm -f ${DESTDIR}${PREFIX}/bin/web-greeter rm -f ${DESTDIR_PREFIX}/bin/web-greeter
[[ -e "${DESTDIR}"/opt/web-greeter ]] && rm -rf ${DESTDIR}/opt/web-greeter [[ -e "${DESTDIR}"/opt/web-greeter ]] && rm -rf ${DESTDIR}/opt/web-greeter
echo "Themes are not uninstalled. Remove them manually: echo "Themes are not uninstalled. Remove them manually:
${DESTDIR}${PREFIX}/share/web-greeter/" ${DESTDIR_PREFIX}/share/web-greeter/"
echo "web-greeter config was not uninstalled. Remove it manually: echo "web-greeter config was not uninstalled. Remove it manually:
${DESTDIR}/etc/lightdm/${PKGNAME}.yml" ${DESTDIR}/etc/lightdm/${PKGNAME}.yml"
} }

4
web-greeter/browser/browser.py

@ -247,14 +247,14 @@ class Browser(Application):
self.show() self.show()
def load(self): def load(self):
self.load_script(':/_greeter/js/bundle.js', 'Web Greeter Bundle')
self.load_theme()
self.greeter = Greeter() self.greeter = Greeter()
self.greeter_config = Config() self.greeter_config = Config()
self.theme_utils = ThemeUtils(self.greeter) self.theme_utils = ThemeUtils(self.greeter)
self.bridge_objects = (self.greeter, self.greeter_config, self.theme_utils) self.bridge_objects = (self.greeter, self.greeter_config, self.theme_utils)
self.initialize_bridge_objects() self.initialize_bridge_objects()
self.load_script(':/_greeter/js/bundle.js', 'Web Greeter Bundle')
self.load_theme()
def _initialize_devtools(self): def _initialize_devtools(self):
self.dev_view = QWebEngineView(parent=self.window) self.dev_view = QWebEngineView(parent=self.window)

Loading…
Cancel
Save