Go Back   DisplayLink Forum > DisplayLink Graphics Technology > Linux and Open Source

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-03-2016, 04:16 PM   #1
PlusMinus
Junior Member
 
Join Date: Feb 2016
Posts: 3
Smile udev rule for starting/stopping DisplayLinkManager on plug/unplug

I read about high battery drain with a running DisplayLinkManager so i decided to only start the process when the dock is attached. This is what I have come up with:

Requirements: A working upstart or systemd script

At first I created a (very basic) shell script at /usr/local/bin/startDisplayLink.sh for controlling the service because udev can't control services directly.

Code:
#!/bin/bash
service displaylink $1
then I added two lines to /etc/udev/rules.d/99-displaylink.rules

Code:
ACTION=="add", ATTR{product}=="Dell D3100 USB3.0 Dock", RUN+="/usr/local/bin/startDisplayLink.sh start"
ACTION=="remove", ENV{ID_MODEL}=="Dell_D3100_USB3.0_Dock", RUN+="/usr/local/bin/startDisplayLink.sh stop"
This does the trick. This might be unreliable and your system match catch fire because it is really just a quick hack. So use at your own risk, it has been working for me though.
PlusMinus is offline   Reply With Quote
Reply

Tags
ubuntu, udev

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:28 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.