LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-09-2016, 07:02 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Skype, Apulse, home directory protection and custom menu entry: putting it all together


Hi,

This morning I've been fiddling with Skype, and things run more or less OK. I just need a hand for some finishing touches.

First, I installed the apulse and skype packages from SBo, without tweaking anything. I'm running Slackware64-14.1 with multilib.

I fired up Skype and got no sound. So I checked in /usr/share/applications/skype.desktop to see how Skype was called:

Code:
Exec=env XLIB_SKIP_ARGB_VISUALS=1 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype %U
I added 'apulse' to that line:

Code:
Exec=env XLIB_SKIP_ARGB_VISUALS=1 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so apulse skype %U
Now sound worked OK, and the Skype Echo Call test was successful.

My next idea was confidentiality, since Skype is notorious for its intrusiveness. I read the README.Slackware file on SBo and followed the suggestion at the end of the file, e. g. created a skype user and group like this:

Code:
# groupadd -g 666 skype
# useradd -u 666 -d /home/skype -m -s /bin/bash -g skype skype
# usermod -a -G audio,video skype
# echo "%skype ALL=(skype) NOPASSWD: /usr/bin/skype" \
    >> /etc/sudoers.d/66_skype
# usermod -a -G skype kikinovak
Then I opened a terminal and executed Skype with these limited rights:

Code:
$ xhost +local: && sudo -u skype /usr/bin/skype
This also worked, sort of, except I had no video and no sound, since Skype was not called with all the parameters defined in the custom menu entry file as above.

So I have two questions:
  1. How would I put all of this together on the command-line?
  2. How would I put all of this together in a custom menu entry skype.desktop?

Cheers,

Niki
 
Old 01-09-2016, 08:17 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
How about creating a /usr/local/bin/skype shellscript wrapper that does the necessary before execing skype. That's my usual approach to these sorts of situations.
 
1 members found this post helpful.
Old 01-09-2016, 08:45 AM   #3
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 249

Rep: Reputation: 24
Quote:
except I had no video and no sound
I think it would be enough to put skype user into 'audio' and 'video' groups.
For command-line, as a option, you may use alias; to do it, place the skype binary to /usr/libexec/skype/skype and make an alias:
Code:
echo "alias skype=\"xhost +local: && sudo -u skype /usr/bin/skype $@\"" >> ~/.bashrc
Then, in the /usr/bin/skype place this:
Code:
#!/bin/sh

XLIB_SKIP_ARGB_VISUALS=1 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so apulse /usr/libexec/skype/skype $@
Then you will no need to modify skype.desktop. Also, for me, I made a modification of the original SBo's SlackBuild:
Code:
--- skype.SlackBuild.orig	2014-07-05 05:21:02.000000000 +0400
+++ skype.SlackBuild	2016-01-09 17:43:15.749248162 +0300
@@ -3,6 +3,7 @@
 # Slackware build script for skype
 
 # Copyright 2010, 2012, 2013, 2014  Mario Preksavec, Zagreb, HR
+# Modification 2015, Yaroslav Shmelev, Russia
 # All rights reserved.
 #
 # Redistribution and use of this script, with or without modification, is
@@ -68,10 +69,29 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
-mkdir -p $PKG/usr/{bin,share/{skype,pixmaps,applications}} $PKG/etc/dbus-1/system.d
+mkdir -p $PKG/usr/{bin,doc/$PRGNAM-$VERSION,share/{skype,pixmaps,applications}} $PKG/etc/dbus-1/system.d
 cp -a skype $PKG/usr/bin
 cp -a avatars lang sounds $PKG/usr/share/skype
-cat skype.desktop > $PKG/usr/share/applications/skype.desktop
+
+# Detect apulse. If found, skype will use them:
+echo -n "Detecting apulse... "
+APULSEBIN=$(which apulse)
+if [ ! -z ${APULSEBIN} ]; then
+  echo "yes, $APULSEBIN."
+  sed -e "s@APULSE@$APULSEBIN%" $CWD/skype-alternative.desktop.in > $CWD/skype-alternative.desktop
+else
+  echo "WARNING: apulse binary not found."
+  sed -e 's/@APULSE@//' $CWD/skype-alternative.desktop.in > $CWD/skype-alternative.desktop
+fi
+
+# Use alternative desktop file for skype instead of default one:
+if [ ${USE_ALTERNATIVE_DESKTOP:-yes} ]; then
+  cat $CWD/skype-alternative.desktop > $PKG/usr/share/applications/skype-alternative.desktop
+  cat skype.desktop > $PKG/usr/doc/$PRGNAM-$VERSION/skype-original.desktop
+else
+  cat skype.desktop > $PKG/usr/share/applications/skype.desktop
+  cat $CWD/skype-alternative.desktop > $PKG/usr/doc/$PRGNAM-$VERSION/skype-alternative.desktop
+fi
 cat icons/SkypeBlue_48x48.png > $PKG/usr/share/pixmaps/skype.png
 cat skype.conf > $PKG/etc/dbus-1/system.d/skype.conf
 
@@ -83,8 +103,6 @@
 cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
 cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
-cat $CWD/skype-alternative.desktop > \
-  $PKG/usr/doc/$PRGNAM-$VERSION/skype-alternative.desktop
 
 mkdir -p $PKG/install
 cat $CWD/slack-desc > $PKG/install/slack-desc
And then use the alternative desktop entry file:

Code:
cat skype-alternative.desktop.in 
[Desktop Entry]
Name=Skype (Alternative)
Comment=Skype Internet Telephony
Exec=env XLIB_SKIP_ARGB_VISUALS=1 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so @APULSE@ skype %U
Icon=skype.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
MimeType=x-scheme-handler/skype;
X-KDE-Protocols=skype

Last edited by yars; 01-09-2016 at 08:54 AM.
 
1 members found this post helpful.
  


Reply

Tags
skype slackware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Openbox: Custom menu-entry ignored l0p3n Linux - Desktop 2 06-11-2015 09:53 PM
[SOLVED] a deb for APULSE (working with Skype)? Xeratul Debian 5 01-22-2015 02:49 PM
Fedora 17 -- custom entry does not show up in grub menu. People'spoet Linux - Kernel 3 06-13-2012 02:49 AM
gnome-mouse-properties is not updating the home directory gconf entry immediately kondrara Linux - Desktop 1 05-25-2009 10:21 AM
ss -u not putting me in my /home/ directory. jwholey Linux - Software 1 07-06-2006 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration