diff --git a/dot_config/helix/config.toml b/dot_config/helix/config.toml index d4828942..153e247a 100644 --- a/dot_config/helix/config.toml +++ b/dot_config/helix/config.toml @@ -1,6 +1,7 @@ theme = "gruvbox" [editor] +cursorline = true [editor.cursor-shape] insert = "bar" normal = "block" diff --git a/dot_config/qtile/config.py b/dot_config/qtile/config.py index ad354000..25a722d9 100644 --- a/dot_config/qtile/config.py +++ b/dot_config/qtile/config.py @@ -14,7 +14,6 @@ from qtile_extras import widget from qtile_extras.widget import UPowerWidget from qtile_extras.widget.decorations import PowerLineDecoration - from qutils import get_num_screens, get_network_interface, get_batteries, Colors mod = "mod4" # Sets mod key to SUPER/WINDOWS @@ -27,17 +26,24 @@ update_distro_key = "Ubuntu" keys = [ # ## The essentials 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], "l", lazy.spawn("cinnamon-screensaver-command -a"), desc='Qutebrowser'), Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'), Key([mod, "shift"], "c", lazy.window.kill(), desc='Kill active window'), Key([mod, "shift"], "r", lazy.restart(), desc='Restart 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 - Key([mod], "period", lazy.next_screen(), desc='Move focus to next monitor'), - Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'), + Key([mod, "control"], "Right", lazy.next_screen(), desc='Move focus to next monitor'), + Key([mod, "control"], "Left", lazy.prev_screen(), desc='Move focus to prev monitor'), # ## Window controls Key([mod], "Up", lazy.layout.up(), desc='Move focus up'), 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(), 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'), Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc='Move windows left'), 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)'), # Grow windows. If current window is on the edge of screen and direction # will be to screen edge - window would shrink. - 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"], "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"], "Up", lazy.layout.grow_up(), desc="Grow window up"), + # 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"], "Right", lazy.layout.grow_right(), desc="Grow window to the right"), 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'), @@ -68,21 +74,27 @@ keys = [ Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc='toggle floating'), Key([mod], "f", lazy.window.toggle_fullscreen(), desc='toggle fullscreen'), - ### Stack controls - Key([mod, "shift"], "Tab", lazy.layout.rotate(), lazy.layout.flip(), - 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, "shift"], "space", lazy.layout.toggle_split(), - desc='Toggle between split and unsplit sides of stack'), + # ## Stack controls + # Key([mod, "shift"], "Tab", lazy.layout.rotate(), lazy.layout.flip(), + # 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, "shift"], "space", lazy.layout.toggle_split(), + # desc='Toggle between split and unsplit sides of stack'), ] -groups = [Group("CHT", layout='max', 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("DEV", layout='max'), - Group("SYS", layout='monadtall'), - Group("REF", layout='monadtall'), - Group("DOC", layout='monadtall', matches=[Match(wm_class=['obsidian'])]), - Group("DMP", layout='monadtall')] +groups = [Group("CHT", matches=[Match(wm_class=('microsoft teams - preview'))]), + Group("WWW", + matches=[Match(wm_class=['Firefox', + 'firefox', + 'firefox-bin', + 'Chromium', + '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 # MOD4 + index Number : Switch to Group[index] @@ -108,14 +120,17 @@ keys.extend([ layout_theme = {"border_width": 2, "margin": 8, "border_focus": Colors.green, - "border_normal": Colors.grey + "border_normal": Colors.grey, + "ratio": 0.6180469715698392, + "new_client_position": "bottom", } layouts = [ layout.MonadTall(**layout_theme), layout.MonadWide(**layout_theme), layout.Max(**layout_theme), - layout.RatioTile(**layout_theme), + # layout.MonadThreeCol(main_centered=False, **layout_theme), + # layout.RatioTile(**layout_theme), # layout.TreeTab( # font = "Ubuntu", # fontsize = 10, @@ -276,7 +291,7 @@ def init_widgets_list(): padding=5 ), ] - + upw_kwargs = { "background": Colors.yellow, "foreground": Colors.bg, @@ -287,16 +302,16 @@ def init_widgets_list(): "fill_critical": Colors.red, "fill_low": Colors.red, "fill_normal": Colors.bg2, - + "text_charging": '({percentage:.0f}%) {ttf}', "text_discharging": '({percentage:.0f}%) {tte}', "spacing": 10, } upw_kwargs.update(powerline) - + widgets_list[8:8] = [UPowerWidget(battery_name=battery, **upw_kwargs) for battery in get_batteries()] - + return widgets_list diff --git a/dot_config/qtile/executable_up.sh b/dot_config/qtile/executable_up.sh index 09d9baf8..c5cff5fe 100644 --- a/dot_config/qtile/executable_up.sh +++ b/dot_config/qtile/executable_up.sh @@ -1,7 +1,8 @@ #!/bin/bash picom --xrender-sync-fence & # option for nvidia driver to avoid error -volumeicon & # Systray volume Icon +volumeicon & # Systray Volume Icon nm-applet & # Systray Network Icon - -nitrogen --restore & #wallpaper \ No newline at end of file +# nitrogen --restore & #wallpaper +# feh --no-fehbg --image-bg '#1A1421' --bg-max -z ~/Pictures/wallpapers/abstract/windy_desert/* +~/.fehbg \ No newline at end of file diff --git a/dot_config/qtile/qutils.py b/dot_config/qtile/qutils.py index 12ab5ca9..9e9de13a 100644 --- a/dot_config/qtile/qutils.py +++ b/dot_config/qtile/qutils.py @@ -1,14 +1,15 @@ import subprocess + def get_num_screens(): from Xlib import display as xdisplay - + num_monitors = 0 - try: + 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 @@ -18,44 +19,55 @@ def get_num_screens(): preferred = monitor.num_preferred if preferred: num_monitors += 1 - except: + except Exception: raise return 1 else: 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(): 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_ip.stdout.close() return proc_awk.decode('utf-8') - + class Colors: - bg = ["#282828", "#3c3836"] #background + bg = ["#282828", "#3c3836"] # background bg1 = ["#3c3836", "#504945"] bg2 = ["#504945", "#665c54"] bg3 = ["#665c54", "#7c6f64"] - - fg = ["#ebdbb2", "#fbf1c7"] #foreground + + fg = ["#ebdbb2", "#fbf1c7"] # foreground fg1 = ["#d5c4a1", "#ebdbb2"] fg2 = ["#bdae93", "#d5c4a1"] fg3 = ["#a89984", "#bdae93"] - - red = ["#cc241d", "#fb4934"] - green = ["#98971a", "#b8bb26"] - yellow = ["#d79921", "#fabd2f"] - blue = ["#458588", "#83a598"] - purple = ["#b16286", "#d3869b"] - aqua = ["#689d6a", "#8ec07c"] - orange = ["#d65d0e", "#fe8019"] + + 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 ): + + def _init_(self): pass if __name__ == "__main__": - print("Number of Screens: {}".format(get_num_screens())) \ No newline at end of file + print("Number of Screens: {}".format(get_num_screens())) diff --git a/dot_profile b/dot_profile index c4f233df..c880519b 100644 --- a/dot_profile +++ b/dot_profile @@ -31,3 +31,8 @@ export EDITOR='hx' export VISUAL='hx' setxkbmap eu +if [ -d "/opt/pycharm/bin" ] ; then + PATH="/opt/pycharm/bin:$PATH" +fi + +alias xcd='cd "$(xplr --print-pwd-as-result)"' diff --git a/dot_zshrc b/dot_zshrc index 12551f94..874ed7d3 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -100,6 +100,7 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" +alias checkupdates="aptitude search '~U'" if [ "$TERM" = "linux" ]; then echo -en "\e]P01d2021" #black @@ -120,3 +121,8 @@ if [ "$TERM" = "linux" ]; then echo -en "\e]PFfbf1c7" #white clear #for background artifacting fi + +tere() { + local result=$(command tere "$@") + [ -n "$result" ] && cd -- "$result" +}