more screens for qtile
This commit is contained in:
parent
34e2ffe43b
commit
564e5da7d8
3 changed files with 118 additions and 34 deletions
|
|
@ -11,6 +11,8 @@ from libqtile.lazy import lazy
|
||||||
from libqtile.utils import guess_terminal
|
from libqtile.utils import guess_terminal
|
||||||
from typing import List # noqa: F401from typing import List # noqa: F401
|
from typing import List # noqa: F401from typing import List # noqa: F401
|
||||||
|
|
||||||
|
from qutils import get_num_screens
|
||||||
|
|
||||||
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
||||||
myTerm = "alacritty" # My terminal of choice
|
myTerm = "alacritty" # My terminal of choice
|
||||||
myBrowser = "qutebrowser" # My browser of choice
|
myBrowser = "qutebrowser" # My browser of choice
|
||||||
|
|
@ -33,8 +35,8 @@ class Colors:
|
||||||
keys = [
|
keys = [
|
||||||
### The essentials
|
### The essentials
|
||||||
Key([mod], "Return", lazy.spawn(myTerm), desc='Launches My Terminal'),
|
Key([mod], "Return", lazy.spawn(myTerm), desc='Launches My Terminal'),
|
||||||
# Key([mod, "shift"], "Return", lazy.spawn("dm-run"), desc='Run Launcher'),
|
Key([mod, "shift"], "Return", lazy.spawn("rofi -show run"), desc='Run Launcher'),
|
||||||
Key([mod, "shift"], "Return", lazy.spawn("ulauncher"), desc='Run Launcher'),
|
# Key([mod, "shift"], "Return", lazy.spawn("ulauncher"), desc='Run Launcher'),
|
||||||
# Key([mod, "shift"], "Return", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
|
# Key([mod, "shift"], "Return", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
|
||||||
Key([mod], "b", lazy.spawn(myBrowser),desc='Qutebrowser'),
|
Key([mod], "b", lazy.spawn(myBrowser),desc='Qutebrowser'),
|
||||||
# Key([mod], "/", lazy.spawn("dtos-help"), desc='DTOS Help'),
|
# Key([mod], "/", lazy.spawn("dtos-help"), desc='DTOS Help'),
|
||||||
|
|
@ -235,16 +237,23 @@ def init_widgets_list():
|
||||||
background = Colors.bg,
|
background = Colors.bg,
|
||||||
foreground = Colors.yellow,
|
foreground = Colors.yellow,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.Battery(
|
||||||
text = u"\uf8c7",
|
battery = 0,
|
||||||
foreground = Colors.bg,
|
fmt = ' {}',
|
||||||
|
charge_char = u'\uf583',
|
||||||
|
discharge_char = u'\uf57d',
|
||||||
|
empty_char = u'\uf582',
|
||||||
|
full_char = u'\uf578',
|
||||||
|
unknown_char = u'\uf590',
|
||||||
|
format = '{char} {percent:2.0%} {hour:d}:{min:02d}',
|
||||||
background = Colors.yellow,
|
background = Colors.yellow,
|
||||||
fontsize = 14
|
foreground = Colors.bg,
|
||||||
),
|
),
|
||||||
# widget.Battery(
|
# widget.Battery(
|
||||||
# battery = 0,
|
# battery = 1,
|
||||||
# fmt = ' {}',
|
# fmt = ' {}',
|
||||||
# charge_char = u'\uf583',
|
# charge_char = u'\uf583',
|
||||||
# discharge_char = u'\uf57d',
|
# discharge_char = u'\uf57d',
|
||||||
|
|
@ -255,31 +264,20 @@ def init_widgets_list():
|
||||||
# background = Colors.yellow,
|
# background = Colors.yellow,
|
||||||
# foreground = Colors.bg,
|
# foreground = Colors.bg,
|
||||||
# ),
|
# ),
|
||||||
# widget.Battery(
|
# widget.Net(
|
||||||
# battery = 0,
|
# interface = "enp0s31f6",
|
||||||
# fmt = ' {}',
|
# format = '{down} ↓↑ {up}',
|
||||||
# charge_char = u'\uf583',
|
# prefix='M',
|
||||||
# discharge_char = u'\uf57d',
|
|
||||||
# empty_char = u'\uf582',
|
|
||||||
# full_char = u'\uf578',
|
|
||||||
# unknown_char = u'\uf590',
|
|
||||||
# format = '{char} {percent:2.0%} {hour:d}:{min:02d}',
|
|
||||||
# background = Colors.yellow,
|
|
||||||
# foreground = Colors.bg,
|
# foreground = Colors.bg,
|
||||||
|
# background = Colors.yellow,
|
||||||
# ),
|
# ),
|
||||||
widget.Net(
|
|
||||||
interface = "enp0s31f6",
|
|
||||||
format = '{down} ↓↑ {up}',
|
|
||||||
prefix='M',
|
|
||||||
foreground = Colors.bg,
|
|
||||||
background = Colors.yellow,
|
|
||||||
),
|
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u'\ue0be',
|
text = u'\ue0be',
|
||||||
background = Colors.yellow,
|
background = Colors.yellow,
|
||||||
foreground = Colors.orange,
|
foreground = Colors.orange,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u"\uf8c7",
|
text = u"\uf8c7",
|
||||||
|
|
@ -298,7 +296,8 @@ def init_widgets_list():
|
||||||
background = Colors.orange,
|
background = Colors.orange,
|
||||||
foreground = Colors.red,
|
foreground = Colors.red,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u"\uf546",
|
text = u"\uf546",
|
||||||
|
|
@ -321,7 +320,8 @@ def init_widgets_list():
|
||||||
background = Colors.red,
|
background = Colors.red,
|
||||||
foreground = Colors.purple,
|
foreground = Colors.purple,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u"\uf85a",
|
text = u"\uf85a",
|
||||||
|
|
@ -341,7 +341,8 @@ def init_widgets_list():
|
||||||
background = Colors.purple,
|
background = Colors.purple,
|
||||||
foreground = Colors.blue,
|
foreground = Colors.blue,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u"\ufb19",
|
text = u"\ufb19",
|
||||||
|
|
@ -360,7 +361,8 @@ def init_widgets_list():
|
||||||
background = Colors.blue,
|
background = Colors.blue,
|
||||||
foreground = Colors.aqua,
|
foreground = Colors.aqua,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = u"\uf026",
|
text = u"\uf026",
|
||||||
|
|
@ -378,7 +380,8 @@ def init_widgets_list():
|
||||||
background = Colors.aqua,
|
background = Colors.aqua,
|
||||||
foreground = Colors.green,
|
foreground = Colors.green,
|
||||||
padding = 0,
|
padding = 0,
|
||||||
fontsize = 26
|
fontsize = 26,
|
||||||
|
width = 24
|
||||||
),
|
),
|
||||||
widget.Clock(
|
widget.Clock(
|
||||||
foreground = Colors.bg,
|
foreground = Colors.bg,
|
||||||
|
|
@ -400,11 +403,20 @@ def init_widgets_screen2():
|
||||||
return widgets_screen2 # Monitor 2 will display all widgets in widgets_list
|
return widgets_screen2 # Monitor 2 will display all widgets in widgets_list
|
||||||
|
|
||||||
def init_screens():
|
def init_screens():
|
||||||
return [
|
num_screens = get_num_screens()
|
||||||
|
if num_screens >= 1:
|
||||||
|
return [Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20))]
|
||||||
|
elif num_screens == 2:
|
||||||
|
return [
|
||||||
Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20)),
|
Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20)),
|
||||||
Screen(top=bar.Bar(widgets=init_widgets_screen2(), opacity=1.0, size=20)),
|
Screen(top=bar.Bar(widgets=init_widgets_screen2(), opacity=1.0, size=20)),
|
||||||
# Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20))
|
]
|
||||||
]
|
else:
|
||||||
|
return [
|
||||||
|
Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20)),
|
||||||
|
Screen(top=bar.Bar(widgets=init_widgets_screen2(), opacity=1.0, size=20)),
|
||||||
|
Screen(top=bar.Bar(widgets=init_widgets_screen1(), opacity=1.0, size=20)),
|
||||||
|
]
|
||||||
|
|
||||||
if __name__ in ["config", "__main__"]:
|
if __name__ in ["config", "__main__"]:
|
||||||
screens = init_screens()
|
screens = init_screens()
|
||||||
|
|
|
||||||
41
dot_config/qtile/qutils.py
Normal file
41
dot_config/qtile/qutils.py
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
def get_num_screens():
|
||||||
|
from Xlib import display as xdisplay
|
||||||
|
|
||||||
|
num_monitors = 0
|
||||||
|
try:
|
||||||
|
display = xdisplay.Display()
|
||||||
|
screen = display.screen()
|
||||||
|
resources = screen.root.xrandr_get_screen_resources()
|
||||||
|
|
||||||
|
for output in resources.outputs:
|
||||||
|
monitor = display.xrandr_get_output_info(output, resources.config_timestamp)
|
||||||
|
preferred = False
|
||||||
|
if hasattr(monitor, "preferred"):
|
||||||
|
preferred = monitor.preferred
|
||||||
|
elif hasattr(monitor, "num_preferred"):
|
||||||
|
preferred = monitor.num_preferred
|
||||||
|
if preferred:
|
||||||
|
num_monitors += 1
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return num_monitors
|
||||||
|
|
||||||
|
class Colors:
|
||||||
|
bg = ["#282828", "#3c3836"] #background
|
||||||
|
fg = ["#ebdbb2", "#fbf1c7"] #foreground
|
||||||
|
red = ["#cc241d", "#fb4934"]
|
||||||
|
green = ["#98971a", "#b8bb26"]
|
||||||
|
yellow = ["#d79921", "#fabd2f"]
|
||||||
|
blue = ["#458588", "#83a598"]
|
||||||
|
purple = ["#b16286", "#d3869b"]
|
||||||
|
aqua = ["#689d6a", "#8ec07c"]
|
||||||
|
orange = ["#d65d0e", "#fe8019"]
|
||||||
|
gray = ["#928374", "#a89984"]
|
||||||
|
grey = gray
|
||||||
|
def _init_(self ):
|
||||||
|
pass
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("Number of Screens: {}".format(get_num_screens()))
|
||||||
31
dot_profile
Normal file
31
dot_profile
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# ~/.profile: executed by the command interpreter for login shells.
|
||||||
|
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
||||||
|
# exists.
|
||||||
|
# see /usr/share/doc/bash/examples/startup-files for examples.
|
||||||
|
# the files are located in the bash-doc package.
|
||||||
|
|
||||||
|
# the default umask is set in /etc/profile; for setting the umask
|
||||||
|
# for ssh logins, install and configure the libpam-umask package.
|
||||||
|
#umask 022
|
||||||
|
|
||||||
|
# if running bash
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/bin" ] ; then
|
||||||
|
PATH="$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/.local/bin" ] ; then
|
||||||
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
|
fi
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
|
||||||
|
export EDITOR='hx'
|
||||||
|
export VISUAL='hx'
|
||||||
Loading…
Add table
Reference in a new issue