diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 0000000..90343ca --- /dev/null +++ b/.gdbinit @@ -0,0 +1,2 @@ +set debuginfod enable on +set disassembly-flavor intel diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml new file mode 100644 index 0000000..93a1a5c --- /dev/null +++ b/alacritty/alacritty.toml @@ -0,0 +1,29 @@ + +[font] +size = 12 + +[font.normal] +family = "Iosevka" +style = "Regular" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = false + +[terminal.shell] +program = "/usr/bin/fish" + +[window] +opacity = 0.85 + +[window.padding] +x = 10 +y = 10 + +[general] +import = ["/home/l/.config/alacritty/catppuccin-mocha.toml"] + +[terminal] diff --git a/alacritty/catppuccin-mocha.toml b/alacritty/catppuccin-mocha.toml new file mode 100644 index 0000000..34cba4e --- /dev/null +++ b/alacritty/catppuccin-mocha.toml @@ -0,0 +1,71 @@ +[[colors.indexed_colors]] +color = "#FAB387" +index = 16 + +[[colors.indexed_colors]] +color = "#F5E0DC" +index = 17 + +[colors.bright] +black = "#585B70" +blue = "#89B4FA" +cyan = "#94E2D5" +green = "#A6E3A1" +magenta = "#F5C2E7" +red = "#F38BA8" +white = "#A6ADC8" +yellow = "#F9E2AF" + +[colors.cursor] +cursor = "#F5E0DC" +text = "#1E1E2E" + +[colors.dim] +black = "#45475A" +blue = "#89B4FA" +cyan = "#94E2D5" +green = "#A6E3A1" +magenta = "#F5C2E7" +red = "#F38BA8" +white = "#BAC2DE" +yellow = "#F9E2AF" + +[colors.hints.end] +background = "#A6ADC8" +foreground = "#1E1E2E" + +[colors.hints.start] +background = "#F9E2AF" +foreground = "#1E1E2E" + +[colors.normal] +black = "#45475A" +blue = "#89B4FA" +cyan = "#94E2D5" +green = "#A6E3A1" +magenta = "#F5C2E7" +red = "#F38BA8" +white = "#BAC2DE" +yellow = "#F9E2AF" + +[colors.primary] +background = "#1E1E2E" +bright_foreground = "#CDD6F4" +dim_foreground = "#CDD6F4" +foreground = "#CDD6F4" + +[colors.search.focused_match] +background = "#A6E3A1" +foreground = "#1E1E2E" + +[colors.search.matches] +background = "#A6ADC8" +foreground = "#1E1E2E" + +[colors.selection] +background = "#F5E0DC" +text = "#1E1E2E" + +[colors.vi_mode_cursor] +cursor = "#B4BEFE" +text = "#1E1E2E" diff --git a/emacs/init.el b/emacs/init.el new file mode 100644 index 0000000..8798705 --- /dev/null +++ b/emacs/init.el @@ -0,0 +1,50 @@ +;;"GNU Emacs 30.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.50, cairo version 1.18.4)" +(setq-local uconf-font-name "Iosevka") +(setq custom-file (file-name-concat (file-name-directory user-init-file) "custom.el")) +(setq display-lineq-numbers-type 'relative) +(setq inhibit-startup-screen t) + +(menu-bar-mode 0) +(tool-bar-mode 0) +(global-display-line-numbers-mode) +(ido-mode 1) +(ido-everywhere 1) +(fido-mode 1) +(show-paren-mode 1) +(column-number-mode 1) +(whitespace-mode 1) + +(use-package paredit + :ensure t + :hook ((emacs-lisp-mode + lisp-mode + clojure-mode + scheme-mode + racket-mode) . paredit-mode) + :config + (setq paredit-everywhere t)) + +(use-package multiple-cursors + :ensure t + :bind (("C->" . mc/mark-next-like-this) + ("C-S-c C-S-c" . mc/edit-lines) + ("C-<" . mc/mark-previous-like-this) + ("C-c C->" . mc/mark-all-like-this))) + +(use-package modus-themes + :ensure t + :config + (load-theme 'modus-vivendi-tinted t)) + +(set-face-attribute 'default nil :height 50) + +(when (find-font (font-spec + :family uconf-font-name)) + (set-face-attribute 'default nil + :font uconf-font-name)) + +(use-package magit + :ensure t + :bind (("C-x g" . magit-status))) + +(load-file custom-file) diff --git a/i3/config b/i3/config new file mode 100644 index 0000000..b8d238d --- /dev/null +++ b/i3/config @@ -0,0 +1,173 @@ +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:Noto Sans 4.5 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec alacritty +# i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+space exec --no-startup-id "rofi -modi drun,run -show drun" +bindsym $mod+Tab exec --no-startup-id "rofi -modi window -show window" +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+m split h +# split in vertical orientation +bindsym $mod+n split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+t floating toggle + +# change focus between tiling / floating windows +bindsym $mod+t focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} + +default_border pixel 0 + diff --git a/i3status/config b/i3status/config new file mode 100644 index 0000000..8e45cd3 --- /dev/null +++ b/i3status/config @@ -0,0 +1,74 @@ + +general { + colors = true + interval = 5 +} + +order += "cpu_usage" +order += "cpu_temperature 0" +order += "load" +order += "memory" +order += "disk /" +order += "wireless _first_" +order += "ethernet _first_" +order += "volume master" +order += "battery 0" +order += "time" + + +cpu_temperature 0 { + format = "%degrees °C" +} + +time { + format = "%Y-%m-%d %H:%M:%S" +} + +load { + format = "%1min" +} + +memory { + format = "%used / %total (%percentage_used)" +} + +disk "/" { + format = "%free / %total (%percentage_used)" +} + +volume master { + format = "♪ %volume" + format_muted = "♪ %volume (muted)" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + + +wireless _first_ { + format_up = "%ip (%essid, %bitrate, %quality)" + format_down = "" +} + +ethernet _first_ { + format_up = "%ip (%speed)" + format_down = "" +} + + +battery 0 { + format = "%status %percentage %remaining %emptytime" + format_down = "" + status_chr = "⚡" + status_bat = "🔋" + status_unk = "?" + status_full = "Full" + status_idle = "Idle" + path = "/sys/class/power_supply/BAT%d/uevent" + low_threshold = 10 +} + +cpu_usage { + format = "%usage" + max_threshold = 80 +} \ No newline at end of file diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..2c1c2f4 --- /dev/null +++ b/sync.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +set -euo pipefail + +DRY_RUN=true + +usage() { + echo "Usage: $0 [--commit|-c]" + echo " --commit, -c Apply changes (default is dry-run)" + exit 0 +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --commit|-c) DRY_RUN=false ;; + --help|-h) usage ;; + *) echo "Unknown option: $1"; usage ;; + esac + shift +done + + +confirm() { + local ans + read -rp "Apply this change? [y/N] " ans /dev/null; then + print_file_status $REL "up-to-date" + continue + fi + + + if [[ "$A" -nt "$B" ]]; then + print_file_status $REL "$A is newer than $B" + echo " (old) $B" + echo " (new) $A" + show_diff "$B" "$A" + FROM="$A" + TO="$DIR_B" + else + print_file_status $REL "$B is newer than $A" + echo " (old) $A" + echo " (new) $B" + show_diff "$A" "$B" + FROM="$B" + TO="$DIR_A" + fi + + sync_exec $FROM $TO $REL + + elif [[ -e "$A" ]]; then + print_file_status $REL "only found in $DIR_A" + sync_exec $A $DIR_B $REL + elif [[ -e "$B" ]]; then + print_file_status $REL "only found in $DIR_B" + sync_exec $B $DIR_A $REL + else + print_file_status $REL "file doesn't exist anywhere" + fi + + echo + done <<< "$PATHS" +} + +sync_root xdg_config "${XDG_CONFIG_HOME:-$HOME/.config}" <<'EOF' +nvim/init.lua +nvim/after/plugin/config.lua +emacs/init.el +i3/config +i3status/config +alacritty/catppuccin-mocha.toml +alacritty/alacritty.toml +EOF + +sync_root home "$HOME" <<'EOF' +.gdbinit +EOF