Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:03:00+00:00 2026-05-29T20:03:00+00:00

How to close several tabs in a pidgin conversation window from a script (some

  • 0

How to close several tabs in a pidgin conversation window from a script (some #general and #nickserv tabs). I tried using xdotool and devilspie but no result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:03:01+00:00Added an answer on May 29, 2026 at 8:03 pm

    You can use Pidgin’s DBus API to close a conversation. See Pidgin’s DbusHowto. The following Python code closes all conversation windows with name matching the to_close list. (I tested this with IM usernames, but not with IRC chatroom names, so it may require some additional tweaking for your purposes.)

    to_close = ["#general", "nickserv"]
    for conv in purple.PurpleGetConversations():
        if purple.PurpleConversationGetName(conv) in to_close:
            purple.PurpleConversationDestroy(conv)
    

    Put the following at the top of your Python file to initialize the purple object for communicating with Pidgin/Finch over D-Bus (from the DbusHowTo):

    #!/usr/bin/env python
    import dbus
    import sys
    
    # Based off http://developer.pidgin.im/wiki/DbusHowto
    bus = dbus.SessionBus()
    obj = bus.get_object("im.pidgin.purple.PurpleService",
                         "/im/pidgin/purple/PurpleObject")
    purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
    

    For those of you who don’t like Python, here’s the same thing rewritten in sh using purple-remote (note that for arg iterates over the arguments to the script):

    #!/bin/sh
    # Note that the result of sed here is a string like "(1234) (5678)".
    for conversation in `purple-remote PurpleGetConversations | sed 's/^.*[[]//' | sed 's/].*$//' | sed s/dbus.Int32//g | sed s/,//g`
    do
        conv_name=`purple-remote "PurpleConversationGetName$conversation"`
        for arg
        do
            if [ "$arg" = "$conv_name" ]
            then
                purple-remote "PurpleConversationDestroy$conversation"
            fi
        done
    done
    

    I am completely unsure how brittle that pipeline of seds is, though. The Python seems much cleaner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to close parent window in Firefox 2.0 using JavaScript. I have
I worked on this for several hours today and I'm pretty close to a
after several months having the site disappear from search results in every major search
New to jQuery here. I've found several web pages that come close to what
I use several jquery ui dialogs in my application to collect input from users
I have a form with several textboxes and other controls. I'm using the errorprovider
My application have several modules, each in one tab on the mainform. When using
I have tried copying several different examples, used shape layouts, tried images, etc. No
I make several calls to a function that reads data from an input file.
using several codes available throughout the site, I built a small application that would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.