![]() |
|
|
|
|
#1 |
|
Junior Member
Join Date: Jul 2015
Posts: 21
|
Hi stuguy909,
Currently, I made a little script that I launch manually as root after connecting my device. filename : connect_screen.sh Code:
#!/bin/sh
if [ $(id -u) != 0 ]; then
echo "You need to be root to use this script." >&2
exit 1
fi
REFER_SCREEN="LVDS1"
NEW_SCREEN="DVI-1-0"
POSITION="left"
echo "Loading displaylink service..."
systemctl start displaylink.service
echo "Screen connection..."
sleep 2
xrandr --setprovideroutputsource 1 0
sleep 2
echo "Available screen : "
xrandr | grep connected | grep -v disconnected | cut -d' ' -f1
echo "They can be used with option -r to specify the referer screen"
echo "They can be used with option -n to specify the new screen"
echo "The position (left, right) can be specified with option -p"
echo "..."
while getopts :sr:n:p: OPTION
do
case "$OPTION" in
s)
exit 1
;;
r)
REFER_SCREEN="$OPTARG"
;;
n)
NEW_SCREEN="$OPTARG"
;;
p)
POSITION="$OPTARG"
;;
:)
echo "$OPTARG need an argument"
exit 5
;;
\?)
echo "Incorrect option... "
exit 3
;;
esac
done
echo "Place the displaylink screen $NEW_SCREEN at $POSITION of the screen $REFER_SCREEN."
sleep 2
xrandr --output $NEW_SCREEN --auto --$POSITION-of $REFER_SCREEN
echo "Install complete. You can adjust your configuration in the settings panel."
Code:
# ./connect_screen.sh -s Loading displaylink service... Screen connection... Available screen : LVDS1 DVI-1-0 They can be used with option -r to specify the referer screen They can be used with option -n to specify the new screen The position (left, right) can be specified with option -p ... So, to place the screen DVI-1-0 on the right of LVSD1, you have to use the script like : Code:
# ./connect_screen.sh -n DVI-1-0 -p right -r LVDS1 Loading displaylink service... Screen connection... Available screen : LVDS1 DVI-1-0 They can be used with option -r to specify the referer screen They can be used with option -n to specify the new screen The position (left, right) can be specified with option -p ... Place the displaylink screen DVI-1-0 at right of the screen LVDS1. Install complete. You can adjust your configuration in the settings panel. I will add it into my installer and copy it to /sbin to be used by root. You should found some helpful command into this script. I hope that this can help you ;-) To the automation, I think that UDEV could do what we need but I have not found the correct rule yet... Last edited by guerrierk; 09-04-2015 at 06:20 PM. Reason: bugfix for first use |
|
|
|
|
|
#2 |
|
Member
Join Date: Aug 2015
Posts: 37
|
That code example does help, thank you. I have been on holiday this weekend, I will resume coding tomorrow. You saved me a bit of time from having to read up on the xrandr man pages. I would like to borrow some of your switch statement code for beefing up the usability of the displaylink script I'm working on, if you don't mind? A status of what I have achieved and hope to accomplish:
Code:
1) script package launches default behaviors when Displaylink USB device is plugged in -TODO 2) Displaylink service automatically starts and stops -DONE 3) Print connection status of providers and provider count - DONE 4) Print provider unique names - TODO | additionaly, what did you use to pull the monitor names individually? I can print the monitors, but they are in lines of text. 5) Automatically activate all connected providers if script is running - DONE 6) Manually position monitors with a modified version of your code examples - TODO 7) Automatically position monitors based on a preset config file - TODO 8) Script package to be universally compatible on Debian 8.1 for everyone's machine, not just ours. -TODO | I'd say, minus the USB detection, this is pretty much near complete |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2015
Posts: 37
|
One more thought. I would like to borrow your installer scripting services when I have my displaylink init.d package working. I am using init.d so the software loads on RC5. Like I stated earlier, I want to make the USB detection the parent condition for all other services or threads. I would like to add a code segment to your install script when I have the auto detection working. The idea is adding a bit of code that lists your connected monitors after the driver is started. I would like for a text prompt to load up all of your monitors and ask you to enter which provider is the reference, and which are the positioned monitors. This would then create a permanent config file that would be loaded every time the script package is started. I think this is a good idea because random internet people will have something that just works and they won't have to do a lot of tweaking. If we make the scripts detailed enough, then other distros can borrow the ideas / code base for their project.
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2015
Posts: 4
|
Hi all,
I have installed the drivers but after enabling extra screen in Gnome Screens management, it crashes X server and I need to log in again. Using Debian 8.2. Output of dmesg can be found on pastebin: http://pastebin.com/ugVgQ5Vk The DisplayLink logs can be found under that url: https://drive.google.com/file/d/0B3_...ew?usp=sharing Any thoughs why this is happening? Thanks, Marek Last edited by marek; 10-22-2015 at 11:12 AM. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jul 2015
Posts: 21
|
Hi Marek,
I don't found anything that could explain why your X crashes un your dmesg... The DL logs may help but I can't read them. Some people of DL team will certainly talk about it. Could you post your Xserver's error log please ? Thx |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Oct 2015
Posts: 4
|
Hi Guerrierk,
Thanks for the reply. I pasted my Xorg logs here http://pastebin.com/y56ekUR9 Thanks, Marek |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Oct 2015
Posts: 4
|
I have installed Xfce on my Debian and I am getting now extra message error when trying to enable extra screen. The message is:
Code:
The last active output must not be disabled, the system would be unusable. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Oct 2015
Posts: 4
|
Reinstalled yesterday to Ubuntu 14.04.2 and it was working all fine. Reinstalled back to Debian 8.2 with LXDE and couldn't get it working.
My laptop is running with hybrid video cards which are: Intel HD Graphics 5500 and AMD Radeon R7 M270 Can there be an issue with video card drivers? Which one I should be using? Last edited by marek; 10-23-2015 at 10:32 AM. |
|
|
|
![]() |
| Tags |
| debian |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|