summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaveB2015-10-05 11:14:05 +0200
committerDaveB2015-10-05 11:14:05 +0200
commit370a0e33624fff753d3c37e25aa61f5b2c065803 (patch)
tree1dfe4597bff9ae4f46e11a15f2fa0b07a803b13f
parent777ed71f69674f13dbecf4ea2dd550ad34c7b6a5 (diff)
downloadaur-370a0e33624fff753d3c37e25aa61f5b2c065803.tar.gz
Tried to solve chromium compatibility, pulse, added terminal starting program crd and altered service file to reflect differences
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD25
-rw-r--r--chrome-remote-desktop.install13
-rw-r--r--chrome-remote-desktop.service6
-rw-r--r--crd135
5 files changed, 169 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cfe8bfad631b..ee965d0c110f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = chrome-remote-desktop
pkgdesc = Allows you to securely access your computer over the Internet through Chrome.
pkgver = 45.0.2454.17
- pkgrel = 2
+ pkgrel = 3
url = https://chrome.google.com/webstore/detail/gbchcmhmhahfdphkhkmpfmihenigjmpp
install = chrome-remote-desktop.install
arch = i686
@@ -16,10 +16,12 @@ pkgbase = chrome-remote-desktop
depends = xorg-setxkbmap
depends = xorg-server-xvfb
depends = xorg-xauth
- source = chrome-remote-desktop.service
source = https://dl.google.com/linux/direct/chrome-remote-desktop_current_i386.deb
- md5sums = cde1758e875ff114cc8153edb7087d2a
+ source = chrome-remote-desktop.service
+ source = crd
md5sums = SKIP
+ md5sums = 6f6083ff37f036f590702c7b1319445b
+ md5sums = 73ff65f76f73a5a05746474dabf5ae54
pkgname = chrome-remote-desktop
diff --git a/PKGBUILD b/PKGBUILD
index 41aff9fadd07..eae95c948150 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=chrome-remote-desktop
pkgver=45.0.2454.17
-pkgrel=2
+pkgrel=3
pkgdesc="Allows you to securely access your computer over the Internet through Chrome."
url="https://chrome.google.com/webstore/detail/gbchcmhmhahfdphkhkmpfmihenigjmpp"
arch=('i686' 'x86_64')
@@ -15,10 +15,12 @@ depends=('python2' 'python2-psutil' 'gconf' 'gtk2' 'nss'
_arch=i386
[ "$CARCH" == x86_64 ] && _arch=amd64
-source=("$pkgname.service"
- "https://dl.google.com/linux/direct/${pkgname}_current_${_arch}.deb")
-md5sums=('cde1758e875ff114cc8153edb7087d2a'
- 'SKIP')
+source=("https://dl.google.com/linux/direct/${pkgname}_current_${_arch}.deb"
+ "$pkgname.service"
+ "crd")
+md5sums=('SKIP'
+ '6f6083ff37f036f590702c7b1319445b'
+ '73ff65f76f73a5a05746474dabf5ae54')
pkgver() {
bsdtar -xf control.tar.gz -O control | grep '^Version: ' | cut -f2 -d' '
@@ -57,8 +59,17 @@ package() {
msg2 "Adding systemd user service file"
install -Dm644 "$pkgname.service" "$pkgdir/usr/lib/systemd/user/$pkgname.service"
+
+ msg2 "Adding runnable crd command"
+ install -Dm755 "crd" "$pkgdir/usr/bin/crd"
msg2 "Creating symlinks for chromium compatibility"
- install -dm755 "$pkgdir/etc/chromium"
- ln -s "/etc/opt/chrome/native-messaging-hosts" "$pkgdir/etc/chromium/native-messaging-hosts"
+ install -dm755 "$pkgdir/etc/chromium/native-messaging-hosts"
+ for _file in $( find "$pkgdir/etc/opt/chrome/native-messaging-hosts" -type f); do
+ _filename=${_file##*/}
+ if [[ ! -f "/etc/chromium/native-messaging-hosts/${_filename}" ]]; then
+ ln -s "/etc/opt/chrome/native-messaging-hosts/${_filename}" \
+ "$pkgdir/etc/chromium/native-messaging-hosts/${_filename}"
+ fi
+ done
}
diff --git a/chrome-remote-desktop.install b/chrome-remote-desktop.install
index 40ec33842858..77b7fb15b435 100644
--- a/chrome-remote-desktop.install
+++ b/chrome-remote-desktop.install
@@ -1,9 +1,6 @@
post_install() {
- # Create chrome-remote-desktop group
- groupadd --gid $GID chrome-remote-desktop
- # Instruct to create $HOME/.config/chrome-remote-desktop
- # Instruct to add self to CRD group
- # Instruct order to install CRD extension and enable CRD user service unit
+ # Create chrome-remote-desktop group, adds $USER
+ [[ $(cat /etc/group) == *chrome-remote-desktop* ]] || groupadd --gid $GID chrome-remote-desktop
echo ""
echo "Please create ~/.config/chrome-remote-desktop folder manually, if it doesn't exist, or else you can't use CRD."
@@ -12,6 +9,12 @@ post_install() {
echo ""
echo "You may need to create a ~/.chrome-remote-desktop-session file with commands to start your session"
echo ""
+ echo "You can also start the chrome remote desktop server by executing the command:"
+ echo ""
+ echo " $ crd"
+ echo ""
+ echo "as a normal user. This will add the directory, session file, add you as a user and everything on the first run."
+ echo ""
echo "Go to https://support.google.com/chrome/answer/1649523 for more information."
}
diff --git a/chrome-remote-desktop.service b/chrome-remote-desktop.service
index e177f5ea4dc2..17df41adb78a 100644
--- a/chrome-remote-desktop.service
+++ b/chrome-remote-desktop.service
@@ -5,9 +5,9 @@ ConditionPathExistsGlob=%h/.config/chrome-remote-desktop/host#*.json
[Service]
Type=forking
-ExecStart=/opt/google/chrome-remote-desktop/chrome-remote-desktop --start
-ExecStop=/opt/google/chrome-remote-desktop/chrome-remote-desktop --stop
-ExecReload=/opt/google/chrome-remote-desktop/chrome-remote-desktop --reload
+ExecStart=/usr/bin/crd --start
+ExecStop=/usr/bin/crd --stop
+ExecReload=/usr/bin/crd --restart
[Install]
Alias=chromoting.service
diff --git a/crd b/crd
new file mode 100644
index 000000000000..d55bd1a1f930
--- /dev/null
+++ b/crd
@@ -0,0 +1,135 @@
+#! /bin/bash
+
+if [[ $(whoami) == "root" ]]; then
+ echo "Please run this as a normal user!"
+ exit
+fi
+
+# Adding user, setting up directories
+
+if [[ ! -f $HOME/.config/chrome-remote-desktop/prepped ]]
+then
+ sudo gpasswd -a $USER chrome-remote-desktop
+ echo "Checking working directory and session file are present"
+ echo "That would be $HOME/.config/chrome-remote-desktop and"
+ echo "$HOME/.chrome-remote-desktop-session"
+ [[ -d $HOME/.config/chrome-remote-desktop ]] || mkdir $HOME/.config/chrome-remote-desktop
+ touch $HOME/.chrome-remote-desktop-session
+ echo "$(date -Is)" > $HOME/.config/chrome-remote-desktop/prepped
+fi
+
+# Straightforward toggle – if CRD running, stop, otherwise start
+# This also kills old pulse configuration files as they won't work restarting CRD
+
+crd_status=$(/opt/google/chrome-remote-desktop/chrome-remote-desktop --get-status)
+
+case $1 in
+
+--restart)
+ if [[ $crd_status == "STARTED" ]]
+ then
+ echo "CRD running, stopping and restarting again"
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --stop
+ else
+ echo "CRD not running, starting fresh"
+ fi
+ rm -rf $HOME/.config/chrome-remote-desktop/pulseaudio*
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --start
+ ;;
+
+--reload)
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --reload
+ ;;
+
+--stop)
+ if [[ $crd_status == "STARTED" ]]
+ then
+ echo "CRD running, stopping"
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --stop
+ else
+ echo "CRD is not running, nothing to do"
+ fi
+ rm -rf $HOME/.config/chrome-remote-desktop/pulseaudio*
+ ;;
+
+--start)
+ if [[ ! -f $HOME/.config/chrome-remote-desktop/prepped ]]
+ then
+ echo "You might want to run crd --setup first if this doesn't seem to work"
+ fi
+ if [[ $crd_status == "STARTED" ]]
+ then
+ echo "CRD already running, nothing to do"
+ exit
+ fi
+ rm -rf $HOME/.config/chrome-remote-desktop/pulseaudio*
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --start
+ ;;
+
+--setup)
+ if [[ ! -f $HOME/.config/chrome-remote-desktop/prepped ]]
+ then
+ sudo gpasswd -a $USER chrome-remote-desktop
+ echo "Checking working directory and session file are present"
+ echo "That would be $HOME/.config/chrome-remote-desktop and"
+ echo "$HOME/.chrome-remote-desktop-session"
+ [[ -d $HOME/.config/chrome-remote-desktop ]] || mkdir $HOME/.config/chrome-remote-desktop
+ touch $HOME/.chrome-remote-desktop-session
+ echo "$(date -Is)" > $HOME/.config/chrome-remote-desktop/prepped
+ else
+ echo "Already set up. If you want to try it again, you will need to delete"
+ echo "$HOME/.config/chrome-remote-desktop/prepped"
+ fi
+ ;;
+
+--help|-h)
+ echo "Usage: crd [option]"
+ echo ""
+ echo "Options:"
+ echo ""
+ echo "--start"
+ echo "Starts CRD after destroying old pulse files"
+ echo ""
+ echo "--stop"
+ echo "Stops CRD if running, deletes old pulse files"
+ echo ""
+ echo "--restart"
+ echo "Stops and restarts CRD, destroying non-functioning pulse files"
+ echo ""
+ echo "--reload"
+ echo "Just reloads CRD"
+ echo ""
+ echo "--help, -h"
+ echo "This help message"
+ echo ""
+ echo "--setup"
+ echo "Sets up CRD for your system by adding folders, sessions, users"
+ echo "and stuff. You should do this first, after a fresh install. This"
+ echo "will be done automatically if you just run crd without options."
+ echo ""
+ echo "No options given"
+ echo "If CRD running, stop it. Otherwise start it. Checks if user"
+ echo "directory and session file is present, and that user $USER is"
+ echo "in the chrome-remote-desktop group, and fixes this if needed."
+ echo ""
+ ;;
+
+*)
+ crd --setup
+ if [[ $crd_status = "STARTED" ]]
+ then
+ echo "CRD is already running; stopping."
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --stop
+ rm -rf $HOME/.config/chrome-remote-desktop/pulseaudio*
+ echo "Deleted old pulse audio files"
+ exit
+ else
+ echo "CRD is not running; starting."
+ echo "Deleting old pulse audio files"
+ rm -rf $HOME/.config/chrome-remote-desktop/pulseaudio*
+ /opt/google/chrome-remote-desktop/chrome-remote-desktop --size=1360x768 --start
+ exit
+ fi
+ ;;
+
+esac