Dev
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# ___ _____ ___ _ _____ ____ _ _
|
||||
# / _ \_ _|_ _| | | ____| / ___|| |_ __ _ _ __| |_
|
||||
# | | | || | | || | | _| \___ \| __/ _` | '__| __|
|
||||
# | |_| || | | || |___| |___ ___) | || (_| | | | |_
|
||||
# \__\_\|_| |___|_____|_____| |____/ \__\__,_|_| \__|
|
||||
#
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
# My screen resolution
|
||||
# xrandr --rate 120
|
||||
|
||||
# For Virtual Machine
|
||||
# xrandr --output Virtual-1 --mode 1920x1080
|
||||
|
||||
# Set keyboard mapping in config.py
|
||||
|
||||
# Load power manager
|
||||
xfce4-power-manager &
|
||||
|
||||
# Load notification service
|
||||
dunst &
|
||||
|
||||
# Load cliphist history
|
||||
wl-paste --watch cliphist store &
|
||||
|
||||
# Launch GTK
|
||||
~/dotfiles/gtk/gtk.sh
|
||||
|
||||
swww init
|
||||
|
||||
# Setup Wallpaper and update colors
|
||||
~/dotfiles/qtile/scripts/wayland/wallpaper.sh init &
|
||||
@@ -15,9 +15,7 @@
|
||||
# For Virtual Machine
|
||||
# xrandr --output Virtual-1 --mode 1920x1080
|
||||
|
||||
# Set keyboard mapping
|
||||
# setxkbmap de
|
||||
setxkbmap en
|
||||
# Set keyboard layout in config.py
|
||||
|
||||
# Load picom
|
||||
picom &
|
||||
@@ -29,7 +27,9 @@ xfce4-power-manager &
|
||||
dunst &
|
||||
|
||||
# Launch polybar
|
||||
~/dotfiles/polybar/launch.sh &
|
||||
~/dotfiles/qtile/scripts/x11/loadbar.sh
|
||||
|
||||
sleep 1
|
||||
|
||||
# Setup Wallpaper and update colors
|
||||
~/dotfiles/scripts/updatewal.sh &
|
||||
~/dotfiles/qtile/scripts/x11/wallpaper.sh init
|
||||
@@ -0,0 +1,3 @@
|
||||
# Setup global keyboard layout here
|
||||
|
||||
keyboard_layout = "de"
|
||||
+305
-114
@@ -24,25 +24,63 @@ from libqtile.widget import Spacer, Backlight
|
||||
from libqtile.widget.image import Image
|
||||
from libqtile.dgroups import simple_key_binder
|
||||
from pathlib import Path
|
||||
from libqtile.log_utils import logger
|
||||
from libqtile.backend.wayland import InputConfig
|
||||
|
||||
from qtile_extras import widget
|
||||
from qtile_extras.widget.decorations import RectDecoration
|
||||
from qtile_extras.widget.decorations import PowerLineDecoration
|
||||
from conf.keyboard import *
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Your configuration
|
||||
# --------------------------------------------------------
|
||||
|
||||
# Keyboard layout in conf/keyboard.py
|
||||
|
||||
# Show wlan status bar widget (set to False if wired network)
|
||||
# show_wlan = True
|
||||
show_wlan = False
|
||||
|
||||
# Show bluetooth status bar widget
|
||||
# show_bluetooth = True
|
||||
show_bluetooth = False
|
||||
|
||||
# --------------------------------------------------------
|
||||
# General Variables
|
||||
# --------------------------------------------------------
|
||||
|
||||
# Get home path
|
||||
home = str(Path.home())
|
||||
|
||||
# Get Core name: x11 or wayland
|
||||
core_name = qtile.core.name
|
||||
logger.warning("Using config.py with " + core_name)
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Define Status Bar
|
||||
# --------------------------------------------------------
|
||||
wm_bar = "polybar"
|
||||
# wm_bar = "qtile"
|
||||
if core_name == "x11":
|
||||
try:
|
||||
wm_bar = Path(home + "/.cache/.qtile_bar_x11.sh").read_text().replace("\n", "")
|
||||
except:
|
||||
wm_bar = "qtile"
|
||||
elif qtile.core.name == "wayland":
|
||||
wm_bar = "qtile"
|
||||
|
||||
logger.warning("Status bar: " + wm_bar)
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Check for Desktop/Laptop
|
||||
# --------------------------------------------------------
|
||||
|
||||
# 3 = Desktop
|
||||
platform = int(os.popen("cat /sys/class/dmi/id/chassis_type").read())
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Set default apps
|
||||
# --------------------------------------------------------
|
||||
|
||||
terminal = "alacritty"
|
||||
browser = "chromium"
|
||||
# browser = "brave"
|
||||
@@ -50,66 +88,122 @@ browser = "chromium"
|
||||
# --------------------------------------------------------
|
||||
# Keybindings
|
||||
# --------------------------------------------------------
|
||||
|
||||
mod = "mod4" # SUPER KEY
|
||||
|
||||
keys = [
|
||||
if core_name == "x11":
|
||||
logger.warning("Using keys with x11")
|
||||
keys = [
|
||||
|
||||
# Focus
|
||||
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
|
||||
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
|
||||
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
|
||||
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
|
||||
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
|
||||
# Focus
|
||||
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
|
||||
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
|
||||
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
|
||||
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
|
||||
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
|
||||
|
||||
# Move
|
||||
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
|
||||
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
|
||||
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
|
||||
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
|
||||
|
||||
# Swap
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
|
||||
Key([mod], "Print", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/screenshot.sh")),
|
||||
|
||||
# Size
|
||||
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
|
||||
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
|
||||
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
|
||||
|
||||
# Floating
|
||||
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
|
||||
|
||||
# Split
|
||||
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
|
||||
|
||||
# Toggle Layouts
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
|
||||
# Fullscreen
|
||||
Key([mod], "f", lazy.window.toggle_fullscreen()),
|
||||
|
||||
#System
|
||||
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
|
||||
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
|
||||
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/qtile/scripts/powermenu.sh"), desc="Open Powermenu"),
|
||||
Key([mod, "shift"], "s", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/barswitcher.sh"), desc="Switch Status Bar"),
|
||||
|
||||
# Move
|
||||
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
|
||||
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
|
||||
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
|
||||
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
|
||||
# Apps
|
||||
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
|
||||
Key([mod, "control"], "Return", lazy.spawn("rofi -show drun"), desc="Launch Rofi"),
|
||||
Key([mod], "b", lazy.spawn(browser), desc="Launch Browser"),
|
||||
Key([mod, "control"], "b", lazy.spawn(home + "/dotfiles/scripts/bravebookmarks.sh"), desc="Rofi Brave Bookmarks"),
|
||||
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/wallpaper.sh"), desc="Update Theme and Wallpaper"),
|
||||
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/wallpaper.sh select"), desc="Select Theme and Wallpaper"),
|
||||
|
||||
# Swap
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl -q s +20%")),
|
||||
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl -q s 20%-"))
|
||||
]
|
||||
elif qtile.core.name == "wayland":
|
||||
logger.warning("Using keys with wayland")
|
||||
|
||||
Key([mod], "Print", lazy.spawn(home + "/dotfiles/scripts/scrot.sh")),
|
||||
keys = [
|
||||
|
||||
# Size
|
||||
# Key([mod], "h", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall)'),
|
||||
# Key([mod], "l", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall)'),
|
||||
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
|
||||
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
|
||||
# Key([mod, "control"], "Down", lazy.layout.grow_down(), desc="Grow window down"),
|
||||
# Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
|
||||
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
|
||||
# Focus
|
||||
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
|
||||
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
|
||||
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
|
||||
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
|
||||
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
|
||||
|
||||
# Move
|
||||
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
|
||||
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
|
||||
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
|
||||
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
|
||||
|
||||
# Floating
|
||||
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
|
||||
|
||||
# Split
|
||||
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
|
||||
# Swap
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
|
||||
# Toggle Layouts
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
Key([mod], "Print", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/screenshot.sh")),
|
||||
|
||||
# Fullscreen
|
||||
Key([mod], "f", lazy.window.toggle_fullscreen()),
|
||||
# Size
|
||||
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
|
||||
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
|
||||
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
|
||||
|
||||
#System
|
||||
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
|
||||
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
|
||||
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/scripts/powermenu.sh"), desc="Open Powermenu"),
|
||||
|
||||
# Apps
|
||||
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
|
||||
Key([mod, "control"], "Return", lazy.spawn(home + "/dotfiles/scripts/applauncher.sh"), desc="Launch Rofi"),
|
||||
Key([mod], "b", lazy.spawn(browser), desc="Launch Browser"),
|
||||
Key([mod, "control"], "b", lazy.spawn(home + "/dotfiles/scripts/bravebookmarks.sh"), desc="Rofi Brave Bookmarks"),
|
||||
Key([mod], "v", lazy.spawn(home + "/dotfiles/scripts/looking-glass.sh"), desc="Start Looking Glass Client"),
|
||||
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/scripts/updatewal.sh"), desc="Update Theme and Wallpaper"),
|
||||
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/scripts/wallpaper.sh"), desc="Select Theme and Wallpaper"),
|
||||
Key([mod, "control"], "t", lazy.spawn(home + "/dotfiles/scripts/templates.sh"), desc="Select Tempate and copy to clipboard"),
|
||||
# Key([], 'F10', lazy.spawn("brave --app=https://chat.openai.com"), desc="Open ChatGPT")
|
||||
]
|
||||
# Floating
|
||||
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
|
||||
|
||||
# Split
|
||||
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
|
||||
|
||||
# Toggle Layouts
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
|
||||
# Fullscreen
|
||||
Key([mod], "f", lazy.window.toggle_fullscreen()),
|
||||
|
||||
#System
|
||||
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
|
||||
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
|
||||
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/qtile/scripts/powermenu.sh"), desc="Open Powermenu"),
|
||||
|
||||
# Apps
|
||||
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
|
||||
Key([mod, "control"], "Return", lazy.spawn("rofi -show drun"), desc="Launch Rofi"),
|
||||
Key([mod], "b", lazy.spawn(browser), desc="Launch Browser"),
|
||||
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/wallpaper.sh"), desc="Update Theme and Wallpaper"),
|
||||
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/wallpaper.sh select"), desc="Select Theme and Wallpaper"),
|
||||
|
||||
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl -q s +20%")),
|
||||
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl -q s 20%-"))
|
||||
]
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Groups
|
||||
@@ -149,16 +243,22 @@ keys.extend([
|
||||
|
||||
colors = os.path.expanduser('~/.cache/wal/colors.json')
|
||||
colordict = json.load(open(colors))
|
||||
ColorZ=(colordict['colors']['color0'])
|
||||
ColorA=(colordict['colors']['color1'])
|
||||
ColorB=(colordict['colors']['color2'])
|
||||
ColorC=(colordict['colors']['color3'])
|
||||
ColorD=(colordict['colors']['color4'])
|
||||
ColorE=(colordict['colors']['color5'])
|
||||
ColorF=(colordict['colors']['color6'])
|
||||
ColorG=(colordict['colors']['color7'])
|
||||
ColorH=(colordict['colors']['color8'])
|
||||
ColorI=(colordict['colors']['color9'])
|
||||
Color0=(colordict['colors']['color0'])
|
||||
Color1=(colordict['colors']['color1'])
|
||||
Color2=(colordict['colors']['color2'])
|
||||
Color3=(colordict['colors']['color3'])
|
||||
Color4=(colordict['colors']['color4'])
|
||||
Color5=(colordict['colors']['color5'])
|
||||
Color6=(colordict['colors']['color6'])
|
||||
Color7=(colordict['colors']['color7'])
|
||||
Color8=(colordict['colors']['color8'])
|
||||
Color9=(colordict['colors']['color9'])
|
||||
Color10=(colordict['colors']['color10'])
|
||||
Color11=(colordict['colors']['color11'])
|
||||
Color12=(colordict['colors']['color12'])
|
||||
Color13=(colordict['colors']['color13'])
|
||||
Color14=(colordict['colors']['color14'])
|
||||
Color15=(colordict['colors']['color15'])
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Setup Layout Theme
|
||||
@@ -167,7 +267,7 @@ ColorI=(colordict['colors']['color9'])
|
||||
layout_theme = {
|
||||
"border_width": 3,
|
||||
"margin": 15,
|
||||
"border_focus": ColorC,
|
||||
"border_focus": Color2,
|
||||
"border_normal": "FFFFFF",
|
||||
"single_border_width": 3
|
||||
}
|
||||
@@ -177,19 +277,10 @@ layout_theme = {
|
||||
# --------------------------------------------------------
|
||||
|
||||
layouts = [
|
||||
# layout.Columns(),
|
||||
layout.Max(**layout_theme),
|
||||
# Try more layouts by unleashing below layouts.
|
||||
# layout.Stack(num_stacks=2),
|
||||
# layout.Bsp(),
|
||||
# layout.Matrix(),
|
||||
layout.MonadTall(**layout_theme),
|
||||
layout.MonadWide(**layout_theme),
|
||||
layout.RatioTile(**layout_theme),
|
||||
# layout.Tile(),
|
||||
# layout.TreeTab(),
|
||||
# layout.VerticalTile(),
|
||||
# layout.Zoomy(),
|
||||
layout.Floating()
|
||||
]
|
||||
|
||||
@@ -204,12 +295,50 @@ widget_defaults = dict(
|
||||
)
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Decorations
|
||||
# https://qtile-extras.readthedocs.io/en/stable/manual/how_to/decorations.html
|
||||
# --------------------------------------------------------
|
||||
|
||||
decor_left = {
|
||||
"decorations": [
|
||||
PowerLineDecoration(
|
||||
path="arrow_left"
|
||||
# path="rounded_left"
|
||||
# path="forward_slash"
|
||||
# path="back_slash"
|
||||
)
|
||||
],
|
||||
}
|
||||
|
||||
decor_right = {
|
||||
"decorations": [
|
||||
PowerLineDecoration(
|
||||
path="arrow_right"
|
||||
# path="rounded_right"
|
||||
# path="forward_slash"
|
||||
# path="back_slash"
|
||||
)
|
||||
],
|
||||
}
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Widgets
|
||||
# --------------------------------------------------------
|
||||
|
||||
widget_list = [
|
||||
widget.TextBox(
|
||||
**decor_left,
|
||||
background=Color1+".4",
|
||||
text='Apps',
|
||||
foreground='ffffff',
|
||||
desc='',
|
||||
padding=10,
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("rofi -show drun")},
|
||||
),
|
||||
widget.GroupBox(
|
||||
**decor_left,
|
||||
background="#ffffff.7",
|
||||
highlight_method='block',
|
||||
highlight='ffffff',
|
||||
block_border='ffffff',
|
||||
@@ -221,82 +350,129 @@ widget_list = [
|
||||
active='ffffff'
|
||||
),
|
||||
widget.TextBox(
|
||||
text=' ',
|
||||
foreground=ColorC,
|
||||
),
|
||||
widget.WindowName(),
|
||||
widget.Systray(),
|
||||
widget.TextBox(
|
||||
text='',
|
||||
**decor_left,
|
||||
background="#ffffff.4",
|
||||
text=" ",
|
||||
foreground="000000.6",
|
||||
fontsize=18,
|
||||
foreground='ffffff',
|
||||
desc='Notes',
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(terminal + ' -e vim ' + home + '/notes.txt')},
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("chromium")},
|
||||
),
|
||||
widget.TextBox(
|
||||
text='|',
|
||||
foreground=ColorC,
|
||||
**decor_left,
|
||||
background="#ffffff.4",
|
||||
text=" ",
|
||||
foreground="000000.6",
|
||||
fontsize=18,
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("thunar")}
|
||||
),
|
||||
widget.Volume(
|
||||
fmt='Vol: {}',
|
||||
|
||||
widget.WindowName(
|
||||
**decor_left,
|
||||
max_chars=50,
|
||||
background=Color2+".4",
|
||||
width=400,
|
||||
padding=10
|
||||
),
|
||||
widget.Spacer(),
|
||||
widget.Spacer(
|
||||
length=30
|
||||
),
|
||||
widget.TextBox(
|
||||
text='|',
|
||||
foreground=ColorC,
|
||||
),
|
||||
**decor_right,
|
||||
background="#000000.3"
|
||||
),
|
||||
widget.Memory(
|
||||
**decor_right,
|
||||
background=Color10+".4",
|
||||
padding=10,
|
||||
measure_mem='G',
|
||||
format="{MemUsed:.0f}{mm} ({MemTotal:.0f}{mm})"
|
||||
),
|
||||
widget.Volume(
|
||||
**decor_right,
|
||||
background=Color12+".4",
|
||||
padding=10,
|
||||
fmt='Vol: {}',
|
||||
),
|
||||
widget.DF(
|
||||
**decor_right,
|
||||
padding=10,
|
||||
background=Color8+".4",
|
||||
visible_on_warn=False,
|
||||
format="{p} {uf}{m} ({r:.0f}%)"
|
||||
),
|
||||
widget.TextBox(
|
||||
text='|',
|
||||
foreground=ColorC,
|
||||
widget.Bluetooth(
|
||||
**decor_right,
|
||||
background=Color2+".4",
|
||||
padding=10,
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("blueman-manager")},
|
||||
),
|
||||
widget.Battery(),
|
||||
widget.TextBox(
|
||||
text='|',
|
||||
foreground=ColorC,
|
||||
widget.Wlan(
|
||||
**decor_right,
|
||||
background=Color2+".4",
|
||||
padding=10,
|
||||
format='{essid} {percent:2.0%}',
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("alacritty -e nmtui")},
|
||||
),
|
||||
widget.Clock(
|
||||
format="%Y-%m-%d %a %I:%M %p",
|
||||
**decor_right,
|
||||
background=Color4+".4",
|
||||
padding=10,
|
||||
format="%Y-%m-%d / %I:%M %p",
|
||||
),
|
||||
widget.TextBox(
|
||||
text='|',
|
||||
foreground=ColorC,
|
||||
),
|
||||
widget.QuickExit(
|
||||
default_text=" ",
|
||||
**decor_right,
|
||||
background=Color2+".4",
|
||||
padding=5,
|
||||
text="",
|
||||
fontsize=20,
|
||||
countdown_start=3,
|
||||
countdown_format="{}"
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(home + "/dotfiles/scripts/cliphist.sh")},
|
||||
),
|
||||
widget.TextBox(
|
||||
**decor_right,
|
||||
background=Color2+".4",
|
||||
padding=5,
|
||||
text=" ",
|
||||
fontsize=20,
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(home + "/dotfiles/qtile/scripts/powermenu.sh")},
|
||||
),
|
||||
]
|
||||
|
||||
if (platform == 3):
|
||||
del widget_list[10:12]
|
||||
# Hide Modules if not on laptop
|
||||
if (show_wlan == False):
|
||||
del widget_list[12:13]
|
||||
|
||||
if (show_bluetooth == False):
|
||||
del widget_list[11:12]
|
||||
|
||||
if (core_name == "x11"):
|
||||
del widget_list[12:13]
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Screens
|
||||
# --------------------------------------------------------
|
||||
|
||||
if (wm_bar == "polybar"):
|
||||
screens = [Screen(top=bar.Gap(size=28))]
|
||||
else:
|
||||
if (wm_bar == "qtile"):
|
||||
logger.warning("Loading qtile bar")
|
||||
screens = [
|
||||
Screen(
|
||||
top=bar.Bar(
|
||||
widget_list,
|
||||
24,
|
||||
widget_list,
|
||||
30,
|
||||
padding=20,
|
||||
opacity=0.7,
|
||||
border_width=[3, 0, 3, 0],
|
||||
margin=[0,0,0,0]
|
||||
border_width=[0, 0, 0, 0],
|
||||
margin=[0,0,0,0],
|
||||
background="#000000.3"
|
||||
),
|
||||
),
|
||||
]
|
||||
else:
|
||||
screens = [Screen(top=bar.Gap(size=28))]
|
||||
if (core_name == "x11"):
|
||||
screens = [Screen(top=bar.Gap(size=28))]
|
||||
else:
|
||||
screens = [Screen(top=bar.Gap(size=0))]
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Drag floating layouts
|
||||
@@ -314,7 +490,7 @@ mouse = [
|
||||
|
||||
floating_layout = layout.Floating(
|
||||
border_width=3,
|
||||
border_focus=ColorC,
|
||||
border_focus=Color2,
|
||||
border_normal="FFFFFF",
|
||||
float_rules=[
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
@@ -362,6 +538,15 @@ wl_input_rules = None
|
||||
|
||||
wmname = "QTILE"
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Set wayland properties
|
||||
# --------------------------------------------------------
|
||||
|
||||
# Keyboard layout
|
||||
wl_input_rules = {
|
||||
"type:keyboard": InputConfig(kb_layout=keyboard_layout),
|
||||
}
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Hooks
|
||||
# --------------------------------------------------------
|
||||
@@ -369,6 +554,12 @@ wmname = "QTILE"
|
||||
# HOOK startup
|
||||
@hook.subscribe.startup_once
|
||||
def autostart():
|
||||
home = os.path.expanduser('~/.config/qtile/autostart.sh')
|
||||
if qtile.core.name == "x11":
|
||||
autostartscript = "~/.config/qtile/autostart_x11.sh"
|
||||
subprocess.Popen(['setxkbmap',keyboard_layout])
|
||||
elif qtile.core.name == "wayland":
|
||||
autostartscript = "~/.config/qtile/autostart_wayland.sh"
|
||||
|
||||
home = os.path.expanduser(autostartscript)
|
||||
subprocess.Popen([home])
|
||||
|
||||
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# ____
|
||||
# | _ \ _____ _____ _ __ _ __ ___ ___ _ __ _ _
|
||||
# | |_) / _ \ \ /\ / / _ \ '__| '_ ` _ \ / _ \ '_ \| | | |
|
||||
# | __/ (_) \ V V / __/ | | | | | | | __/ | | | |_| |
|
||||
# |_| \___/ \_/\_/ \___|_| |_| |_| |_|\___|_| |_|\__,_|
|
||||
#
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
echo $XDG_SESSION_TYPE
|
||||
if [ $XDG_SESSION_TYPE == "wayland" ]; then
|
||||
lockapp=swaylock
|
||||
else
|
||||
lockapp=slock
|
||||
fi
|
||||
echo "Using $lockapp to lock the screen."
|
||||
|
||||
option1=" lock"
|
||||
option2=" logout"
|
||||
option3=" reboot"
|
||||
option4=" power off"
|
||||
|
||||
options="$option1\n"
|
||||
options="$options$option2\n"
|
||||
options="$options$option3\n$option4"
|
||||
|
||||
choice=$(echo -e "$options" | rofi -dmenu -config ~/dotfiles/rofi/config-power.rasi -i -no-show-icons -l 4 -width 30 -p "Powermenu")
|
||||
|
||||
case $choice in
|
||||
$option1)
|
||||
$lockapp ;;
|
||||
$option2)
|
||||
qtile cmd-obj -o cmd -f shutdown ;;
|
||||
$option3)
|
||||
systemctl reboot ;;
|
||||
$option4)
|
||||
systemctl poweroff ;;
|
||||
esac
|
||||
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# ____ _ _
|
||||
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
|
||||
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
|
||||
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
|
||||
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
|
||||
#
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
DIR="$HOME/Pictures/screenshots/"
|
||||
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
||||
|
||||
option2="Selected area"
|
||||
option3="Fullscreen (delay 3 sec)"
|
||||
|
||||
options="$option2\n$option3"
|
||||
|
||||
choice=$(echo -e "$options" | rofi -dmenu -config ~/dotfiles/rofi/config-screenshot.rasi -i -no-show-icons -l 2 -width 30 -p "Take Screenshot")
|
||||
|
||||
case $choice in
|
||||
$option2)
|
||||
grim -g "$(slurp)" - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Selected area"
|
||||
;;
|
||||
$option3)
|
||||
sleep 3
|
||||
grim - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Fullscreen"
|
||||
;;
|
||||
esac
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# _ _
|
||||
# __ ____ _| | |_ __ __ _ _ __ ___ _ __
|
||||
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
|
||||
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
|
||||
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
|
||||
# |_| |_|
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
case $1 in
|
||||
|
||||
# Load wallpaper from .cache of last session
|
||||
"init")
|
||||
if [ -f ~/.cache/current_wallpaper.jpg ]; then
|
||||
wal -q -i ~/.cache/current_wallpaper.jpg
|
||||
else
|
||||
wal -q -i ~/wallpaper/
|
||||
fi
|
||||
;;
|
||||
|
||||
# Select wallpaper with rofi
|
||||
"select")
|
||||
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi)
|
||||
if [ ! "$selected" ]; then
|
||||
echo "No wallpaper selected"
|
||||
exit
|
||||
fi
|
||||
wal -q -i ~/wallpaper/$selected
|
||||
;;
|
||||
|
||||
# Randomly select wallpaper
|
||||
*)
|
||||
wal -q -i ~/wallpaper/
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load current pywal color scheme
|
||||
# -----------------------------------------------------
|
||||
source "$HOME/.cache/wal/colors.sh"
|
||||
echo "Wallpaper: $wallpaper"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Copy selected wallpaper into .cache folder
|
||||
# -----------------------------------------------------
|
||||
cp $wallpaper ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# -----------------------------------------------------
|
||||
# get wallpaper iamge name
|
||||
# -----------------------------------------------------
|
||||
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set the new wallpaper
|
||||
# -----------------------------------------------------
|
||||
swww init
|
||||
|
||||
transition_type="wipe"
|
||||
# transition_type="outer"
|
||||
# transition_type="random"
|
||||
|
||||
swww img $wallpaper \
|
||||
--transition-bezier .43,1.19,1,.4 \
|
||||
--transition-fps=60 \
|
||||
--transition-type=$transition_type \
|
||||
--transition-duration=0.7 \
|
||||
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Send notification
|
||||
# -----------------------------------------------------
|
||||
notify-send "Colors and Wallpaper updated" "with image $newwall"
|
||||
|
||||
echo "DONE!"
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# _ _ _ _
|
||||
# | |__ __ _ _ __ _____ _(_) |_ ___| |__ ___ _ __
|
||||
# | '_ \ / _` | '__/ __\ \ /\ / / | __/ __| '_ \ / _ \ '__|
|
||||
# | |_) | (_| | | \__ \\ V V /| | || (__| | | | __/ |
|
||||
# |_.__/ \__,_|_| |___/ \_/\_/ |_|\__\___|_| |_|\___|_|
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load status bar information
|
||||
# -----------------------------------------------------
|
||||
bar=$(cat ~/.cache/.qtile_bar_x11.sh)
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Switch status bar information
|
||||
# -----------------------------------------------------
|
||||
if [ $bar == "qtile" ]; then
|
||||
echo "Change to Polybar"
|
||||
echo "polybar" > ~/.cache/.qtile_bar_x11.sh
|
||||
notify-send "Status Bar is changing..." "to Polybar"
|
||||
else
|
||||
echo "Change to Qtile Bar"
|
||||
echo "qtile" > ~/.cache/.qtile_bar_x11.sh
|
||||
notify-send "Status Bar is changing..." "to Qtile Status Bar"
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load status bar
|
||||
# -----------------------------------------------------
|
||||
~/dotfiles/qtile/scripts/x11/loadbar.sh
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
# _ _ _
|
||||
# | | ___ __ _ __| | |__ __ _ _ __
|
||||
# | |/ _ \ / _` |/ _` | '_ \ / _` | '__|
|
||||
# | | (_) | (_| | (_| | |_) | (_| | |
|
||||
# |_|\___/ \__,_|\__,_|_.__/ \__,_|_|
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Check if information about the bar exists in .cache
|
||||
# If not create it
|
||||
# -----------------------------------------------------
|
||||
if [ ! -f ~/.cache/.qtile_bar_x11.sh ]; then
|
||||
touch ~/.cache/.qtile_bar_x11.sh
|
||||
echo "qtile" > ~/.cache/.qtile_bar_x11.sh
|
||||
echo ".qtile_bar_x11.sh created"
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load status bar information
|
||||
# -----------------------------------------------------
|
||||
bar=$(cat ~/.cache/.qtile_bar_x11.sh)
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load status bar based on loaded information
|
||||
# -----------------------------------------------------
|
||||
if [ $bar == "qtile" ]; then
|
||||
killall polybar
|
||||
sleep 0.2
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
else
|
||||
killall polybar
|
||||
sleep 0.2
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
sleep 0.2
|
||||
source "$HOME/.cache/wal/colors.sh"
|
||||
~/dotfiles/polybar/launch.sh &
|
||||
sleep 0.2
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
fi
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# ____ _ _
|
||||
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
|
||||
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
|
||||
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
|
||||
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
|
||||
#
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
DIR="$HOME/Pictures/screenshots/"
|
||||
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
||||
|
||||
option1="Selected window (delay 3 sec)"
|
||||
option2="Selected area"
|
||||
option3="Fullscreen (delay 3 sec)"
|
||||
|
||||
options="$option2\n$option3\n$option1"
|
||||
|
||||
choice=$(echo -e "$options" | rofi -i -dmenu -config ~/dotfiles/rofi/config-screenshot.rasi -width 30 -l 3 -p "Take Screenshot")
|
||||
|
||||
case $choice in
|
||||
$option1)
|
||||
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f' -c -z -u
|
||||
notify-send "Screenshot created" "Mode: Selected window"
|
||||
;;
|
||||
$option2)
|
||||
scrot $DIR$NAME -s -e 'xclip -selection clipboard -t image/png -i $f'
|
||||
notify-send "Screenshot created" "Mode: Selected area"
|
||||
;;
|
||||
$option3)
|
||||
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f'
|
||||
notify-send "Screenshot created" "Mode: Fullscreen"
|
||||
;;
|
||||
esac
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
# ____ _ _____ _
|
||||
# / ___| |__ __ _ _ __ __ _ ___ |_ _| |__ ___ _ __ ___ ___
|
||||
# | | | '_ \ / _` | '_ \ / _` |/ _ \ | | | '_ \ / _ \ '_ ` _ \ / _ \
|
||||
# | |___| | | | (_| | | | | (_| | __/ | | | | | | __/ | | | | | __/
|
||||
# \____|_| |_|\__,_|_| |_|\__, |\___| |_| |_| |_|\___|_| |_| |_|\___|
|
||||
# |___/
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
case $1 in
|
||||
|
||||
# Load wallpaper from .cache of last session
|
||||
"init")
|
||||
if [ -f ~/.cache/current_wallpaper.jpg ]; then
|
||||
wal -q -i ~/.cache/current_wallpaper.jpg
|
||||
else
|
||||
wal -q -i ~/wallpaper/
|
||||
fi
|
||||
;;
|
||||
|
||||
# Select wallpaper with rofi
|
||||
"select")
|
||||
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi)
|
||||
if [ ! "$selected" ]; then
|
||||
echo "No wallpaper selected"
|
||||
exit
|
||||
fi
|
||||
wal -q -i ~/wallpaper/$selected
|
||||
;;
|
||||
|
||||
# Randomly select wallpaper
|
||||
*)
|
||||
wal -q -i ~/wallpaper/
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Reload qtile to color bar
|
||||
# -----------------------------------------------------
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Get new theme
|
||||
# -----------------------------------------------------
|
||||
source "$HOME/.cache/wal/colors.sh"
|
||||
echo "Wallpaper: $wallpaper"
|
||||
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Copy selected wallpaper into .cache folder
|
||||
# -----------------------------------------------------
|
||||
cp $wallpaper ~/.cache/current_wallpaper.jpg
|
||||
|
||||
sleep 1
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Send notification
|
||||
# -----------------------------------------------------
|
||||
notify-send "Colors and Wallpaper updated" "with image $newwall"
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user