• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Jeff Mikels

…biblical Christianity without conservative idolatry…

  • Home
  • All My Sermons
  • My Blog
    • Longer Articles
    • Christian Leadership
    • Spiritual Health
    • Tough Questions
    • Geekery
    • All Posts
  • About Me
    • My Books
    • My Church
    • FAQ
  • Show Search
Hide Search
Home/Geekery/Hide Desktop for Distraction Free Writing

Hide Desktop for Distraction Free Writing

Distraction free writing is all the rage these days, and I’m a huge proponent of the movement because I am very prone to distraction. Why right now, I should be doing something else, but I got distracted with this!

Anyway, one of my essential tools for a distraction free environment is a totally black desktop with no icons showing. Each operating system has techniques for making this happen, but I have found a solution that works on all operating systems equally. The only requirement is that you have Python installed (tested on 2.7).

This code runs as an app, so you don’t have to change any operating system settings to get it to work, and as soon as you want to see your desktop again, just double-right-click on the black background and it will exit!

Here’s the python code to make it happen (watch out for word wrapping).

#!/usr/bin/python

from Tkinter import *

class App():
    def __init__(self):
        self.root = Tk()
        self.root.overrideredirect(1)

        screen_width = self.root.winfo_screenwidth()
        screen_height = self.root.winfo_screenheight()

        self.frame = Frame(self.root, width=screen_width, height=screen_height,
                           borderwidth=0, relief=RAISED, background="#000000")
        self.frame.bind("<FocusIn>", self.unfocus)
        self.frame.bind("<Button-1>", self.unfocus)
        self.frame.bind("<Double-Button-1>", self.unfocus)
        self.frame.bind("<Double-Button-2>", self.quit)
        self.frame.pack_propagate(False)
        self.frame.pack()

        self.root.geometry('%dx%d+%d+%d' % (screen_width, screen_height, 0, 0))

        self.root.lower();
        # self.root.call('wm', 'attributes', '.', '-topmost', True)
        # self.root.after_idle(self.root.call, 'wm', 'attributes', '.', '-topmost', False)

    def quit(self, event):
        self.root.quit()

    def unfocus(self, event):
        self.root.lower()


app = App()
app.root.mainloop()

Written by:
Jeff Mikels
Published on:
March 14, 2015
Thoughts:
No comments yet

Categories: Geekery

Previous Post: « Should We Support Total Religious Freedom?
Next Post: Bash // Create or Attach to Screen Session on Login »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Articles

Dear Christian Conservative: Vote Your Conscience

Today is Super Tuesday meaning that a large number of states are having their primaries for the Presidential election. Currently, for …

Continue Reading about Dear Christian Conservative: Vote Your Conscience

Let’s Talk about Salvation: Part 2

Salvation and Forgiveness in the Gospel of John In my previous post, I considered a large number of passages in the synoptic gospels (Matthew, …

Continue Reading about Let’s Talk about Salvation: Part 2

Let’s Talk About Salvation and Forgiveness: Part 1

I've been thinking a lot about this idea recently: What would it look like if we were as eager to forgive as Jesus was? This is a tough …

Continue Reading about Let’s Talk About Salvation and Forgiveness: Part 1

Evangelical Idolatry

I've been going through a dilemma. The question on my mind is this: How do I talk about my book with people who don't know me all that …

Continue Reading about Evangelical Idolatry

Explore more

Footer

About Me

Jeff Mikels • 765-404-0807

Copyright © 2025 · Log in

  • Home
  • Blog
  • About Me
  • FAQ
  • Contact