Preview

Brightness Controller

Good Essays
Open Document
Open Document
470 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Brightness Controller
#!/usr/bin/env python
# -*- coding:utf-8 -*-

import wx import subprocess from os import system

class BrightnessController(wx.Frame):

def debug_true(self): return False

def detect_display_devices(self): """Detects available displays""" connected_devs = []

xrandr_output = subprocess.check_output('xrandr -q', shell=True)

lines = xrandr_output.split('\n') for line in lines: words = line.split(' ') for word in words: if word == 'connected': connected_devs.append(words[0]) return connected_devs

def __init__(self, parent, title): super(BrightnessController, self).__init__(parent, title=title, size=(325, 100)) self.detected_devices = self.detect_display_devices() self.no_of_detected_device = len(self.detected_devices)

if self.no_of_detected_device == 1 or self.no_of_detected_device == 2: if self.debug_true(): print 'Found one' self.primary_name = self.detected_devices[0] else: self.primary_name = 'Not Found!' if self.no_of_detected_device == 2: if self.debug_true(): print 'Found two' self.secondary_name = self.detected_devices[1] else: self.secondary_name = 'Not Found'

self.array_value = 0.00 self.cmds_primary_display = [] self.cmds_secondary_display = []

for i in xrange(0, 101): cmd_primary_display = "xrandr --output \ %s --brightness %s" % (self.primary_name, self.array_value) cmd_secondary_display="xrandr --output \ %s --brightness %s" % (self.secondary_name, self.array_value) self.cmds_primary_display.append(cmd_primary_display)

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Pt1420 Unit 6 Programming

    • 420 Words
    • 5 Pages

    print (” These are not primary colors . I can ’ t mix them !”)…

    • 420 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    In the space provided below, copy and paste your IP_FileWrite.vbs program sourcecode. If it doesn’t fit, use the next page for the continuation of your program sourcecode.…

    • 1328 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    It210 Week 4 Psuedocode

    • 584 Words
    • 3 Pages

    Program Pseudocode Currency_Convertor Main Module Delcare USDollars As Float Declare Rate1 As Float Declare Rate2 As Float Declare Rate3 As Float Declare Rate4…

    • 584 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Let us discuss some key concepts to be used for better understanding of video display device…

    • 386 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    3. What does a display filter do? Where do you add in a display filter? (1 point)…

    • 1389 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CEIS100 W5 ILab Report

    • 320 Words
    • 2 Pages

    The objective was to create a program using python. The program should successfully ask the user to input his or her name. Then ask the user to enter his or her age. If they are older than 16 then they can drive a car. Display this message along with their name. Then end the program by stating the users name, and that it is nice to meet them.…

    • 320 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Comp230 Wk 5 Lab

    • 411 Words
    • 2 Pages

    Copy your Mod1_PCTests.vbs program from NotePad++ and paste it into the space provided below. Any portion of the script that will not fit should be continued in the textbox on the next page.…

    • 411 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    In the space provided below, copy and paste your VBScript Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program…

    • 529 Words
    • 3 Pages
    Powerful Essays
  • Powerful Essays

    It 210 Final Project

    • 1033 Words
    • 5 Pages

    Write, “Select international currency type: Canadian dollars, Mexican pesos, English pounds, Japanese yen, French francs.”…

    • 1033 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Programing Problems

    • 721 Words
    • 3 Pages

    End Display Module…

    • 721 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Comp230 W2 Ilab

    • 1120 Words
    • 5 Pages

    Student Name | | Class | Comp230 | Date | 5/16/2013 | VBScript IPO VBox Lab Report ' VBScript: NameAge.vbs ' Written by: ' Date: 5/16/2013 ' Class: Comp230 ' Professor: Giao Dau ' = == == == ==…

    • 1120 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    b) You respond to whether a stimulus appears on the left or the right side of a screen by pressing a button.…

    • 1126 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows:…

    • 620 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Displays in Schools

    • 634 Words
    • 3 Pages

    When preparing to work on a display in our school there are outlines which must be followed to ensure the safety and quality of the display. The display must pose no possible risk to the health and safety of the children, this means there should be no pins sticking out of the wall and no protruding sharp objects. There are set areas in the corridors and hall for each class to work, it is important to check which area has been allocated to your class before working on a display. All displays must be backed in coloured paper and have a clear heading or title. All items of paper should be laminated before putting on the display as this will prevent them from being damaged and help the display to last as long as possible. Items should be fixed to the display by using a wall stapler or adhesive Velcro strips. Pieces of work by the children may need to be photocopied first as the originals could be needed by the class teachers. All pupils should have an item of work on display as this promotes confidence in their own learning. When using photographs of children, it is important to check that the parents of every child have granted permission for photographic images of child to be taken and used. This information is kept in the school office. The display should be inspected regularly to maintain standards and repair any damaged areas. This is an important health and safety aspect as an item which has fallen from the display could become a hazard. When the display is dismantled any appropriate material should be recycled.…

    • 634 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Samsung Strategy Map

    • 250 Words
    • 1 Page

    |Display » » » » » » » »» » » » » » » » » |Ultra large flat panel displays, mobile/flexible displays |…

    • 250 Words
    • 1 Page
    Satisfactory Essays

Related Topics