Update configuration for new laptop, Fixes for new qtile internal api, PrintScreen button function, Compositor and Clipboard manager, Fix mouse actions

This commit is contained in:
Kevin Alberts 2019-08-20 22:33:07 +02:00
parent baece2297f
commit 95d2c26854
Signed by: Kurocon
GPG key ID: BCD496FEBA0C6BC1
10 changed files with 68 additions and 48 deletions

View file

@ -177,6 +177,9 @@ class Kuro(BaseTheme):
Key([], "XF86MonBrightnessUp", lazy.spawn(Config.get('cmd_brightness_up', 'xbacklight -inc 10'))),
Key([], "XF86MonBrightnessDown", lazy.spawn(Config.get('cmd_brightness_down', 'xbacklight -dec 10'))),
# Screenshot key
Key([], "Print", lazy.spawn(Config.get('cmd_screenshot', 'xfce4-screenshooter'))),
# Toggle between different layouts as defined below
Key([self.mod], "Tab", lazy.next_layout()),
@ -313,12 +316,12 @@ class Kuro(BaseTheme):
if Config.get('show_audio_visualizer', False):
widgets.append(kuro.utils.widgets.AudioVisualizerWidget(
graph_color=Config.get('visualizer_graph_color', "#ffffff"),
fill_color=Config.get('visualizer_fill_color', "#ffffff.3"),
fill_color=Config.get('visualizer_fill_color', "#ffffff"),
border_color=Config.get('visualizer_border_color', "#000000"),
border_width=Config.get('visualizer_graph_width', 0),
line_width=Config.get('visualizer_line_width', 1),
margin_x=1,
margin_y=1,
line_width=Config.get('visualizer_line_width', 0),
margin_x=0,
margin_y=0,
frequency=1
))
@ -392,11 +395,6 @@ class Kuro(BaseTheme):
update_delay=Config.get('battery_update_delay', 30)
),
kuro.utils.widgets.GPUStatusWidget(
theme_path=Config.get('gpu_theme_path', '/home/docs/checkouts/readthedocs.org/user_builds/qtile'
'/checkouts/latest/libqtile/resources/battery-icons'),
),
kuro.utils.widgets.WifiIconWidget(
interface=Config.get('wifi_interface', 'wlp4s0'),
theme_path=Config.get('wifi_theme_path', '/home/docs/checkouts/readthedocs.org/user_builds/qtile'
@ -542,13 +540,12 @@ class Kuro(BaseTheme):
@staticmethod
def update_screens(qtile):
out = utils.call_process(["xrandr", "--current"])
mode_out = utils.call_process(["optimus-manager", "--print-mode"])
if "nvidia" in mode_out:
video_mode = "nvidia"
elif "intel" in mode_out:
video_mode = "intel"
else:
video_mode = "unknown"
#mode_out = utils.call_process(["optimus-manager", "--print-mode"])
video_mode = "nvidia"
#if "nvidia" in mode_out:
# video_mode = "nvidia"
#elif "intel" in mode_out:
# video_mode = "intel"
laptop_screen = None
screens = []
for x in out.split("\n"):
@ -598,7 +595,7 @@ class Kuro(BaseTheme):
widget.update_graph()
def show_window_info(self, qtile):
window = qtile.currentWindow if qtile else None
window = qtile.current_window if qtile else None
import pprint
if window:
@ -615,7 +612,7 @@ class Kuro(BaseTheme):
# @staticmethod
def toggle_window_static(self, qtile):
window = qtile.currentWindow
window = qtile.current_window
if window in self.static_windows:
utils.notify("Unpinned {}".format(window.name), "{} has been unpinned".format(window.name))
self.static_windows.remove(window)
@ -636,7 +633,6 @@ class Kuro(BaseTheme):
p = utils.execute_once(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
p.wait()
else:
wallpaper = None
if os.path.isfile("/home/kevin/.cache/wal/colors.json"):
with open("/home/kevin/.cache/wal/colors.json", 'r') as f:
@ -650,8 +646,11 @@ class Kuro(BaseTheme):
p = utils.execute_once("nitrogen --restore")
p.wait()
# self.log_info("Starting compositor...")
# utils.execute_once("compton -b")
self.log_info("Starting compositor...")
utils.execute_once("compton -b")
self.log_info("Starting clipboard manager...")
utils.execute_once("xfce4-clipman")
# Update color scheme
self.initialize_colorscheme()
@ -724,14 +723,14 @@ class Kuro(BaseTheme):
if not placed and isinstance(widget, kuro.utils.widgets.AudioVisualizerWidget):
if widget.client is None:
viz_info = widget.info()
pos_x = viz_info['offset'] + widget.margin_x - 1
pos_y = 0 + widget.margin_y - 1
width = viz_info['width'] - (2 * (widget.margin_x - 1))
height = viz_info['height'] - (2 * (widget.margin_y - 1))
pos_x = viz_info['offset'] + widget.margin_x
pos_y = 0 + widget.margin_y
width = viz_info['width'] - (2 * widget.margin_x)
height = viz_info['height'] - (2 * widget.margin_y)
screen_index = self.qtile.screens.index(screen)
logger.warning("Attaching {} {} to {} on screen {}".format(client, client.window.wid, type(widget).__name__, screen_index))
c = KuroStatic.create(client, screen, x=pos_x, y=pos_y, width=width, height=height)
c.setOpacity(Config.get("bar_opacity", 1.0))
c.set_opacity(Config.get("bar_opacity", 1.0))
widget.set_client(c, screen)
placed = True
if not placed:
@ -770,8 +769,8 @@ class Kuro(BaseTheme):
wallpaper_dir = Config.get("desktop_bg_folder", "")
try:
wallpapers = os.listdir(wallpaper_dir)
except os.error:
pass
except os.error as e:
logger.warning("Could not load wallpapers from directory: {}".format(e))
if wallpapers:
qtile.theme_instance.current_wallpaper = os.path.join(wallpaper_dir, random.choice(wallpapers))
@ -782,7 +781,8 @@ class Kuro(BaseTheme):
@staticmethod
def set_wallpaper(qtile, filename):
p = utils.execute_once("wal-nitrogen-noupdate {}".format(filename))
p = utils.execute_once("{} {}".format(Config.get('wallpaper_config_command', 'wal-nitrogen-noupdate'),
filename))
p.wait()
qtile.theme_instance.current_wallpaper = filename
Kuro.update_colorscheme(qtile)