Compare commits

...

8 Commits

14 changed files with 474 additions and 15 deletions

View File

@ -0,0 +1,20 @@
output HDMI-A-0
off
output DisplayPort-0
off
output DisplayPort-1
off
output eDP
crtc 0
mode 1920x1200
pos 0x0
primary
rate 120.00
x-prop-colorspace Default
x-prop-max_bpc 16
x-prop-non_desktop 0
x-prop-scaling_mode None
x-prop-tearfree auto
x-prop-underscan off
x-prop-underscan_hborder 0
x-prop-underscan_vborder 0

View File

@ -0,0 +1 @@
eDP 00ffffffffffff004d101e1500000000311e0104a51d127807de50a3544c99260f505400000001010101010101010101010101010101ed7b80a070b047403020360020b410000018f73d80a070b047403020360020b410000018000000fd003078999920010a202020202020000000fc004c513133344e314a5735320a20000a

View File

@ -0,0 +1,31 @@
output DisplayPort-0
off
output DisplayPort-1
off
output eDP
crtc 0
mode 1920x1200
pos 0x0
primary
rate 120.00
x-prop-colorspace Default
x-prop-max_bpc 16
x-prop-non_desktop 0
x-prop-scaling_mode None
x-prop-tearfree auto
x-prop-underscan off
x-prop-underscan_hborder 0
x-prop-underscan_vborder 0
output HDMI-A-0
crtc 1
mode 1920x1080
pos 1920x0
rate 60.00
x-prop-colorspace Default
x-prop-max_bpc 16
x-prop-non_desktop 0
x-prop-scaling_mode None
x-prop-tearfree auto
x-prop-underscan off
x-prop-underscan_hborder 0
x-prop-underscan_vborder 0

View File

@ -0,0 +1,2 @@
HDMI-A-0 00ffffffffffff0005e30122a28e0000291d010380301b782a7771a359539e260f5054bfef00d1c0b30095008180814081c001010101023a801871382d40582c4500dc0c1100001e000000ff004755574b414841303336353134000000fc0032324231570a20202020202020000000fd00324c1e5311000a20202020202001f802031ef14b101f051404130312021101230907078301000065030c0010008c0ad08a20e02d10103e9600dc0c11000018011d007251d01e206e285500dc0c1100001e8c0ad08a20e02d10103e9600dc0c110000188c0ad090204031200c405500dc0c110000180000000000000000000000000000000000000000000000000049
eDP 00ffffffffffff004d101e1500000000311e0104a51d127807de50a3544c99260f505400000001010101010101010101010101010101ed7b80a070b047403020360020b410000018f73d80a070b047403020360020b410000018000000fd003078999920010a202020202020000000fc004c513133344e314a5735320a20000a

4
.config/autorandr/postswitch Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/bash
/home/joe/.local/bin/qtile cmd-obj -o "cmd" -f "reload_config"
notify-send "Switched profile" -t 2000

View File

@ -345,6 +345,7 @@ Use Dashboard.el. First load `all-the-icons` for nicer rendering
(require 'olivetti)
(setq olivetti-minimum-body-width 100)
(global-set-key (kbd "C-x x o") 'olivetti-mode)
(add-hook 'prog-mode-hook 'olivetti-mode)
#+end_src
*** Themes
@ -919,10 +920,37 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
(define-key ctl-x-4-map (kbd "t") #'rotate-window)
(global-set-key (kbd "s-h") #'windmove-left)
(global-set-key (kbd "s-l") #'windmove-right)
(global-set-key (kbd "s-k") #'windmove-up)
(global-set-key (kbd "s-j") #'windmove-down)
(defun joe/qtile-move-dir (dir)
(start-process "qtile-dir" nil "qtile" "cmd-obj" "-o" "layout" "-f" dir))
(defun joe/windmove-left ()
(interactive)
(if (window-in-direction 'left)
(windmove-left)
(joe/qtile-move-dir "left")))
(defun joe/windmove-right ()
(interactive)
(if (window-in-direction 'right)
(windmove-right)
(joe/qtile-move-dir "right")))
(defun joe/windmove-up ()
(interactive)
(if (window-in-direction 'up)
(windmove-up)
(joe/qtile-move-dir "up")))
(defun joe/windmove-down ()
(interactive)
(if (window-in-direction 'down)
(windmove-down)
(joe/qtile-move-dir "down")))
(global-set-key (kbd "s-h") #'joe/windmove-left)
(global-set-key (kbd "s-l") #'joe/windmove-right)
(global-set-key (kbd "s-k") #'joe/windmove-up)
(global-set-key (kbd "s-j") #'joe/windmove-down)
;; There's a bug in Gnome where frames are resized to the wrong dimensions
(defun joe/resize-frames ()
@ -933,10 +961,10 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
(global-set-key (kbd "s-<f10>") #'joe/resize-frames)
#+end_src
**** COMMENT Unused for now
Ace Window will show a hint if there are more than 2 windows, but I don't really use it
#+begin_src emacs-lisp :tangle no
#+begin_src emacs-lisp
(require 'ace-window)
(global-set-key (kbd "C-x o") #'ace-window)
@ -944,7 +972,7 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
#+end_src
#+begin_src emacs-lisp :tangle no
#+begin_src emacs-lisp
;; TODO Prot help improving workflow
(global-set-key (kbd "C-`") #'window-toggle-side-windows)
@ -1960,7 +1988,8 @@ the right frame, I'm going to use the frame's name to close and remove the hook
;; (flymake-mode -1)
;; Disable it completely until we find out how the hell we can toggle it
(setq eglot-stay-out-of '(flymake))
(setq eglot-stay-out-of '())
;; (setq eglot-stay-out-of '())
(setq eldoc-echo-area-use-multiline-p nil)
(setq eldoc-idle-delay 0.15)
;; (setq eglot-stay-out-of '())
;; (add-hook 'eglot-managed-mode-hook (lambda () (flymake-mode -1)))
@ -2333,6 +2362,16 @@ and there's no need for a middle-man when it's already been implemented.
:dap-compilation "cargo build"
:dap-compilation-dir "${workspaceFolder}"))
#+end_src
*** GDB/GUD
#+begin_src emacs-lisp
(setq gdb-many-windows t)
(setq gud-tooltip-dereference t)
(defun hook-gud-mode ()
(define-key gud-global-map (kbd "C-c") #'gud-cont)
(define-key gud-global-map (kbd "C-r") #'gud-run))
(add-hook 'gud-mode-hook #'hook-gud-mode)
#+end_src
** org-mode
*** General
#+begin_src emacs-lisp
@ -2568,6 +2607,5 @@ over as explained [[https://manueluberti.eu/2018/02/17/magit-bury-buffer.html][h
* COMMENT Local variables
;; Local Variables:
;; eval: (olivetti-mode t)
;; eval: (add-hook 'after-save-hook '(lambda () (org-babel-tangle)) nil t)
;; End:

View File

@ -73,3 +73,5 @@ function fish_prompt --description 'Write out the prompt; do not replace this. I
printf "%b" (string join " \n" (vterm_old_fish_prompt))
vterm_prompt_end
end
fish_ssh_agent

View File

@ -6,6 +6,7 @@ SETUVAR --export LC_COLLATE:C
SETUVAR --export --path LD_LIBRARY_PATH:/usr/local/lib
SETUVAR --export PYTHONSTARTUP:/etc/python/pythonrc
SETUVAR --export RUSTUP_HOME:/home/joe/\x2elocal/share/rustup/
SETUVAR SSH_AUTH_SOCK:/run/user/1000/ssh\x2dagent\x2esocket
SETUVAR XDG_CACHE_HOME:/home/joe/\x2ecache
SETUVAR XDG_CONFIG_HOME:/home/joe/\x2econfig
SETUVAR XDG_DATA_HOME:/home/joe/\x2elocal/share
@ -40,4 +41,4 @@ SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
SETUVAR fish_user_paths:/home/joe/\x2elocal/share/JetBrains/Toolbox/scripts\x1e/home/joe/\x2elocal/bin/elm\x1e/home/joe/\x2elocal/share/bin/cargo/bin\x1e\x1e/home/joe/\x2elocal/bin
SETUVAR --export fish_user_paths:/home/joe/\x2elocal/share/bin/cargo/bin\x1e/home/joe/\x2elocal/bin\x1e/home/joe/\x2enimble/bin

View File

@ -0,0 +1,32 @@
function __ssh_agent_is_started -d "check if ssh agent is already started"
if begin; test -f $SSH_ENV; and test -z "$SSH_AGENT_PID"; end
source $SSH_ENV > /dev/null
end
if test -z "$SSH_AGENT_PID"
return 1
end
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep -q ssh-agent
#pgrep ssh-agent
return $status
end
function __ssh_agent_start -d "start a new ssh agent"
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
chmod 600 $SSH_ENV
source $SSH_ENV > /dev/null
true # suppress errors from setenv, i.e. set -gx
end
function fish_ssh_agent --description "Start ssh-agent if not started yet, or uses already started ssh-agent."
if test -z "$SSH_ENV"
set -xg SSH_ENV $HOME/.ssh/environment
end
if not __ssh_agent_is_started
__ssh_agent_start
end
end

View File

@ -0,0 +1,3 @@
function vim --wraps=nvim --description 'alias vim nvim'
nvim $argv
end

View File

@ -8,7 +8,7 @@
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = true;
shadow = false;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
@ -70,9 +70,9 @@ shadow-exclude = [
#################################
fading = true; # Fade windows during opacity changes
fade-delta = 100; # The time between steps in a fade in milliseconds
fade-in-step = 1; # Opacity change between steps while fading in
fade-out-step = 1; # Opacity change between steps while fading out
fade-delta = 30; # The time between steps in a fade in milliseconds
fade-in-step = 1.0; # Opacity change between steps while fading in
fade-out-step = 1.0; # Opacity change between steps while fading out
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
# fading = false
@ -256,7 +256,7 @@ detect-client-opacity = true;
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0

3
.config/qtile/autostart.sh Executable file
View File

@ -0,0 +1,3 @@
#! /usr/bin/bash
xset r rate 270 60
picom -b

321
.config/qtile/config.py Normal file
View File

@ -0,0 +1,321 @@
# Copyright (c) 2010 Aldo Cortesi
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2012 Randall Ma
# Copyright (c) 2012-2014 Tycho Andersen
# Copyright (c) 2012 Craig Barnes
# Copyright (c) 2013 horsik
# Copyright (c) 2013 Tao Sauvage
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
import subprocess
import re
import random
from datetime import datetime
from Xlib import display as xdisplay
from typing import Callable
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
from libqtile.log_utils import logger
from libqtile import hook
@hook.subscribe.startup_once
def autostart():
home = os.path.expanduser('~/.config/qtile/autostart.sh')
subprocess.Popen([home])
mod = "mod4"
alt = "mod1"
terminal = "kitty"
kbd_lights = ["off", "low", "med", "high"]
current_kbd_light = [0]
def kbd_brightness_up(qtile):
idx = current_kbd_light[0]
current_kbd_light[0] = min(len(kbd_lights) - 1, idx+1)
value = kbd_lights[current_kbd_light[0]]
qtile.spawn(f"asusctl -k {value}")
def kbd_brightness_down(qtile):
idx = current_kbd_light[0]
current_kbd_light[0] = max(0, idx-1)
value = kbd_lights[current_kbd_light[0]]
qtile.spawn(f"asusctl -k {value}")
keys = [
# A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
# Switch between windows
# .when(wm_class != 'kitty')
# Key([mod], "h", lazy.function(move_focus, direction='left'), desc="Move focus to left"),
Key([mod], "h", lazy.layout.left().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "j", lazy.layout.down().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "k", lazy.layout.up().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([alt], "tab", lazy.layout.next(), desc="Move window focus to other window"),
Key([mod], "tab", lazy.screen.toggle_group(), desc="Toggle Group"),
Key([mod], "space", lazy.spawn("rofi -show drun"), desc="Open Rofi"),
# Move windows between left/right columns or move up/down in current stack.
# Moving out of range in Columns layout will create new column.
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
# Grow windows. If current window is on the edge of screen and direction
# will be to screen edge - window would shrink.
Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"),
Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"),
Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"),
Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
# Key([mod], "d", lazy.groups.use_previous_layout(), desc="Move focus to left"),
# Key([mod], "a", lazy.layout.use_next_layout(), desc="Move focus to left"),
# TODO: Figure out another binding for this
# Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Toggle between split and unsplit sides of stack.
# Split = all windows displayed
# Unsplit = 1 window displayed, like Max layout, but still with
# multiple stack panes
Key(
[mod, "shift"],
"Return",
lazy.layout.toggle_split(),
desc="Toggle between split and unsplit sides of stack",
),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
# Toggle between different layouts as defined below
Key([mod], "c", lazy.window.center(), desc="Center focused window"),
# Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key(
[mod],
"f",
lazy.window.toggle_fullscreen(),
desc="Toggle fullscreen on the focused window",
),
Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([], "XF86AudioLowerVolume", lazy.spawn("amixer sset Master 5%-")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer sset Master 5%+")),
Key([], "XF86Launch1", lazy.spawn("playerctl play-pause")),
Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-")),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%")),
# This uses discrete values
Key([], "XF86KbdBrightnessDown", lazy.function(kbd_brightness_down)),
Key([], "XF86KbdBrightnessUp", lazy.function(kbd_brightness_up)),
]
pape_dir = '/home/joe/Pictures/Wallpapers/'
papes = [os.path.join(pape_dir, p) for p in os.listdir(pape_dir)]
pape = random.choice(papes)
def get_num_monitors():
number_of_monitors = 0
try:
x_display = xdisplay.Display()
resources = x_display.screen().root.xrandr_get_screen_resources()
for output in resources.outputs:
monitor = x_display.xrandr_get_output_info(
output, resources.config_timestamp)
preferred = False
if hasattr(monitor, "preferred"):
preferred = monitor.preferred
elif hasattr(monitor, "num_preferred"):
preferred = monitor.num_preferred
if preferred:
number_of_monitors += 1
except Exception as e:
# always setup at least one monitor
logger.warning(e)
return 1
else:
return number_of_monitors
group_box = widget.GroupBox()
current_layout = widget.CurrentLayout()
prompt = widget.Prompt()
window_name = widget.WindowName()
window_name2 = widget.WindowName()
chord = widget.Chord(chords_colors={"launch": ("#ff0000", "#ffffff"),}, name_transform=lambda name: name.upper())
systray = widget.Systray()
battery = widget.Battery()
clock = widget.Clock(format="%Y-%m-%d %a %I:%M %p")
volume = widget.Volume()
screens = [
Screen(
wallpaper=pape,
wallpaper_mode='fill',
top=bar.Bar(
[
group_box, current_layout, prompt, window_name, chord,
systray, volume, battery, clock,
],
24,
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
),
),
]
groups = [Group(i) for i in "123456789"]
num_monitors = get_num_monitors()
logger.warning(num_monitors)
if num_monitors > 1:
side_screen = Screen(
wallpaper=pape,
wallpaper_mode='fill',
# bottom=bar.Bar(
# [
# # group_box, current_layout, prompt, window_name2, chord, volume, battery,
# ],
# 24,
# # border_width=[2, 0, 2, 0], # Draw top and bottom borders
# # border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
# ),
)
screens.insert(0, side_screen)
groups[0].screen_affinity = 0
for g in groups[1:]:
g.screen_affinity = 1
groups[0].label = '🎵'
# groups.insert(0, Group('1', screen_affinity=0, label='🎵'))
# This likely won't work when we only have 1 monitor
def go_to_group(name: str) -> Callable:
def _inner(qtile) -> None:
if num_monitors > 1:
if name == '1':
qtile.focus_screen(0)
else:
qtile.focus_screen(1)
qtile.groups_map[name].toscreen()
return _inner
for i in groups:
keys.extend(
[
# mod1 + letter of group = switch to group
Key(
[mod],
i.name,
# lazy.group[i.name].toscreen(),
lazy.function(go_to_group(i.name)),
desc="Switch to group {}".format(i.name),
),
# mod1 + shift + letter of group = switch to & move focused window to group
Key(
[mod, "shift"],
i.name,
lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name),
),
# Or, use below if you prefer not to switch to that group.
# # mod1 + shift + letter of group = move focused window to group
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
# desc="move focused window to group {}".format(i.name)),
]
)
# keys.append(Key([mod], 'm', lazy.function(go_to_music), desc="Music"))
layouts = [
layout.Max(),
layout.Columns(border_focus_stack=["#d75f5f", "#8f3d3d"], border_width=4),
# Try more layouts by unleashing below layouts.
# layout.Stack(num_stacks=2),
# layout.Bsp(),
# layout.Matrix(),
# layout.MonadTall(),
# layout.MonadWide(),
# layout.RatioTile(),
# layout.Tile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
widget_defaults = dict(
font="JetBrains Mono",
fontsize=12,
padding=5,
)
# Drag floating layouts.
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front()),
]
dgroups_key_binder = None
dgroups_app_rules = [] # type: list
follow_mouse_focus = True
bring_front_click = False
floats_kept_above = True
cursor_warp = False
floating_layout = layout.Floating(
float_rules=[
# Run the utility of `xprop` to see the wm class and name of an X client.
*layout.Floating.default_float_rules,
Match(wm_class="pygame"),
Match(wm_class="confirmreset"), # gitk
Match(wm_class="makebranch"), # gitk
Match(wm_class="maketag"), # gitk
Match(wm_class="ssh-askpass"), # ssh-askpass
Match(title="branchdialog"), # gitk
Match(title="pinentry"), # GPG key password entry
]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
# If things like steam games want to auto-minimize themselves when losing
# focus, should we respect this or not?
auto_minimize = True
# When using the Wayland backend, this can be used to configure input devices.
wl_input_rules = None
# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
# string besides java UI toolkits; you can see several discussions on the
# mailing lists, GitHub issues, and other WM documentation that suggest setting
# this string if your java app doesn't work correctly. We may as well just lie
# and say that we're a working one by default.
#
# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
# java that happens to be on java's whitelist.
wmname = "LG3D"
logger.warning('Loaded: ' + str(datetime.now()))

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
.config/magit/*
!.config/magit/init.el
!.config/magit/early-init.el
__pycache__