Forum

Results 1 to 5 of 5

Thread: OSD For linux

  1. #1
    Join Date
    June 2010
    Location
    Localhost
    Posts
    4

    [Plugin] OSD For linux

    I made a simple lua script that will show who is talking in your channel on the screen as an overlay, even when you are playing games or doing other full screen activities. See the attached screenshot for how it looks. There are some few simple steps to install the script.

    Download and install osd-bin
    If you use ubuntu then you can write in a terminal:
    Code:
    sudo apt-get install xosd-bin
    or compile and install from source:
    http://www.ignavus.net/software.html

    Save the script
    Save the following as "osd.lua" in "<teamspeak folder>/plugins/lua_plugin/"
    Code:
    --The vertical position of the text. POS can be top, middle, or bottom. The default is top.
    local osd_pos="top"
    --The number of pixels the text is offset from the top or bottom of the display. The default is 0.
    local osd_offset=44
    --The horizontal alignment of the text. ALIGN can be left, centre or right. The default is centre.
    local osd_align="right"
    --The number of pixels the text is indented from the left or right of the display. The default is 0.
    local osd_indent=0
    --The font used to display the text. The default is fixed, which may be too small to see clearly.
    local osd_font="-adobe-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
    --The text colour. The default is red.
    local osd_colour="red"
    --The number of seconds the text is displayed before being removed from the display. The default is 5.
    local osd_delay=100
    --The maximum number of lines that can be displayed. The default is 5.
    local osd_lines=5
    --The number of pixels the shadow is offset behind the text. The default is 0, so no shadow is displayed.
    local osd_shadow=1
    --The colour of the shadow. The default is black.
    local osd_shadowcolour="black"
    --The width of the outline, in pixels. The default is 0, so no outline is displayed.
    local osd_outline=1
    --The colour of the outline. The default is black.
    local osd_outlinecolour="black"
    --This option affects screen redrawing. If SCROLL_AGE seconds pass before a new line is ready (for example, you're reading from a pipe), the display is cleared instead of being scrolled. The default is 0, which means all lines are added to the scroll.
    osd_age=100
    
    local clients = {}
    
    local oldOnTalkStatusChangeEvent = onTalkStatusChangeEvent;
    
    function onTalkStatusChangeEvent(serverConnectionHandlerID, status, isReceivedWhisper, clientID)
        oldOnTalkStatusChangeEvent(serverConnectionHandlerID, status, isReceivedWhisper, clientID)
        local msg="";
        clients[clientID]=status;
        for k,v in pairs(clients) do
        	if (v==1) then
        		local clientName, error = ts3.getClientVariableAsString(serverConnectionHandlerID, k, ts3defs.ClientProperties.CLIENT_NICKNAME);
        		msg = msg .. "\n" .. clientName;
        	end
        end
        if (msg=="") then
        	os.execute("killall osd_cat")
        	return
        end
        os.execute("killall osd_cat")
        os.execute("echo \"" .. msg .. "\" | osd_cat --pos=" .. osd_pos .. " --offset=" .. osd_offset .. " --align=" .. osd_align .. " --indent=" .. osd_indent .. " --font=" .. osd_font .. " --colour=" .. osd_colour .. " --delay=" .. osd_delay .. " --lines=" .. osd_lines .. " --shadow=" .. osd_shadow .. " --shadowcolour=" .. osd_shadowcolour .. " --outline=" .. osd_outline .. " --outlinecolour=" .. osd_outlinecolour .. " --age=" .. osd_age .. " &")
    end
    Add to start up
    Edit the file "<teamspeak folder>/plugins/lua_plugin/ts3events.lua" and add
    Code:
    require("osd")
    to the bottom of the code.

    Enable lua in teamspeak
    Settings -> plugins -> check Lua plugin.

    Some information
    This is a very simple script and the program used is not really made for this purpose so if something goes wrong don't blame me. There are some stuff you can change in the script at the top, like color, positioning and more for the OSD. Read the comments and try to edit some yourself. For more information type "osd_cat --help" in a terminal.

    Changelog
    8/6-2010
    - Removed the need for a temp file
    - Made the script call any old hooks to the client talk status
    Last edited by Otharath; June 8th, 2010 at 09:24 AM.

  2. #2
    Join Date
    June 2010
    Location
    spain
    Posts
    2
    Work in beta21? I follow the manual but i dont see names on speak

    Thanks!

    PD: My fault, work perfectly in beta21 on arch64. THANKS!!!!
    Last edited by viodream; June 4th, 2010 at 06:27 PM.

  3. #3
    Join Date
    November 2009
    Location
    Dublin, Ireland
    Posts
    379
    works nicely, cool plugin!

  4. #4
    Join Date
    June 2010
    Location
    Suffolk, UK
    Posts
    1

    Lightbulb Enhancements

    Firstly, great plugin! I'm sure a lot of users will find it useful. I wanted a little more information in the OSD though and that leads me nicely to...

    I've used your script as the basis for an overlay similar to that used in Mumble. I've not used Lua before and found your plugin of great help in starting out. I wanted to increase the information shown in the OSD without adding to the requirements or installation procedure.

    The changes I have made:
    • OSD first launched upon successful connection to server
    • OSD now lists channels that are children of the root channel and the clients within
    • Currently speaking user prefixed with ">>"
    • OSD now shows away status

    The changes I intend to make:
    • Include clients when they join/leave channels (currently updates the next time any user speaks).
    • Update OSD when client updates away status (currently updates the next time any user speaks).
    • Retrieve PID of osd_cat started by the plugin and kill only that PID in case other programs are using osd_cat.


    I can post the enhanced version here or start a new thread if you'd rather I did that. Either way I'll credit you as the author of the original script and include the URL of this thread. Credit where credit's due
    Last edited by Nachtkinder; June 9th, 2010 at 12:30 PM. Reason: Added future enhancement involving PID

  5. #5
    Join Date
    June 2010
    Location
    Localhost
    Posts
    4
    Quote Originally Posted by Nachtkinder View Post
    Firstly, great plugin! I'm sure a lot of users will find it useful. I wanted a little more information in the OSD though and that leads me nicely to...

    I've used your script as the basis for an overlay similar to that used in Mumble. I've not used Lua before and found your plugin of great help in starting out. I wanted to increase the information shown in the OSD without adding to the requirements or installation procedure.

    The changes I have made:
    • OSD first launched upon successful connection to server
    • OSD now lists channels that are children of the root channel and the clients within
    • Currently speaking user prefixed with ">>"
    • OSD now shows away status

    The changes I intend to make:
    • Include clients when they join/leave channels (currently updates the next time any user speaks)
    • Update OSD when client updates away status (currently updates the next time any user speaks).


    I can post the enhanced version here or start a new thread if you'd rather I did that. Either way I'll credit you as the author of the original script and include the URL of this thread. Credit where credit's due
    It doesn't matter to me. I can check the code if you want, I have done a lot of lua earlier and know how to do stuff. So either post it here, send it to me in a pm or make a new thread and I'll try to help in anyway I can.

    I was thinking about adding more features wasn't sure if I should try to make a real plugin in c instead that uses the lib which osd_cat uses. In that lib the possibility to get some better control over the osd window which means that it's not needed to kill the osd process all the time.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] Linux x86_64, not Linux i386
    By 35Jumpman in forum Server Support
    Replies: 4
    Last Post: August 11th, 2014, 01:59 PM
  2. Issues moving TS3 server from 32-bit linux to 64-bit linux
    By DreamPhysix in forum Linux / FreeBSD
    Replies: 1
    Last Post: March 10th, 2011, 07:43 AM
  3. Linux server install for low-skill-in-linux-terminal guy
    By flakz0r in forum Linux / FreeBSD
    Replies: 5
    Last Post: December 30th, 2010, 08:03 AM
  4. Replies: 0
    Last Post: February 24th, 2010, 04:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •