UPDATE
This commit is contained in:
parent
3e28390476
commit
cf1f74c0bd
6 changed files with 91 additions and 51 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
theme = "gruvbox"
|
theme = "gruvbox"
|
||||||
|
|
||||||
[editor]
|
[editor]
|
||||||
|
cursorline = true
|
||||||
[editor.cursor-shape]
|
[editor.cursor-shape]
|
||||||
insert = "bar"
|
insert = "bar"
|
||||||
normal = "block"
|
normal = "block"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ from qtile_extras import widget
|
||||||
from qtile_extras.widget import UPowerWidget
|
from qtile_extras.widget import UPowerWidget
|
||||||
from qtile_extras.widget.decorations import PowerLineDecoration
|
from qtile_extras.widget.decorations import PowerLineDecoration
|
||||||
|
|
||||||
|
|
||||||
from qutils import get_num_screens, get_network_interface, get_batteries, Colors
|
from qutils import get_num_screens, get_network_interface, get_batteries, Colors
|
||||||
|
|
||||||
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
||||||
|
|
@ -27,17 +26,24 @@ update_distro_key = "Ubuntu"
|
||||||
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("rofi -show run"), desc='Run Launcher'),
|
Key([mod], "space", lazy.spawn("rofi -show run"), desc='Run Launcher'),
|
||||||
Key([mod], "b", lazy.spawn(myBrowser), desc='Qutebrowser'),
|
Key([mod], "b", lazy.spawn(myBrowser), desc='Qutebrowser'),
|
||||||
Key([mod], "l", lazy.spawn("cinnamon-screensaver-command -a"), desc='Qutebrowser'),
|
Key([mod], "l", lazy.spawn("cinnamon-screensaver-command -a"), desc='Qutebrowser'),
|
||||||
Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'),
|
Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'),
|
||||||
Key([mod, "shift"], "c", lazy.window.kill(), desc='Kill active window'),
|
Key([mod, "shift"], "c", lazy.window.kill(), desc='Kill active window'),
|
||||||
Key([mod, "shift"], "r", lazy.restart(), desc='Restart Qtile'),
|
Key([mod, "shift"], "r", lazy.restart(), desc='Restart Qtile'),
|
||||||
Key([mod, "shift"], "q", lazy.shutdown(), desc='Shutdown Qtile'),
|
Key([mod, "shift"], "q", lazy.shutdown(), desc='Shutdown Qtile'),
|
||||||
|
Key([mod, "shift"], "p", lazy.spawn("""rofi -show p -modi p:'rofi-power-menu \\
|
||||||
|
--symbols-font \"Symbols Nerd Font Mono\" \\
|
||||||
|
--choices=shutdown/reboot/suspend/logout' \\
|
||||||
|
-theme-str 'window {width: 12em;} listview {lines: 4;}'"""),
|
||||||
|
desc='Run Shutdown Menu'),
|
||||||
|
|
||||||
|
Key([mod], "period", lazy.spawn("rofimoji"), desc='Emoji Picker'),
|
||||||
|
|
||||||
# ## Switch focus of monitors
|
# ## Switch focus of monitors
|
||||||
Key([mod], "period", lazy.next_screen(), desc='Move focus to next monitor'),
|
Key([mod, "control"], "Right", lazy.next_screen(), desc='Move focus to next monitor'),
|
||||||
Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'),
|
Key([mod, "control"], "Left", lazy.prev_screen(), desc='Move focus to prev monitor'),
|
||||||
# ## Window controls
|
# ## Window controls
|
||||||
Key([mod], "Up", lazy.layout.up(), desc='Move focus up'),
|
Key([mod], "Up", lazy.layout.up(), desc='Move focus up'),
|
||||||
Key([mod], "Down", lazy.layout.down(), desc='Move focus down'),
|
Key([mod], "Down", lazy.layout.down(), desc='Move focus down'),
|
||||||
|
|
@ -46,7 +52,7 @@ keys = [
|
||||||
|
|
||||||
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), lazy.layout.section_up(),
|
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), lazy.layout.section_up(),
|
||||||
desc='Move windows up in current stack'),
|
desc='Move windows up in current stack'),
|
||||||
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), lazy.layout.section_down(),
|
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), lazy.layout.section_down(),
|
||||||
desc='Move windows down in current stack'),
|
desc='Move windows down in current stack'),
|
||||||
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc='Move windows left'),
|
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc='Move windows left'),
|
||||||
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc='Move windows right'),
|
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc='Move windows right'),
|
||||||
|
|
@ -57,10 +63,10 @@ keys = [
|
||||||
desc='Expand window (MonadTall), increase number in master pane (Tile)'),
|
desc='Expand window (MonadTall), increase number in master pane (Tile)'),
|
||||||
# Grow windows. If current window is on the edge of screen and direction
|
# Grow windows. If current window is on the edge of screen and direction
|
||||||
# will be to screen edge - window would shrink.
|
# will be to screen edge - window would shrink.
|
||||||
Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
|
# Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
|
||||||
Key([mod, "control"], "Down", lazy.layout.grow_down(), desc="Grow window down"),
|
# Key([mod, "control"], "Down", lazy.layout.grow_down(), desc="Grow window down"),
|
||||||
Key([mod, "control"], "Left", lazy.layout.grow_left(), desc="Grow window to the left"),
|
# Key([mod, "control"], "Left", lazy.layout.grow_left(), desc="Grow window to the left"),
|
||||||
Key([mod, "control"], "Right", lazy.layout.grow_right(), desc="Grow window to the right"),
|
# Key([mod, "control"], "Right", lazy.layout.grow_right(), desc="Grow window to the right"),
|
||||||
|
|
||||||
Key([mod], "n", lazy.layout.normalize(), desc='normalize window size ratios'),
|
Key([mod], "n", lazy.layout.normalize(), desc='normalize window size ratios'),
|
||||||
Key([mod], "m", lazy.layout.maximize(), desc='toggle window between minimum and maximum sizes'),
|
Key([mod], "m", lazy.layout.maximize(), desc='toggle window between minimum and maximum sizes'),
|
||||||
|
|
@ -68,21 +74,27 @@ keys = [
|
||||||
Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc='toggle floating'),
|
Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc='toggle floating'),
|
||||||
Key([mod], "f", lazy.window.toggle_fullscreen(), desc='toggle fullscreen'),
|
Key([mod], "f", lazy.window.toggle_fullscreen(), desc='toggle fullscreen'),
|
||||||
|
|
||||||
### Stack controls
|
# ## Stack controls
|
||||||
Key([mod, "shift"], "Tab", lazy.layout.rotate(), lazy.layout.flip(),
|
# Key([mod, "shift"], "Tab", lazy.layout.rotate(), lazy.layout.flip(),
|
||||||
desc='Switch which side main pane occupies (XmonadTall)'),
|
# desc='Switch which side main pane occupies (XmonadTall)'),
|
||||||
Key([mod], "space", lazy.layout.next(), desc='Switch window focus to other pane(s) of stack'),
|
# Key([mod], "space", lazy.layout.next(), desc='Switch window focus to other pane(s) of stack'),
|
||||||
Key([mod, "shift"], "space", lazy.layout.toggle_split(),
|
# Key([mod, "shift"], "space", lazy.layout.toggle_split(),
|
||||||
desc='Toggle between split and unsplit sides of stack'),
|
# desc='Toggle between split and unsplit sides of stack'),
|
||||||
]
|
]
|
||||||
|
|
||||||
groups = [Group("CHT", layout='max', matches=[Match(wm_class=('microsoft teams - preview'))]),
|
groups = [Group("CHT", matches=[Match(wm_class=('microsoft teams - preview'))]),
|
||||||
Group("WWW", layout='monadtall', matches=[Match(wm_class=['Firefox', 'firefox', 'firefox-bin', 'Chromium', 'Google-chrome', 'google-chrome'])]),
|
Group("WWW",
|
||||||
Group("DEV", layout='max'),
|
matches=[Match(wm_class=['Firefox',
|
||||||
Group("SYS", layout='monadtall'),
|
'firefox',
|
||||||
Group("REF", layout='monadtall'),
|
'firefox-bin',
|
||||||
Group("DOC", layout='monadtall', matches=[Match(wm_class=['obsidian'])]),
|
'Chromium',
|
||||||
Group("DMP", layout='monadtall')]
|
'Google-chrome',
|
||||||
|
'google-chrome'])]),
|
||||||
|
Group("DEV"),
|
||||||
|
Group("SYS"),
|
||||||
|
Group("REF"),
|
||||||
|
Group("DOC", matches=[Match(wm_class=['obsidian'])]),
|
||||||
|
Group("DMP")]
|
||||||
|
|
||||||
# Allow MODKEY+[0 through 9] to bind to groups, see https://docs.qtile.org/en/stable/manual/config/groups.html
|
# Allow MODKEY+[0 through 9] to bind to groups, see https://docs.qtile.org/en/stable/manual/config/groups.html
|
||||||
# MOD4 + index Number : Switch to Group[index]
|
# MOD4 + index Number : Switch to Group[index]
|
||||||
|
|
@ -108,14 +120,17 @@ keys.extend([
|
||||||
layout_theme = {"border_width": 2,
|
layout_theme = {"border_width": 2,
|
||||||
"margin": 8,
|
"margin": 8,
|
||||||
"border_focus": Colors.green,
|
"border_focus": Colors.green,
|
||||||
"border_normal": Colors.grey
|
"border_normal": Colors.grey,
|
||||||
|
"ratio": 0.6180469715698392,
|
||||||
|
"new_client_position": "bottom",
|
||||||
}
|
}
|
||||||
|
|
||||||
layouts = [
|
layouts = [
|
||||||
layout.MonadTall(**layout_theme),
|
layout.MonadTall(**layout_theme),
|
||||||
layout.MonadWide(**layout_theme),
|
layout.MonadWide(**layout_theme),
|
||||||
layout.Max(**layout_theme),
|
layout.Max(**layout_theme),
|
||||||
layout.RatioTile(**layout_theme),
|
# layout.MonadThreeCol(main_centered=False, **layout_theme),
|
||||||
|
# layout.RatioTile(**layout_theme),
|
||||||
# layout.TreeTab(
|
# layout.TreeTab(
|
||||||
# font = "Ubuntu",
|
# font = "Ubuntu",
|
||||||
# fontsize = 10,
|
# fontsize = 10,
|
||||||
|
|
@ -276,7 +291,7 @@ def init_widgets_list():
|
||||||
padding=5
|
padding=5
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
upw_kwargs = {
|
upw_kwargs = {
|
||||||
"background": Colors.yellow,
|
"background": Colors.yellow,
|
||||||
"foreground": Colors.bg,
|
"foreground": Colors.bg,
|
||||||
|
|
@ -287,16 +302,16 @@ def init_widgets_list():
|
||||||
"fill_critical": Colors.red,
|
"fill_critical": Colors.red,
|
||||||
"fill_low": Colors.red,
|
"fill_low": Colors.red,
|
||||||
"fill_normal": Colors.bg2,
|
"fill_normal": Colors.bg2,
|
||||||
|
|
||||||
"text_charging": '({percentage:.0f}%) {ttf}',
|
"text_charging": '({percentage:.0f}%) {ttf}',
|
||||||
"text_discharging": '({percentage:.0f}%) {tte}',
|
"text_discharging": '({percentage:.0f}%) {tte}',
|
||||||
|
|
||||||
"spacing": 10,
|
"spacing": 10,
|
||||||
}
|
}
|
||||||
upw_kwargs.update(powerline)
|
upw_kwargs.update(powerline)
|
||||||
|
|
||||||
widgets_list[8:8] = [UPowerWidget(battery_name=battery, **upw_kwargs) for battery in get_batteries()]
|
widgets_list[8:8] = [UPowerWidget(battery_name=battery, **upw_kwargs) for battery in get_batteries()]
|
||||||
|
|
||||||
return widgets_list
|
return widgets_list
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
picom --xrender-sync-fence & # option for nvidia driver to avoid error
|
picom --xrender-sync-fence & # option for nvidia driver to avoid error
|
||||||
volumeicon & # Systray volume Icon
|
volumeicon & # Systray Volume Icon
|
||||||
nm-applet & # Systray Network Icon
|
nm-applet & # Systray Network Icon
|
||||||
|
# nitrogen --restore & #wallpaper
|
||||||
nitrogen --restore & #wallpaper
|
# feh --no-fehbg --image-bg '#1A1421' --bg-max -z ~/Pictures/wallpapers/abstract/windy_desert/*
|
||||||
|
~/.fehbg
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def get_num_screens():
|
def get_num_screens():
|
||||||
from Xlib import display as xdisplay
|
from Xlib import display as xdisplay
|
||||||
|
|
||||||
num_monitors = 0
|
num_monitors = 0
|
||||||
try:
|
try:
|
||||||
display = xdisplay.Display()
|
display = xdisplay.Display()
|
||||||
screen = display.screen()
|
screen = display.screen()
|
||||||
resources = screen.root.xrandr_get_screen_resources()
|
resources = screen.root.xrandr_get_screen_resources()
|
||||||
|
|
||||||
for output in resources.outputs:
|
for output in resources.outputs:
|
||||||
monitor = display.xrandr_get_output_info(output, resources.config_timestamp)
|
monitor = display.xrandr_get_output_info(output, resources.config_timestamp)
|
||||||
preferred = False
|
preferred = False
|
||||||
|
|
@ -18,44 +19,55 @@ def get_num_screens():
|
||||||
preferred = monitor.num_preferred
|
preferred = monitor.num_preferred
|
||||||
if preferred:
|
if preferred:
|
||||||
num_monitors += 1
|
num_monitors += 1
|
||||||
except:
|
except Exception:
|
||||||
raise
|
raise
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return num_monitors
|
return num_monitors
|
||||||
|
|
||||||
|
|
||||||
|
def get_batteries():
|
||||||
|
try:
|
||||||
|
proc_upower = subprocess.Popen(['upower', '-e'], stdout=subprocess.PIPE)
|
||||||
|
proc_grep = subprocess.check_output(['grep', 'BAT'], stdin=proc_upower.stdout)
|
||||||
|
proc_upower.stdout.close()
|
||||||
|
txt = proc_grep.decode('utf-8')
|
||||||
|
return [line.split('_')[-1] for line in txt.splitlines(keepends=False)]
|
||||||
|
except Exception:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def get_network_interface():
|
def get_network_interface():
|
||||||
proc_ip = subprocess.Popen(['ip', 'route', 'get', '8.8.8.8'], stdout=subprocess.PIPE)
|
proc_ip = subprocess.Popen(['ip', 'route', 'get', '8.8.8.8'], stdout=subprocess.PIPE)
|
||||||
proc_awk = subprocess.check_output(['awk', '--', "{printf $5}"], stdin=proc_ip.stdout)
|
proc_awk = subprocess.check_output(['awk', '--', "{printf $5}"], stdin=proc_ip.stdout)
|
||||||
proc_ip.stdout.close()
|
proc_ip.stdout.close()
|
||||||
return proc_awk.decode('utf-8')
|
return proc_awk.decode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
class Colors:
|
class Colors:
|
||||||
bg = ["#282828", "#3c3836"] #background
|
bg = ["#282828", "#3c3836"] # background
|
||||||
bg1 = ["#3c3836", "#504945"]
|
bg1 = ["#3c3836", "#504945"]
|
||||||
bg2 = ["#504945", "#665c54"]
|
bg2 = ["#504945", "#665c54"]
|
||||||
bg3 = ["#665c54", "#7c6f64"]
|
bg3 = ["#665c54", "#7c6f64"]
|
||||||
|
|
||||||
fg = ["#ebdbb2", "#fbf1c7"] #foreground
|
fg = ["#ebdbb2", "#fbf1c7"] # foreground
|
||||||
fg1 = ["#d5c4a1", "#ebdbb2"]
|
fg1 = ["#d5c4a1", "#ebdbb2"]
|
||||||
fg2 = ["#bdae93", "#d5c4a1"]
|
fg2 = ["#bdae93", "#d5c4a1"]
|
||||||
fg3 = ["#a89984", "#bdae93"]
|
fg3 = ["#a89984", "#bdae93"]
|
||||||
|
|
||||||
red = ["#cc241d", "#fb4934"]
|
red = ["#cc241d", "#fb4934"]
|
||||||
green = ["#98971a", "#b8bb26"]
|
green = ["#98971a", "#b8bb26"]
|
||||||
yellow = ["#d79921", "#fabd2f"]
|
yellow = ["#d79921", "#fabd2f"]
|
||||||
blue = ["#458588", "#83a598"]
|
blue = ["#458588", "#83a598"]
|
||||||
purple = ["#b16286", "#d3869b"]
|
purple = ["#b16286", "#d3869b"]
|
||||||
aqua = ["#689d6a", "#8ec07c"]
|
aqua = ["#689d6a", "#8ec07c"]
|
||||||
orange = ["#d65d0e", "#fe8019"]
|
orange = ["#d65d0e", "#fe8019"]
|
||||||
gray = ["#928374", "#a89984"]
|
gray = ["#928374", "#a89984"]
|
||||||
grey = gray
|
grey = gray
|
||||||
|
|
||||||
def _init_(self ):
|
def _init_(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("Number of Screens: {}".format(get_num_screens()))
|
print("Number of Screens: {}".format(get_num_screens()))
|
||||||
|
|
|
||||||
|
|
@ -31,3 +31,8 @@ export EDITOR='hx'
|
||||||
export VISUAL='hx'
|
export VISUAL='hx'
|
||||||
|
|
||||||
setxkbmap eu
|
setxkbmap eu
|
||||||
|
if [ -d "/opt/pycharm/bin" ] ; then
|
||||||
|
PATH="/opt/pycharm/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias xcd='cd "$(xplr --print-pwd-as-result)"'
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ source $ZSH/oh-my-zsh.sh
|
||||||
# Example aliases
|
# Example aliases
|
||||||
# alias zshconfig="mate ~/.zshrc"
|
# alias zshconfig="mate ~/.zshrc"
|
||||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||||
|
alias checkupdates="aptitude search '~U'"
|
||||||
|
|
||||||
if [ "$TERM" = "linux" ]; then
|
if [ "$TERM" = "linux" ]; then
|
||||||
echo -en "\e]P01d2021" #black
|
echo -en "\e]P01d2021" #black
|
||||||
|
|
@ -120,3 +121,8 @@ if [ "$TERM" = "linux" ]; then
|
||||||
echo -en "\e]PFfbf1c7" #white
|
echo -en "\e]PFfbf1c7" #white
|
||||||
clear #for background artifacting
|
clear #for background artifacting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
tere() {
|
||||||
|
local result=$(command tere "$@")
|
||||||
|
[ -n "$result" ] && cd -- "$result"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue