Skip to content

Commit

Permalink
fix(qtile): redule ws and fix color conf
Browse files Browse the repository at this point in the history
  • Loading branch information
misumisumi committed Sep 28, 2024
1 parent 1814bf2 commit 6cda66b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 61 deletions.
40 changes: 22 additions & 18 deletions apps/user/full/wm/qtile/conf/my_modules/bar.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""widgets for qtile bar"""

import copy
from dataclasses import asdict, dataclass
from dataclasses import asdict
from pathlib import Path

# from libqtile import widget
Expand Down Expand Up @@ -47,10 +46,10 @@ def groupbox():
return [
widget.TextBox(padding=2, **only_one_group),
widget.GroupBox(
this_current_screen_border=ColorSet.cyan,
this_screen_border=ColorSet.blue,
other_current_screen_border=ColorSet.cyan,
other_screen_border=ColorSet.blue,
this_current_screen_border=ColorSet.accent,
this_screen_border=ColorSet.foreground,
other_current_screen_border=ColorSet.accent,
other_screen_border=ColorSet.foreground,
use_mouse_wheel=False,
highlight_method="line",
active=ColorSet.white,
Expand All @@ -75,7 +74,7 @@ def sysinfo():
format=" {load_percent:0=4.1f}%",
**fc,
foreground=ColorSet.background,
background=ColorSet.blue,
background=ColorSet.accent,
**left_corner,
),
widget.Memory(
Expand All @@ -90,7 +89,7 @@ def sysinfo():
visible_on_warn=False,
partition="/home",
foreground=ColorSet.background,
background=ColorSet.blue,
background=ColorSet.accent,
**fc,
**left_corner,
),
Expand All @@ -112,7 +111,7 @@ def sysctrl(is_tray=False):
fmt=" {}",
backlight_name=backlight[0],
foreground=ColorSet.background,
background=ColorSet.blue,
background=ColorSet.accent,
**fc,
**left_corner,
),
Expand All @@ -125,6 +124,14 @@ def sysctrl(is_tray=False):
volume_up_command=["pactl set-sink-volume @DEFAULT_SINK@ +5%"],
volume_down_command=["pactl set-sink-volume @DEFAULT_SINK@ -5%"],
**fc,
**left_corner,
),
widget.CurrentLayout(
max_chars=2,
foreground=ColorSet.background,
background=ColorSet.accent,
**fc,
**left_corner,
),
]
if is_tray:
Expand All @@ -142,7 +149,7 @@ def lifeinfo():
widget.Clock(
format="%y-%m-%d(%a) %H:%M:%S",
foreground=ColorSet.background,
background=ColorSet.blue,
background=ColorSet.accent,
**fc,
**left_corner,
),
Expand All @@ -160,7 +167,7 @@ def parse_text(text):
return [
widget.TextBox(padding=0, **only_one_group),
widget.TaskList(
border=ColorSet.blue,
border=ColorSet.accent,
markup_focused="<span foreground=" + f'"{ColorSet.background}"' + ">{}</span>",
theme_mode="fallback",
txt_floating="󱂬 ",
Expand Down Expand Up @@ -191,22 +198,19 @@ def make_bar(under_fhd: bool = False, is_tray: bool = False, pentablet: bool = F
top_widgets += spacer()
else:
top_widgets += groupbox()
top_widgets += spacer(length=10)
top_widgets += chord()
if under_fhd:
top_widgets += spacer()
else:
top_widgets += spacer(length=50)
top_widgets += spacer(length=10)
top_widgets += tasklist()
top_widgets += spacer(length=20)
top_widgets += lifeinfo()
top_widgets += spacer()

if under_fhd:
top_widgets += spacer()
top_widgets += spacer(length=10)
else:
if not under_fhd:
top_widgets += sysinfo()
top_widgets += spacer(length=20)
top_widgets += chord()
top_widgets += spacer(length=10)
top_widgets += sysctrl(is_tray)

Expand Down
18 changes: 5 additions & 13 deletions apps/user/full/wm/qtile/conf/my_modules/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from libqtile.config import DropDown, Group, Match, ScratchPad
from libqtile.log_utils import logger

from my_modules.layouts import layout1, layout2, layout3, layout4
from my_modules.layouts import layout1, layout2, layout3
from my_modules.utils import get_n_monitors
from my_modules.variables import GlobalConf

Expand All @@ -20,8 +20,6 @@

_rule_analyze = [
{"title": "WaveSurfer 1.8.8p5"},
{"wm_class": "thunar"},
{"wm_class": "nemo"},
]

_rule_full = [
Expand All @@ -45,21 +43,15 @@
{"wm_class": "element"},
{"wm_class": "ferdium"},
{"wm_class": "zoom"},
]

_rule_media = [
{"wm_class": "spotify"},
{"wm_class": "pavucontrol"},
{"wm_class": ".blueman-manager-wrapped"},
]

group_and_rule = {
"code": ("", (layout2, layout3), _rule_code),
"code": ("", (layout2,), _rule_code),
"browse": ("", (layout1,), _rule_browse),
"analyze": ("󰉕", (layout1,), _rule_analyze),
"full": ("󰓓", (layout4,), _rule_full),
"sns": ("󰡠", (layout1,), _rule_sns),
"media": ("󰓇", (layout2, layout3), _rule_media),
"full": ("󰓓", (layout3,), _rule_full),
"sns": ("", (layout1,), _rule_sns),
}


Expand Down Expand Up @@ -113,7 +105,7 @@ def compare(self, client: base.Window) -> bool:
return True


_pentablet = {"creation": ("󰂫", layout4)}
_pentablet = {"creation": ("󰂫", layout3)}

GROUP_PER_SCREEN = len(group_and_rule)

Expand Down
23 changes: 8 additions & 15 deletions apps/user/full/wm/qtile/conf/my_modules/layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,34 @@
from my_modules.variables import FontConfig, WindowConf

_settings = {
"border_focus": ColorSet.cyan,
"border_focus": ColorSet.accent,
"border_normal": ColorSet.background,
"border_width": WindowConf.border,
"margin": WindowConf.margin,
}

_floating_settings = {
"border_width": WindowConf.border,
"border_focus": ColorSet.cyan,
"border_focus": ColorSet.accent,
"border_normal": ColorSet.background,
}
# for default
layout1 = [
layout.Columns(
**_settings,
border_focus_stack=ColorSet.cyan,
border_focus_stack=ColorSet.accent,
border_normal_stack=ColorSet.background,
border_on_single=True,
fair=False,
num_columns=2,
insert_position=1,
margin_on_single=WindowConf.margin,
split=False,
wrap_focus_columns=False,
wrap_focus_row=False,
wrap_focus_stacks=False,
),
layout.Max(**_settings),
]
# For code
layout2 = [
Expand All @@ -46,19 +50,8 @@
layout.Max(**_settings),
]

layout3 = [
layout.MonadTall(
**_settings,
align=layout.MonadTall._left,
ratio=0.65,
new_client_position="bottom",
single_border_width=WindowConf.border,
single_margin=WindowConf.margin,
),
layout.Max(**_settings),
]
# For full
layout4 = [
layout3 = [
layout.Max(margin=0),
]

Expand Down
20 changes: 5 additions & 15 deletions apps/user/full/wm/qtile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,11 @@
];
configPackages = with pkgs; [ gnome-session ];
};
configFile =
(lib.mapAttrs' (
f: _:
lib.nameValuePair "qtile/${f}" {
enable = true;
source = ./conf/${f};
}
) (lib.filterAttrs (_: t: t == "regular") (builtins.readDir ./conf)))
// (lib.mapAttrs' (
f: _:
lib.nameValuePair "qtile/my_modules/${f}" {
enable = true;
source = ./conf/my_modules/${f};
}
) (lib.filterAttrs (_: t: t == "regular") (builtins.readDir ./conf/my_modules)));
configFile.qtile = {
source = ./conf;
target = "qtile";
recursive = true;
};
};

xsession = {
Expand Down

0 comments on commit 6cda66b

Please sign in to comment.