From c60488a70caca3df618c1001f60fb863fd1c512c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 26 Sep 2024 12:37:59 +0100 Subject: fine tune qtile skel, more work needed...probably --- skel/.config/qtile/config.py | 38 ++++++++--------- skel/.config/qtile/scripts/autostart.sh | 76 ++++++++++++++++++++++++++++----- 2 files changed, 84 insertions(+), 30 deletions(-) diff --git a/skel/.config/qtile/config.py b/skel/.config/qtile/config.py index 5e209b8..dad3e4d 100644 --- a/skel/.config/qtile/config.py +++ b/skel/.config/qtile/config.py @@ -159,8 +159,8 @@ keys.extend([ # Define layouts and layout themes layout_theme = { "margin":5, - "border_width": 4, - "border_focus": colors[2], + "border_width": 2, + "border_focus": colors[9], "border_normal": backgroundColor } @@ -179,8 +179,8 @@ def launch_menu(): # Define Widgets widget_defaults = dict( - font="JetBrainsMono Nerd Font", - fontsize = 12, + font="Noto Sans", + fontsize = 14, padding = 2, background=backgroundColor ) @@ -188,15 +188,15 @@ widget_defaults = dict( def init_widgets_list(monitor_num): widgets_list = [ widget.GroupBox( - font="JetBrainsMono Nerd Font", - fontsize = 16, + font="Noto Sans", + fontsize = 14, margin_y = 2, margin_x = 4, padding_y = 6, padding_x = 6, borderwidth = 2, disable_drag = True, - active = colors[4], + active = colors[3], inactive = foregroundColor, hide_unused = False, rounded = False, @@ -215,11 +215,11 @@ def init_widgets_list(monitor_num): ), widget.TaskList( icon_size = 0, - font = "JetBrainsMono Nerd Font", + font = "Noto Sans", foreground = colors[10], - background = colors[2], + background = colors[9], borderwidth = 0, - border = colors[6], + border = colors[9], margin = 0, padding = 8, highlight_method = "block", @@ -231,29 +231,29 @@ def init_widgets_list(monitor_num): txt_maximized = "🗖 ", txt_minimized = "🗕 ", ), + widget.CurrentLayoutIcon(scale = 0.5, foreground = colors[9], background = colors[9]), widget.Sep(linewidth = 0, padding = 10), - widget.TextBox(text = " ", fontsize = 14, font = "JetBrainsMono Nerd Font", foreground = colors[7]), + widget.Systray(background = backgroundColor, icon_size = 20, padding = 5), + widget.Sep(linewidth = 0, padding = 10), + widget.TextBox(text = "CPU ", fontsize = 10, font = "Noto Sans", foreground = colors[7]), widget.CPU( - font = "JetBrainsMono Nerd Font", + font = "Noto Sans", update_interval = 1.0, - format = '{load_percent}%', + format = '{freq_current}Ghz / {load_percent}%', foreground = foregroundColor, padding = 5 ), widget.Sep(linewidth = 0, padding = 10), - widget.TextBox(text = "", fontsize = 14, font = "JetBrainsMono Nerd Font", foreground = colors[3]), + widget.TextBox(text = "RAM", fontsize = 10, font = "Noto Sans", foreground = colors[7]), widget.Memory( - font = "JetBrainsMonoNerdFont", + font = "Noto Sans", foreground = foregroundColor, format = '{MemUsed: .0f}{mm} /{MemTotal: .0f}{mm}', measure_mem='G', padding = 5, ), widget.Sep(linewidth = 0, padding = 10), - widget.TextBox(text = " ", fontsize = 14, font = "JetBrainsMono Nerd Font", foreground = colors[10]), - widget.Clock(format='%I:%M %p', font = "JetBrainsMono Nerd Font", padding = 10, foreground = foregroundColor), - widget.Systray(background = backgroundColor, icon_size = 20, padding = 4), - widget.CurrentLayoutIcon(scale = 0.5, foreground = colors[6], background = colors[6]), + widget.Clock(format='%I:%M %p', font = "Noto Sans", padding = 10, foreground = foregroundColor), ] return widgets_list diff --git a/skel/.config/qtile/scripts/autostart.sh b/skel/.config/qtile/scripts/autostart.sh index ba259ee..d522008 100755 --- a/skel/.config/qtile/scripts/autostart.sh +++ b/skel/.config/qtile/scripts/autostart.sh @@ -1,17 +1,71 @@ #!/bin/bash -function run { - if ! pgrep $1 ; - then - $@& - fi +set_wallpaper() { + if [[ "$(loginctl show-session "$XDG_SESSION_ID" -p Type --value)" != wayland ]]; then + if [[ -x /usr/bin/feh ]] ; then # x11 + /usr/bin/feh --bg-scale /usr/share/backgrounds/redcore-community/0.png & disown + fi + else + if [[ -x /usr/bin/swaybg ]] ; then # wayland + /usr/bin/swaybg --image /usr/share/backgrounds/redcore-community/0.png & disown + fi + fi } +start_polkit_agent() { + if [[ -x /usr/libexec/polkit-kde-authentication-agent-1 ]] ; then + pkill -f /usr/libexec/polkit-kde-authentication-agent-1 + /usr/libexec/polkit-kde-authentication-agent-1 & disown + elif [[ -x /usr/libexec/polkit-gnome-authentication-agent-1 ]] ; then + pkill -f /usr/libexec/polkit-gnome-authentication-agent-1 + /usr/libexec/polkit-gnome-authentication-agent-1 & disown + fi +} + +start_notification_daemon() { + if [[ -x /usr/bin/dunst ]] ; then + pkill -f dunst + /usr/bin/dunst & disown + fi +} + +start_compositor() { + if [[ "$(loginctl show-session "$XDG_SESSION_ID" -p Type --value)" != wayland ]]; then + if [[ -x /usr/bin/picom ]] ; then # x11 + pkill -f picom + /usr/bin/picom --vsync & disown + fi + fi +} + +start_nm-applet() { + if [[ -x /usr/bin/nm-applet ]] ; then + pkill -f nm-applet + /usr/bin/nm-applet & disown + fi +} + +start_pipewire() { + if [[ -x /usr/bin/gentoo-pipewire-launcher ]] ; then + /usr/bin/gentoo-pipewire-launcher restart + fi +} -dunst & +start_xdg-desktop-portal() { + if [[ -x /usr/libexec/xdg-desktop-portal-wlr ]] ; then + pkill -f xdg-desktop-portal-wlr + /usr/libexec/xdg-desktop-portal-wlr & disown + fi +} + +main() { + set_wallpaper + start_polkit_agent + start_notification_daemon + start_compositor + start_nm-applet + start_pipewire + start_xdg-desktop-portal +} -#starting utility applications at boot time -picom --vsync & -/usr/libexec/polkit-gnome-autentication-agent-1 & -#/usr/lib/xfce4/notifyd/xfce4-notifyd & -feh --bg-scale ~/.config/qtile/assets/redcore.png & +main -- cgit v1.2.3