Skip to content

Commit

Permalink
Version 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cow-killer authored Jan 27, 2022
1 parent ea267b1 commit 662c7fd
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions ds_led.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# DualSense LED Configurator 0.3
# © 2021 cow_killer
# DualSense LED Configurator 0.4
# © 2021, 2022 cow_killer, thats-the-joke, ivanbratovic

import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib # for GUI
import random # for random RGB colors
Expand All @@ -20,7 +19,7 @@
# extract the main controller directory
device_path = "/".join(device_path.decode().split("/")[0:-2])

# get the random number assigned to the contoller
# get the random number assigned to the controller
input_num = subprocess.check_output(["find", "/sys/devices/", "-name", "input*:white:player-1"])
input_num = input_num.decode().split("/")[-1].split(":")[0][5:]

Expand All @@ -36,7 +35,7 @@
medium_battery = "assets/medium_battery.png"
low_battery = "assets/low_battery.png"

version_number = "0.3"
version_number = "0.4"

# check to see if user has root privileges, if not exit
if os.geteuid() != 0:
Expand All @@ -52,15 +51,15 @@ def __init__(self, parent):
version = Gtk.Label()
version.set_markup("<big><b>DualSense LED Configurator " + version_number + "</b></big>")
author = Gtk.Label()
author.set_markup("<big><b>© 2021 cow_killer</b></big>\n")
author.set_markup("<big><b>© 2021, 2022 cow_killer</b></big>\n")
source = Gtk.Label()

warning = Gtk.Label()
warning.set_markup("<b>WARNING:</b> This software is currently unstable!\n")

credits_label = Gtk.Label()
credits_label.set_markup(
"Icon image by Martial Red\nDS image by Khairuman\nBattery icons by nadeem\nCode cleanup by thats-the-joke"
"Icon image by Martial Red\nDS image by Khairuman\nBattery icons by nadeem\nSpecial thanks to thats-the-joke and ivanbratovic for PRs\n"
)

box = self.get_content_area()
Expand Down Expand Up @@ -111,7 +110,7 @@ def init_ui(self):
status = status_file.readline().strip()
if status == "Charging":
battery_label.set_markup(
"Battery: <b>" + battery_percentage_left + "percent, charging</b>"
"Battery: <b>" + battery_percentage_left + " percent, charging</b>"
)
battery_icon.set_from_file(charging_battery)
elif status == "Full":
Expand Down Expand Up @@ -252,7 +251,6 @@ def disable_individual_led(self, led_num):
wr.write("0")
wr.close()

# Beginning of definitions
def open_color_picker(self, widget): # Color picker for side LEDs
win = tkinter.Tk()
win.title(string="Choose Color")
Expand Down Expand Up @@ -320,7 +318,7 @@ def rgb_rainbow_clicked(self, widget):
random_blue_increment = random.randint(1, 10)
while (
red <= max_rgb and green <= max_rgb and blue <= max_rgb
): # slowly glomonorepo% w brighter
): # slowly glow brighter
wr = open(
f"{rgb_leds_path}/multi_intensity",
"r+",
Expand Down Expand Up @@ -426,7 +424,7 @@ def all_leds_clicked(self, widget):

# Progress bar LEDs
def prog_bar_clicked(self, widget):
print("Running progress bar, press Enter any time to stop ->")
print("Running progress bar, press Enter any time to stop -> ")
while True:
# Turn off all the LEDs before proceeding
for i in range(1, 6):
Expand All @@ -445,7 +443,7 @@ def prog_bar_clicked(self, widget):

# Disco LEDs
def disco_leds_clicked(self, widget):
print("Running disco, press Enter any time to stop ->")
print("Running disco, press Enter any time to stop -> ")
# Turn off all the LEDs before proceeding
for i in range(1, 6):
self.disable_individual_led(i)
Expand Down

0 comments on commit 662c7fd

Please sign in to comment.