From e6bdde0bb479e00f7f6449791f8acc70560032dc Mon Sep 17 00:00:00 2001 From: Simponic Date: Tue, 25 Oct 2022 22:13:43 -0600 Subject: [PATCH] Initial commit --- .config/alacritty/alacritty.yml | 159 +++++++++++++++ .config/dunst/dunstrc | 49 +++++ .config/spotifyd/.gitignore | 1 + .config/spotifyd/spotifyd.conf.example | 15 ++ .config/sway/config | 237 ++++++++++++++++++++++ .config/waybar/config | 72 +++++++ .config/waybar/style.css | 59 ++++++ .config/xremap/config.yml | 5 + .emacs.d/init.el | 20 ++ .emacs.d/settings.org | 262 +++++++++++++++++++++++++ .gitignore | 45 +++++ .gitmodules | 9 + .spaceshiprc.zsh | 11 ++ .stumpwm.d/.gitignore | 3 + .stumpwm.d/README.md | 53 +++++ .stumpwm.d/gaps.lisp | 9 + .stumpwm.d/groups.lisp | 5 + .stumpwm.d/init.lisp | 21 ++ .stumpwm.d/keyboard.lisp | 22 +++ .stumpwm.d/modeline.lisp | 44 +++++ .stumpwm.d/swank.lisp | 7 + .stumpwm.d/theme.lisp | 11 ++ .stumpwm.d/utils.lisp | 18 ++ .vimrc | 30 +++ .zshrc | 52 +++++ ascii-arts/bat.txt | 7 + ascii-arts/bear.txt | 12 ++ ascii-arts/bsd.txt | 19 ++ ascii-arts/c++.txt | 23 +++ ascii-arts/calvin-and-hobbes.txt | 14 ++ ascii-arts/city.txt | 9 + ascii-arts/emacs.txt | 23 +++ ascii-arts/floppy.txt | 10 + ascii-arts/gameboy.txt | 15 ++ ascii-arts/piglet.txt | 10 + ascii-arts/pooh-bear.txt | 14 ++ ascii-arts/python.txt | 26 +++ ascii-arts/rubiks.txt | 7 + ascii-arts/tux.txt | 16 ++ ascii-arts/vim.txt | 23 +++ scripts/.gitignore | 1 + scripts/ascii-table.py | 5 + scripts/mediaplayer.py | 165 ++++++++++++++++ scripts/songnotification | 4 + 44 files changed, 1622 insertions(+) create mode 100644 .config/alacritty/alacritty.yml create mode 100644 .config/dunst/dunstrc create mode 100644 .config/spotifyd/.gitignore create mode 100644 .config/spotifyd/spotifyd.conf.example create mode 100644 .config/sway/config create mode 100644 .config/waybar/config create mode 100644 .config/waybar/style.css create mode 100644 .config/xremap/config.yml create mode 100644 .emacs.d/init.el create mode 100644 .emacs.d/settings.org create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .spaceshiprc.zsh create mode 100644 .stumpwm.d/.gitignore create mode 100644 .stumpwm.d/README.md create mode 100644 .stumpwm.d/gaps.lisp create mode 100644 .stumpwm.d/groups.lisp create mode 100644 .stumpwm.d/init.lisp create mode 100644 .stumpwm.d/keyboard.lisp create mode 100644 .stumpwm.d/modeline.lisp create mode 100644 .stumpwm.d/swank.lisp create mode 100644 .stumpwm.d/theme.lisp create mode 100644 .stumpwm.d/utils.lisp create mode 100644 .vimrc create mode 100644 .zshrc create mode 100644 ascii-arts/bat.txt create mode 100644 ascii-arts/bear.txt create mode 100644 ascii-arts/bsd.txt create mode 100644 ascii-arts/c++.txt create mode 100644 ascii-arts/calvin-and-hobbes.txt create mode 100644 ascii-arts/city.txt create mode 100644 ascii-arts/emacs.txt create mode 100644 ascii-arts/floppy.txt create mode 100644 ascii-arts/gameboy.txt create mode 100644 ascii-arts/piglet.txt create mode 100644 ascii-arts/pooh-bear.txt create mode 100644 ascii-arts/python.txt create mode 100644 ascii-arts/rubiks.txt create mode 100644 ascii-arts/tux.txt create mode 100644 ascii-arts/vim.txt create mode 100644 scripts/.gitignore create mode 100755 scripts/ascii-table.py create mode 100755 scripts/mediaplayer.py create mode 100755 scripts/songnotification diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..14c0a1b --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,159 @@ +font: + normal: + family: "CozetteVector" + + bold: + family: "CozetteVector" + + italic: + family: "CozetteVector" + + size: 13.0 + + offset: + x: 0 + y: 0 + + glyph_offset: + x: 0 + y: 0 + +window: + padding: + x: 12 + y: 12 + dynamic_padding: true +# decorations: none + + +cursor: + style: Block + unfocused_hollow: false +# thickness: 0.33 + +mouse: + hide_when_typing: true + + +# Base16 Gruvbox light, medium 256 - alacritty color config +# Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) +colors: + # Default colors + primary: + background: '0xfbf1c7' + foreground: '0x504945' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0xfbf1c7' + cursor: '0x504945' + + # Normal colors + normal: + black: '0xfbf1c7' + red: '0x9d0006' + green: '0x79740e' + yellow: '0xb57614' + blue: '0x076678' + magenta: '0x8f3f71' + cyan: '0x427b58' + white: '0x504945' + + # Bright colors + bright: + black: '0xbdae93' + red: '0x9d0006' + green: '0x79740e' + yellow: '0xb57614' + blue: '0x076678' + magenta: '0x8f3f71' + cyan: '0x427b58' + white: '0x282828' + + indexed_colors: + - { index: 16, color: '0xaf3a03' } + - { index: 17, color: '0xd65d0e' } + - { index: 18, color: '0xebdbb2' } + - { index: 19, color: '0xd5c4a1' } + - { index: 20, color: '0x665c54' } + - { index: 21, color: '0x3c3836' } + +key_bindings: + - { key: A, mods: Alt, chars: "\x1ba" } + - { key: B, mods: Alt, chars: "\x1bb" } + - { key: C, mods: Alt, chars: "\x1bc" } + - { key: D, mods: Alt, chars: "\x1bd" } + - { key: E, mods: Alt, chars: "\x1be" } + - { key: F, mods: Alt, chars: "\x1bf" } + - { key: G, mods: Alt, chars: "\x1bg" } + - { key: H, mods: Alt, chars: "\x1bh" } + - { key: I, mods: Alt, chars: "\x1bi" } + - { key: J, mods: Alt, chars: "\x1bj" } + - { key: K, mods: Alt, chars: "\x1bk" } + - { key: L, mods: Alt, chars: "\x1bl" } + - { key: M, mods: Alt, chars: "\x1bm" } + - { key: N, mods: Alt, chars: "\x1bn" } + - { key: O, mods: Alt, chars: "\x1bo" } + - { key: P, mods: Alt, chars: "\x1bp" } + - { key: Q, mods: Alt, chars: "\x1bq" } + - { key: R, mods: Alt, chars: "\x1br" } + - { key: S, mods: Alt, chars: "\x1bs" } + - { key: T, mods: Alt, chars: "\x1bt" } + - { key: U, mods: Alt, chars: "\x1bu" } + - { key: V, mods: Alt, chars: "\x1bv" } + - { key: W, mods: Alt, chars: "\x1bw" } + - { key: X, mods: Alt, chars: "\x1bx" } + - { key: Y, mods: Alt, chars: "\x1by" } + - { key: Z, mods: Alt, chars: "\x1bz" } + - { key: A, mods: Alt|Shift, chars: "\x1bA" } + - { key: B, mods: Alt|Shift, chars: "\x1bB" } + - { key: C, mods: Alt|Shift, chars: "\x1bC" } + - { key: D, mods: Alt|Shift, chars: "\x1bD" } + - { key: E, mods: Alt|Shift, chars: "\x1bE" } + - { key: F, mods: Alt|Shift, chars: "\x1bF" } + - { key: G, mods: Alt|Shift, chars: "\x1bG" } + - { key: H, mods: Alt|Shift, chars: "\x1bH" } + - { key: I, mods: Alt|Shift, chars: "\x1bI" } + - { key: J, mods: Alt|Shift, chars: "\x1bJ" } + - { key: K, mods: Alt|Shift, chars: "\x1bK" } + - { key: L, mods: Alt|Shift, chars: "\x1bL" } + - { key: M, mods: Alt|Shift, chars: "\x1bM" } + - { key: N, mods: Alt|Shift, chars: "\x1bN" } + - { key: O, mods: Alt|Shift, chars: "\x1bO" } + - { key: P, mods: Alt|Shift, chars: "\x1bP" } + - { key: Q, mods: Alt|Shift, chars: "\x1bQ" } + - { key: R, mods: Alt|Shift, chars: "\x1bR" } + - { key: S, mods: Alt|Shift, chars: "\x1bS" } + - { key: T, mods: Alt|Shift, chars: "\x1bT" } + - { key: U, mods: Alt|Shift, chars: "\x1bU" } + - { key: V, mods: Alt|Shift, chars: "\x1bV" } + - { key: W, mods: Alt|Shift, chars: "\x1bW" } + - { key: X, mods: Alt|Shift, chars: "\x1bX" } + - { key: Y, mods: Alt|Shift, chars: "\x1bY" } + - { key: Z, mods: Alt|Shift, chars: "\x1bZ" } + - { key: Key1, mods: Alt, chars: "\x1b1" } + - { key: Key2, mods: Alt, chars: "\x1b2" } + - { key: Key3, mods: Alt, chars: "\x1b3" } + - { key: Key4, mods: Alt, chars: "\x1b4" } + - { key: Key5, mods: Alt, chars: "\x1b5" } + - { key: Key6, mods: Alt, chars: "\x1b6" } + - { key: Key7, mods: Alt, chars: "\x1b7" } + - { key: Key8, mods: Alt, chars: "\x1b8" } + - { key: Key9, mods: Alt, chars: "\x1b9" } + - { key: Key0, mods: Alt, chars: "\x1b0" } + - { key: Space, mods: Control, chars: "\x00" } # Ctrl + Space + - { key: Grave, mods: Alt, chars: "\x1b`" } # Alt + ` + - { key: Grave, mods: Alt|Shift, chars: "\x1b~" } # Alt + ~ + - { key: Period, mods: Alt, chars: "\x1b." } # Alt + . + - { key: Key8, mods: Alt|Shift, chars: "\x1b*" } # Alt + * + - { key: Key3, mods: Alt|Shift, chars: "\x1b#" } # Alt + # + - { key: Period, mods: Alt|Shift, chars: "\x1b>" } # Alt + > + - { key: Comma, mods: Alt|Shift, chars: "\x1b<" } # Alt + < + - { key: Minus, mods: Alt|Shift, chars: "\x1b_" } # Alt + _ + - { key: Key5, mods: Alt|Shift, chars: "\x1b%" } # Alt + % + - { key: Key6, mods: Alt|Shift, chars: "\x1b^" } # Alt + ^ + - { key: Backslash, mods: Alt, chars: "\x1b\\" } # Alt + \ + - { key: Backslash, mods: Alt|Shift, chars: "\x1b|" } # Alt + | + + +#colors: *gruvbox_material_medium_light diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..1351da4 --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,49 @@ +[global] + font = "CozetteVector" + allow_markup = yes + format = "%s\n%b" + sort = yes + indicate_hidden = yes + alignment = center + show_age_threshold = 60 + word_wrap = yes + ignore_newline = no + geometry = "200x5-6+30" + idle_threshold = 120 + monitor = 0 + follow = mouse + sticky_history = yes + line_height = 0 + separator_height = 2 + padding = 8 + horizontal_padding = 8 + separator_color = "#689d6a" + startup_notification = false + # https://github.com/knopwob/dunst/issues/26#issuecomment-36159395 + #icon_position = left + #icon_folders = /usr/share/icons/elementary/actions/16/ + +[frame] + width = 1 + color = "#689d6a" + +[shortcuts] + close = ctrl+space + close_all = ctrl+shift+space + history = ctrl+grave + context = ctrl+shift+period + +[urgency_low] + background = "#fbf1c7" + foreground = "#3c3836" + timeout = 5 + +[urgency_normal] + background = "#fbf1c7" + foreground = "#3c3836" + timeout = 20 + +[urgency_critical] + background = "#9d0006" + foreground = "#fbf1c7" + timeout = 0 diff --git a/.config/spotifyd/.gitignore b/.config/spotifyd/.gitignore new file mode 100644 index 0000000..8b30360 --- /dev/null +++ b/.config/spotifyd/.gitignore @@ -0,0 +1 @@ +spotifyd.conf diff --git a/.config/spotifyd/spotifyd.conf.example b/.config/spotifyd/spotifyd.conf.example new file mode 100644 index 0000000..e81cc90 --- /dev/null +++ b/.config/spotifyd/spotifyd.conf.example @@ -0,0 +1,15 @@ +[global] +username = "laskdfjalskdjfaklsdjflakjd" +password = "asdfasdfasdfasdfasdf" +on_song_change_hook = "/home/ME/scripts/songnotification" +cache_path = "/home/ME/.cache/spotifyd" + +device_name = "archbox" + + +backend = "pulseaudio" +bitrate = 160 +volume_normalisation = true +normalisation_pregain = -10 +device_type = "computer" +no_audio_cache = true diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..0ca02f1 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,237 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +set $browser firefox +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu wofi --show=drun --lines=5 --prompt="" +set $wallpapers_path $HOME/Wallpapers + +### Output configuration +# +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +output * bg `find $wallpapers_path -type f | shuf -n 1` fill + +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# + exec swayidle -w \ + timeout 600 'swaylock -f -c 000000' \ + timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Browser + bindsym $mod+Shift+b exec $browser + # Emacs + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec emacs + + # Brightness + bindsym $mod+Shift+w exec "brightnessctl set +5%" + bindsym $mod+Shift+s exec "brightnessctl set 5%-" + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 20px + bindsym $down resize grow height 20px + bindsym $up resize shrink height 20px + bindsym $right resize grow width 20px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# +# Status Bar: +# +bar { + swaybar_command waybar +} + +# +# Gaps +# +gaps inner 5 +default_border pixel 3 +client.focused "#000000" "#ffffff" "#000000" + +include /etc/sway/config.d/* + +# +# Cursor +# + +set $my_cursor Bibata-Modern-Amber +set $my_cursor_size 16 + +exec_always { + gsettings set org.gnome.desktop.interface cursor-theme $my_cursor + gsettings set org.gnome.desktop.interface cursor-size $my_cursor_size +} + diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..f3dc04a --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,72 @@ +{ + "position": "top", + "spacing": 0, + "modules-left": ["network", "clock"], + "modules-center": ["sway/workspaces", "custom/spotify"], + "modules-right": ["pulseaudio", "memory", "cpu", "temperature#cpu", "backlight", "battery"], + + "clock": { + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": " {:%A, %d %B %Y, %H:%M}", + "interval": 60 + }, + "backlight": { + "format": " {}%" + }, + "cpu": { + "format": " {usage}%" + }, + "memory": { + "format": " {}%", + "tooltip": false, + }, + "temperature#cpu": { + "critical-threshold": 70, + "format": " {temperatureC}°C " + }, + "custom/spotify": { + "exec": "/home/logan/scripts/mediaplayer.py --player spotify --period 1 --width 18", + "format": "{} ", + "return-type": "json", + "on-click": "playerctl play-pause", + "on-scroll-up": "playerctl next", + "on-scroll-down": "playerctl previous" + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "format-wifi": " {ipaddr}", + "format-ethernet": " {ipaddr}/{cidr}", + "format-disconnected": "⚠ Disconnected", + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon} {volume}% {format_source}", + "format-bluetooth": "{icon}  {volume}% {format_source}", + "format-bluetooth-muted": " {icon}  {format_source}", + "format-muted": " {format_source}", + "format-source": " {volume}%", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, +} diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..21aec0c --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,59 @@ +* { + font-family: CozetteVector; + font-size: 16px; + color: #3C3836; /* Foreground "black" */ +} + +window > box { + margin: 4px 4px 4px 0px; +} + +window#waybar { + background: rgba(251,241,199,0.7); /* Background "wheat"-ish */ +} + +#workspaces button { + background: #fbf1c7; + margin-right: 5px; +} + +#workspaces button.focused { + background: #689d6a; /* Aqua */ +} + +/* Modules */ + +#clock, #battery, #cpu, #memory, #disk, #temperature, #backlight, #network, #pulseaudio, #custom-media, #custom-launcher, #custom-power, #tray, #mode, #idle_inhibitor , #mpd, .custom-spotify { + padding: 0 10px; + margin: 0px 5px; + background: #fbf1c7; + border-radius: 3px; +} + +#battery { + background-color: #D79921; +} + +#battery.charging, #battery.plugged { + background-color: #98971A; +} + +#network { + background-color: #98971A; +} + +#network.disconnected { + background-color: #cc241d; +} + +#temperature { + background-color: #98971a; +} + +#temperature.critical { + background-color: #cc241d; +} + +#pulseaudio.muted { + background-color: #cc241d; +} diff --git a/.config/xremap/config.yml b/.config/xremap/config.yml new file mode 100644 index 0000000..3581877 --- /dev/null +++ b/.config/xremap/config.yml @@ -0,0 +1,5 @@ +modmap: + - name: CapsLock Control + remap: # Required + KEY_CAPSLOCK: CONTROL_L + CONTROL_L: KEY_ESC diff --git a/.emacs.d/init.el b/.emacs.d/init.el new file mode 100644 index 0000000..b92df38 --- /dev/null +++ b/.emacs.d/init.el @@ -0,0 +1,20 @@ +(require 'org) + +(org-babel-load-file + (expand-file-name "settings.org" + user-emacs-directory)) + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages '(magit counsel doom-modeline doom-themes use-package)) + '(tab-width 2)) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) + diff --git a/.emacs.d/settings.org b/.emacs.d/settings.org new file mode 100644 index 0000000..d18aa41 --- /dev/null +++ b/.emacs.d/settings.org @@ -0,0 +1,262 @@ +#+TITLE: Simponic's Settings +#+AUTHOR: Simponic +#+STARTUP: fold + +* Packages +** Melpa +#+BEGIN_SRC emacs-lisp + (require 'package) + (add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) +#+END_SRC +** use-package +#+BEGIN_SRC emacs-lisp + (dolist (package '(use-package)) + (unless (package-installed-p package) + (package-install package))) +#+END_SRC + +* General emacs +** Tab bar mode +#+BEGIN_SRC emacs-lisp + (defun my-tabbar-buffer-groups () ;; customize to show all normal files in one group + (list (cond ((string-equal "*" (substring (buffer-name) 0 1)) "emacs") + ((eq major-mode 'dired-mode) "emacs") + (t "user")))) + (setq tabbar-buffer-groups-function 'my-tabbar-buffer-groups) + (tab-bar-mode) +#+END_SRC +** Indentation +#+BEGIN_SRC emacs-lisp + (setq default-tab-width 2) + (setq-default tab-width 2) + (setq-default indent-tabs-mode nil) +#+END_SRC +** Line numbers +#+BEGIN_SRC emacs-lisp + (setq display-line-numbers-type 'relative) + (global-display-line-numbers-mode) +#+END_SRC +** Filesystem stuff +#+BEGIN_SRC emacs-lisp + (setq auto-save-default nil) + (setq make-backup-files nil) + (setq create-lockfiles nil) + (global-auto-revert-mode t) ;; Change files on disk as they are updated +#+END_SRC +** GUI stuff +#+BEGIN_SRC emacs-lisp + (menu-bar-mode -1) + (setq inhibit-startup-screen t) ;; Startup screen + (if (display-graphic-p) + (funcall (lambda () + (tool-bar-mode -1) ;; System bar + (set-fringe-mode '(1 . 1)) ;; Minimize arrows before and after wrapped lines by setting fringe to 1px + (toggle-scroll-bar -1)))) ;; Scroll bar + (setq frame-resize-pixelwise t) ;; Use 100% of window space +#+END_SRC +** System path (macos) +#+BEGIN_SRC emacs-lisp + ;; Use system path on macos - needed for node + (use-package exec-path-from-shell + :ensure t + :init + (when (memq window-system '(mac ns x)) + (exec-path-from-shell-initialize))) +#+END_SRC + +* Theming +** Highlight current line +#+BEGIN_SRC emacs-lisp + (global-hl-line-mode) +#+END_SRC +** Font +#+BEGIN_SRC emacs-lisp + (let ((font "CozetteVector-14")) + (set-face-attribute 'default nil :font font) + (set-frame-font font nil t)) +#+END_SRC +** Doom-themes +#+BEGIN_SRC emacs-lisp + (use-package doom-themes + :ensure t + :config + ;; Global settings (defaults) + (setq doom-themes-enable-bold t ; if nil, bold is universally disabled + doom-themes-enable-italic t) ; if nil, italics is universally disabled + (load-theme 'doom-gruvbox-light t) + + ;; Enable flashing mode-line on errors + (doom-themes-visual-bell-config) + ;; Enable custom neotree theme (all-the-icons must be installed!) + (doom-themes-neotree-config) + ;; or for treemacs users + (setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme + (doom-themes-treemacs-config) + ;; Corrects (and improves) org-mode's native fontification. + (doom-themes-org-config)) +#+END_SRC +** Doom-modeline +#+BEGIN_SRC emacs-lisp + (use-package doom-modeline + :ensure t + :init (doom-modeline-mode 1)) +#+END_SRC +** All the icons +#+BEGIN_SRC emacs-lisp + (use-package all-the-icons + :ensure t) +#+END_SRC + +* Projectile +#+BEGIN_SRC emacs-lisp + (use-package projectile + :bind ("C-c p" . 'projectile-command-map) + :init (projectile-mode +1) (setq projectile-enable-caching t) + :ensure t) +#+END_SRC + +* Swiper, Ivy +#+BEGIN_SRC emacs-lisp + (use-package counsel + :ensure t + :bind + ("C-s" . 'swiper-isearch) + ("M-x" . 'counsel-M-x) + :init + (setq ivy-use-virtual-buffers t) + (setq enable-recursive-minibuffers t) + (ivy-mode 1)) +#+END_SRC + +* Neotree +#+BEGIN_SRC emacs-lisp + (use-package neotree + :ensure t + :bind ("C-c j" . 'neotree-toggle) + :init + ;; slow rendering + (setq inhibit-compacting-font-caches t) + + ;; set icons theme + (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) + + ;; Every time when the neotree window is opened, let it find current file and jump to node + (setq neo-smart-open t) + + ;; When running ‘projectile-switch-project’ (C-c p p), ‘neotree’ will change root automatically + (setq projectile-switch-project-action 'neotree-projectile-action) + + (setq neo-window-width 35) + + ;; show hidden files + (setq-default neo-show-hidden-files t)) +#+END_SRC + +* Org mode +** General +#+BEGIN_SRC emacs-lisp + (setq org-startup-indented t) +#+END_SRC +** Babel +#+BEGIN_SRC emacs-lisp + (org-babel-do-load-languages + 'org-babel-load-languages + '((lisp . t) + (python . t))) +#+END_SRC +** org-bullets +#+BEGIN_SRC emacs-lisp + (use-package org-bullets + :ensure t + :init + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) +#+END_SRC +** org-appear +#+BEGIN_SRC emacs-lisp + (use-package org-appear + :ensure t + :init + (add-hook 'org-mode-hook 'org-appear-mode)) +#+END_SRC + +* Development +** Git +#+BEGIN_SRC emacs-lisp + (use-package magit :ensure t) +#+END_SRC +** Company mode +#+BEGIN_SRC emacs-lisp + (use-package company + :ensure t + :init + (global-company-mode t) + :bind (:map company-active-map + ("C-n" . company-select-next) + ("C-p" . company-select-previous)) + :config + (setq company-idle-delay 0.3)) +#+END_SRC +** LSP Mode +#+BEGIN_SRC emacs-lisp + (use-package lsp-mode + :ensure t + :init + ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") + (setq lsp-keymap-prefix "C-c l") + :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) + (elixir-mode . lsp) + (rust-mode . lsp) + (typescript-mode . lsp) + ;; if you want which-key integration + (lsp-mode . lsp-enable-which-key-integration)) + :commands lsp) +#+END_SRC +** Languages +*** Common Lisp +**** Slime +#+BEGIN_SRC emacs-lisp + (use-package slime + :ensure t + :init + (setq inferior-lisp-program "sbcl")) +#+END_SRC +*** Elixir +#+BEGIN_SRC emacs-lisp + (use-package elixir-mode + :ensure t) +#+END_SRC +*** Rust +After installing the ~rust-analyzer~ program, the following can be used: +#+BEGIN_SRC emacs-lisp + (use-package rust-mode + :ensure t) + (setq lsp-rust-server 'rust-analyzer) +#+END_SRC + +*** Web Stuff +**** Web Mode +#+BEGIN_SRC emacs-lisp + ;; web-mode + (setq web-mode-markup-indent-offset 2) + (setq web-mode-code-indent-offset 2) + (setq web-mode-css-indent-offset 2) + (use-package web-mode + :ensure t + :mode (("\\.js\\'" . web-mode) + ("\\.jsx\\'" . web-mode) + ("\\.ts\\'" . web-mode) + ("\\.tsx\\'" . web-mode) + ("\\.html\\'" . web-mode)) + :commands web-mode) +#+END_SRC +**** Prettier +#+BEGIN_SRC emacs-lisp + (use-package prettier-js + :ensure t) + (add-hook 'web-mode-hook #'(lambda () + (enable-minor-mode + '("\\.jsx?\\'" . prettier-js-mode)) + (enable-minor-mode + '("\\.tsx?\\'" . prettier-js-mode)))) +#+END_SRC diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34d430b --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +* +!.gitignore +!.gitmodules + +!scripts +!scripts/* + +!.vimrc + +!.zshrc +!.spaceshiprc.zsh +!ascii-arts +!ascii-arts/* +!zsh-stuff + +!.config +!.config/picom +!.config/picom/* + +!.config/alacritty +!.config/alacritty/* + +!.config/dunst +!.config/dunst/* + +!.config/waybar +!.config/waybar/* + +!.config/sway +!.config/sway/* + +!.config/xremap +!.config/xremap/* + +!.config/systemd +!.config/systemd/* + +!.config/spotifyd +!.config/spotifyd/* + +!.emacs.d +!.emacs.d/* + +!.stumpwm.d +!.stumpwm.d/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..84d9d3f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "zsh-stuff/zsh-syntax-highlighting"] + path = zsh-stuff/zsh-syntax-highlighting + url = https://github.com/zsh-users/zsh-syntax-highlighting.git +[submodule "zsh-stuff/spaceship-prompt"] + path = zsh-stuff/spaceship-prompt + url = https://github.com/spaceship-prompt/spaceship-prompt.git +[submodule ".stumpwm.d/modules"] + path = .stumpwm.d/modules + url = https://github.com/stumpwm/stumpwm-contrib diff --git a/.spaceshiprc.zsh b/.spaceshiprc.zsh new file mode 100644 index 0000000..3294ca3 --- /dev/null +++ b/.spaceshiprc.zsh @@ -0,0 +1,11 @@ +# Display time +SPACESHIP_TIME_SHOW=true + +# Display username always +SPACESHIP_USER_SHOW=always + +# Do not truncate path in repos +SPACESHIP_DIR_TRUNC_REPO=false + +SPACESHIP_HOST_SHOW="always" +SPACESHIP_GIT_SHOW=always diff --git a/.stumpwm.d/.gitignore b/.stumpwm.d/.gitignore new file mode 100644 index 0000000..ee3b017 --- /dev/null +++ b/.stumpwm.d/.gitignore @@ -0,0 +1,3 @@ +*~ +*.log.1 +*.log diff --git a/.stumpwm.d/README.md b/.stumpwm.d/README.md new file mode 100644 index 0000000..f8726c9 --- /dev/null +++ b/.stumpwm.d/README.md @@ -0,0 +1,53 @@ +## Dependencies + +### SBCL + +`sudo pacman -S sbcl` + +### Quicklisp: + +In a shell: + +```bash +cd ~ +curl -O https://beta.quicklisp.org/quicklisp.lisp +sbcl --load quicklisp.lisp +``` + +Then in the REPL: + +```common-lisp +(quicklisp-quickstart:install) +(ql:add-to-init-file) +``` + +And install some packages from quicklisp: + +```common-lisp +(ql:quickload '(:clx :cl-ppcre :alexandria)) +``` + +### Other + +You'll probably want some stuff on your modeline. My modeline setup is hacky AF so you'll want the following: + +- `ifconfig` (in `net-tools` in Arch) +- `acpi` +- `lm_sensors` +- `pamixer` + +## Building and Installing + +```bash +mkdir ~/src +git clone git@github.com:stumpwm/stumpwm.git ~/src/stumpwm +cd ~/src/stumpwm +./autogen.sh +./configure +make -j6 +sudo make install +``` + +## Configuration + +- If the environment variable LAPTOP exists, then the battery will show in the modeling. You can edit `/etc/environment` if you want it in other programs too. diff --git a/.stumpwm.d/gaps.lisp b/.stumpwm.d/gaps.lisp new file mode 100644 index 0000000..1cd5077 --- /dev/null +++ b/.stumpwm.d/gaps.lisp @@ -0,0 +1,9 @@ +(add-to-load-path "~/.stumpwm.d/modules/util/swm-gaps") + +(load-module "swm-gaps") + +(setf swm-gaps:*head-gaps-size* 0 + swm-gaps:*inner-gaps-size* 5 + swm-gaps:*outer-gaps-size* 5) + +(swm-gaps:toggle-gaps) diff --git a/.stumpwm.d/groups.lisp b/.stumpwm.d/groups.lisp new file mode 100644 index 0000000..7678b19 --- /dev/null +++ b/.stumpwm.d/groups.lisp @@ -0,0 +1,5 @@ +(grename "misc") +(gnew "www") +(gnew "txt") +(gnew "sh") +(gnew "chat") diff --git a/.stumpwm.d/init.lisp b/.stumpwm.d/init.lisp new file mode 100644 index 0000000..a842b94 --- /dev/null +++ b/.stumpwm.d/init.lisp @@ -0,0 +1,21 @@ +(in-package :stumpwm) + +;; Utils and helpers +(load "~/.stumpwm.d/utils.lisp") + +;; Swank +(load "~/.stumpwm.d/swank.lisp") + +;; Keybindings and whatnot +(load "~/.stumpwm.d/keyboard.lisp") + +;; Groups +(load "~/.stumpwm.d/groups.lisp") + +;; The actual rice +(load "~/.stumpwm.d/theme.lisp") +(load "~/.stumpwm.d/gaps.lisp") +(load "~/.stumpwm.d/modeline.lisp") + +;; Follow focus on mouse hover +(setq *mouse-focus-policy* :sloppy) diff --git a/.stumpwm.d/keyboard.lisp b/.stumpwm.d/keyboard.lisp new file mode 100644 index 0000000..53d423f --- /dev/null +++ b/.stumpwm.d/keyboard.lisp @@ -0,0 +1,22 @@ +;; C-; as prefix key +(stumpwm:set-prefix-key (stumpwm:kbd "C-;")) + +(define-key *top-map* (kbd "s-n") "pull-hidden-next") +(define-key *top-map* (kbd "s-p") "pull-hidden-previous") + +(define-key *top-map* (kbd "s-h") "resize 40 0") +(define-key *top-map* (kbd "s-l") "resize -40 0") +(define-key *top-map* (kbd "s-j") "resize 0 40") +(define-key *top-map* (kbd "s-k") "resize 0 -40") + +(define-key *top-map* (kbd "s-u") "exec pamixer -i 5") +(define-key *top-map* (kbd "s-d") "exec pamixer -d 5") + +(define-key *top-map* (kbd "s-w") "exec xbacklight -inc 5") +(define-key *top-map* (kbd "s-s") "exec xbacklight -dec 5") + +(define-key *top-map* (kbd "s-TAB") "fnext") +(define-key *top-map* (kbd "s-ISO_Left_Tab") "fprev") + +(define-key *root-map* (kbd "C-t") "exec alacritty") +(define-key *root-map* (kbd "b") "exec firefox") diff --git a/.stumpwm.d/modeline.lisp b/.stumpwm.d/modeline.lisp new file mode 100644 index 0000000..391110b --- /dev/null +++ b/.stumpwm.d/modeline.lisp @@ -0,0 +1,44 @@ +(defun make-bar (label percentage-function &optional (format-string "(~a\%)")) + (let + ((percentage (funcall percentage-function))) + (concat label ": \[" (bar percentage 5 #\X #\=) "\]" (format nil format-string percentage)))) + +(defun get-volume () + ;; Return the volume as a percentage + (parse-integer (run-shell-command "pamixer --get-volume" t))) + +(defun get-battery () + ;; Return the current battery level as a percentage + (parse-integer (run-shell-command "acpi | awk -F ',' '{print $2}' | grep -Po '\\d+'" t))) + +(defun get-ip () + ;; Return the current ip of the default network interface + (run-shell-command "printf $(ifconfig $(route | grep '^default' | grep -o '[^ ]*$') | grep -Po '\\d+\\.\\d+\\.\\d+\\.\\d+' | head -n1)" t)) + +(defun get-cpu-temp () + ;; Return current temperature of the first cpu package (core) + (parse-integer (run-shell-command "sensors -A | grep 'Package' | awk '{print $4+0}'" t))) + +(setf *status-seperator* " ^3|^] ") +(setf *mode-line* '( + "[^B%n^b]" + "%g" + "%W" + "^>" + "%d" + (:eval (make-bar "VOL" #'get-volume)) + (:eval (make-bar "TEMP" #'get-cpu-temp "(~a°C)")) + (:eval (get-ip)))) +(if (is-laptop) + (push '(:eval (make-bar "BAT" #'get-battery)) (cdr (last *mode-line*)))) +(setf *screen-mode-line-format* (insert-seperators *mode-line* *status-seperator*)) + +(setf *window-format* "%n%s%c") +(setf *time-modeline-string* "%a %b %e %k:%M:%S") +(setf *mode-line-timeout* 1) + +;; Show on each screen +(mapcar + (lambda (x) + (stumpwm:enable-mode-line (stumpwm:current-screen) x t)) + (stumpwm:screen-heads (stumpwm:current-screen))) diff --git a/.stumpwm.d/swank.lisp b/.stumpwm.d/swank.lisp new file mode 100644 index 0000000..3f91108 --- /dev/null +++ b/.stumpwm.d/swank.lisp @@ -0,0 +1,7 @@ +;; Connect in emacs with slime-connect on port 4004 + +(require :swank) +(swank-loader:init) +(swank:create-server :port 4004 + :style swank:*communication-style* + :dont-close t) diff --git a/.stumpwm.d/theme.lisp b/.stumpwm.d/theme.lisp new file mode 100644 index 0000000..1f996a9 --- /dev/null +++ b/.stumpwm.d/theme.lisp @@ -0,0 +1,11 @@ +(setq *message-window-gravity* :center) +(setq *input-window-gravity* :center) + +(setq *mode-line-background-color* "AntiqueWhite") +(setq *mode-line-foreground-color* "Gray20") + +(setf *bar-med-color* "^b^1") ;; Red +(setf *bar-crit-color* "^b^2") ;; Green +(setf *bar-hi-color* "^b^3") ;; Yellow + +(setf *mode-line-highlight-template* "(^R~A^r)") diff --git a/.stumpwm.d/utils.lisp b/.stumpwm.d/utils.lisp new file mode 100644 index 0000000..ce34d50 --- /dev/null +++ b/.stumpwm.d/utils.lisp @@ -0,0 +1,18 @@ +(defun string-include (string1 string2) + (let* ((string1 (string string1)) (length1 (length string1))) + (if (zerop length1) + nil + (labels ((sub (s) + (cond + ((> length1 (length s)) nil) + ((string= string1 s :end2 (length string1)) string1) + (t (sub (subseq s 1)))))) + (sub (string string2)))))) + +(defun is-laptop () + (loop for item in (sb-ext:posix-environ) thereis (string-include "LAPTOP" item))) + +(defun insert-seperators (l &optional (seperator " | ") (seperated-list (list seperator))) + (if (car l) + (insert-seperators (cdr l) seperator (nconc (list seperator (car l)) seperated-list)) + (reverse seperated-list))) diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..d3893c4 --- /dev/null +++ b/.vimrc @@ -0,0 +1,30 @@ +syntax on + +set autoindent +set nowrap +set backspace=indent,eol,start + +set tabstop=2 +set shiftwidth=2 +set expandtab + +set cursorline +set number relativenumber + +set laststatus=2 +set statusline= +set statusline+=\ %f +set statusline+=%= +set statusline+=\ %{&fileencoding?&fileencoding:&encoding} +set statusline+=\[%{&fileformat}\] +set statusline+=\ %p%% +set statusline+=\ %l:%c + +highlight Normal ctermbg=NONE +highlight nonText ctermbg=NONE +highlight CursorLine ctermbg=255 ctermfg=NONE +highlight StatusLine ctermbg=255 +highlight StatusLineTerm ctermbg=238 ctermfg=255 +highlight StatusLineTermNC ctermbg=232 ctermfg=238 + +set encoding=utf-8 diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..f38221f --- /dev/null +++ b/.zshrc @@ -0,0 +1,52 @@ +PATH=$PATH:$HOME/scripts:/usr/local/i386elfgcc/bin/:$HOME/.local/bin:/usr/local/opt/binutils/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:$HOME/.elixir-ls/release:$HOME/.rowswell/bin + +# Print a random ascii arts from ~/ascii-arts +if [ -d "$HOME/ascii-arts" ] +then + echo + echo "=======" + logo="$(find $HOME/ascii-arts/* | shuf -n1)" + printf "$(echo $logo | grep -o "[0-9a-zA-Z+\-\.]*$")\n" + echo "=======" + printf "$(cat $logo)\n\n" +fi + +alias ..="cd .." +alias gc="git checkout" +alias gcm="git commit -S -m" +alias gb="git branch" +alias gbm="git branch -m" +alias ga="git add" +alias gaa="git add ." +alias gpl="git pull" +alias gps="git push" +alias gm="git merge" +alias gss="git status" +alias gsh="git stash" +alias gl="git log" + +alias sbcl="rlwrap sbcl" +# Muscle memory is killing me man +alias vim="nvim" +alias startx="sway" + +export TERM=xterm-256color + +# Alt+b stops at forwardslashes +backward-kill-dir () { + local WORDCHARS=${WORDCHARS/\/} + zle backward-kill-word + zle -f kill +} +zle -N backward-kill-dir +bindkey '^[^?' backward-kill-dir + +# ZSH programs +source ~/zsh-stuff/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source ~/zsh-stuff/spaceship-prompt/spaceship.zsh + +# History +HISTFILE=~/.zsh_history +HISTSIZE=10000 +SAVEHIST=10000 +setopt appendhistory diff --git a/ascii-arts/bat.txt b/ascii-arts/bat.txt new file mode 100644 index 0000000..990ac90 --- /dev/null +++ b/ascii-arts/bat.txt @@ -0,0 +1,7 @@ + =/\ /\= + / \'._ (\_/) _.'/ \ + / .''._'--(o.o)--'_.''. \ + /.' _/ |`'=/ " \='`| \_ `.\ + /` .' `\;-,'\___/',-;/` '. '\ +/.-' `\(-V-)/` `-.\ +` " " ` diff --git a/ascii-arts/bear.txt b/ascii-arts/bear.txt new file mode 100644 index 0000000..44642d6 --- /dev/null +++ b/ascii-arts/bear.txt @@ -0,0 +1,12 @@ + (()__(() + / \ + ( / \ \ + \ o o / + (_()_)__/ \ + / _,==.____ \ + ( |--| ) + /\_.|__|'-.__/\_ + / ( / \ + \ \ ( / + ) '._____) / +(((____.--(((____/ diff --git a/ascii-arts/bsd.txt b/ascii-arts/bsd.txt new file mode 100644 index 0000000..d70655d --- /dev/null +++ b/ascii-arts/bsd.txt @@ -0,0 +1,19 @@ + , , + /( )` + \ \___ / | + /- _ `-/ ' + (/\/ \ \ /\ + / / | ` \ + O O ) / | + `-^--'`< ' + TM (_.) _ ) / +| | |\ | ~|~ \ / `.___/` / +| | | \ | | X `-----' / +`__| | \| _|_ / \ <----. __ / __ \ + <----|====O)))==) \) /==== + <----' `--' `.__,' \ + | | + \ / + ______( (_ / \______ + ,' ,-----' | \ + `--{__________) \/ diff --git a/ascii-arts/c++.txt b/ascii-arts/c++.txt new file mode 100644 index 0000000..51add1c --- /dev/null +++ b/ascii-arts/c++.txt @@ -0,0 +1,23 @@ + .-.` + `.://////:.` + .-//////////////-. + `-:////////////////////:-` + `.-///////+oyhdmmmmdhyo+///////-.` +`-:///////+ymMMMMMMMMMMMMMMmy+///////:-` +////////+hMMMMMMMMMMMMMMMMMMMMh+///////: +///////sNMMMMMMMMMNNNNMMMMMMMMMNo/////// +//////sMMMMMMMMds+////+sdMMMNdy+//////// +/////+NMMMMMMm+//////////+ys+//////++/// +/////yMMMMMMN+/////////////dMy////yMd/// +/////hMMMMMMm////////////mMMMMMyhMMMMMm/ +/////yMMMMMMN+//:::::::////dMy////yMd/// +/////+NMMMMMMm/::::::::::/hs+//////++/// +//////sMMMMMMMMho/::::/ohMMMMmho//////// +/////::+NMMMMMMMMMNNNNMMMMMMMMMN+:////// +:/:::::::yMMMMMMMMMMMMMMMMMMMMy:::::::/: + .-::::::::sdMMMMMMMMMMMMMMds::::::::-. + `.-:::::::+shddmmddhs+:::::::-.` + `.-::::::::::::::::::::-.` + `.-::::::::::::-.` + `.-::::::-.` + `..` diff --git a/ascii-arts/calvin-and-hobbes.txt b/ascii-arts/calvin-and-hobbes.txt new file mode 100644 index 0000000..cbf24e0 --- /dev/null +++ b/ascii-arts/calvin-and-hobbes.txt @@ -0,0 +1,14 @@ + __:.__ + (_:..'"= + ::/ o o\ AHAH! + ;'-' (_) Spaceman Spiff . + '-._ ;-' wins again ! _'._|\/: + .:; ; . '- ' /_ + :.. ; ;, \ _/, "_< + :.|..| ;: \__ '._____ _) + :.|.'| || _/ / + :.|..| :' `;--: + '.|..|:': _ _ _ :|_\: + .. _:|__| '.\.''..' ) ___________ ( )_):|_|: +:....::''::/ | : :|''| "/ /_=_=_=_=_=/ :_[__'_\3_) + '''' '-''-'-'.__)-' diff --git a/ascii-arts/city.txt b/ascii-arts/city.txt new file mode 100644 index 0000000..6609078 --- /dev/null +++ b/ascii-arts/city.txt @@ -0,0 +1,9 @@ + .| + | | + |'| ._____ + ___ | | |. |' .---"| + _ .-' '-. | | .--'| || | _| | + .-'| _.| | || '-__ | | | || | + |' | |. | || | | | | || | + ___| '-' ' "" '-' '-.' '` |____ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/ascii-arts/emacs.txt b/ascii-arts/emacs.txt new file mode 100644 index 0000000..39a3137 --- /dev/null +++ b/ascii-arts/emacs.txt @@ -0,0 +1,23 @@ + mddhysssssssssyyhdm + mhyso++++++++++oooooossydm + mhyo++++++++++++oooooooooooosydm + mhso++++++++++++/::-.`` `.:ooooosydm + dyo++++++++++oo+++++++/: `ooooooshd + mhs+++++++++//::::---..`` `ooooooooyd + mho++++++++. ``....---/ooooooooooyd + ho++++++oo+- ./+oooooooooooooooooooossyd + dy+++++oooooo/. `:+ooooooooooooooooosssssshm + ho+oooooooooooo+/-` `.:+ooooooooooossssssssyd + mhooooooooooooooooo+/-.` .:+ooooosssssssssssd + dyooooooooooo/:-.` `.-:/ossssssssssssssd + mhoooooooo/- `-:/+ooossssssssssssssssssd + hooooooo- `:ooooooosssssssssssssssssssyd + dyoooooo `oooooosssssssssssssssssssssshm + hsooooo+. .:+oossssssssssssssssssssssyd + mhsoooooo+:-` `````......-:+ssssssyd + mhsoooooooooo+/:----------. `:sssssyd + dysoooosssssssssso+/:-.``.-:/osssssshm + mhyssssssso++/::://++ossssssssssshd + mdysssssssssssssssssssssssssyhd + mdhyssssssssssssssssssyhdm + mmdhhyyyyyyyyyhhdmm diff --git a/ascii-arts/floppy.txt b/ascii-arts/floppy.txt new file mode 100644 index 0000000..16ad8c7 --- /dev/null +++ b/ascii-arts/floppy.txt @@ -0,0 +1,10 @@ +.-.-----------.-. +| |-----------|#| +| |-----------| | +| |-----------| | +| |-----------| | +| "-----------' | +| .-----.-.. | +| | | || ||| +| | | || \/| +"--^-----^-^^---' diff --git a/ascii-arts/gameboy.txt b/ascii-arts/gameboy.txt new file mode 100644 index 0000000..3a7b035 --- /dev/null +++ b/ascii-arts/gameboy.txt @@ -0,0 +1,15 @@ + _____________ +| _"_________ | +||.---------.|| +||| ||| +||| ||| +||| ||| +||'---------'/| +| """"""""""` | +| || ^^^ () | +|[ ] () | +| || | +| _ _ | +| :::| +| .::'/ +'""""""""""""` diff --git a/ascii-arts/piglet.txt b/ascii-arts/piglet.txt new file mode 100644 index 0000000..bd22b0c --- /dev/null +++ b/ascii-arts/piglet.txt @@ -0,0 +1,10 @@ + _ + _<_/_ + __/ _> + '\ ' | + \___/ + /+++\ + o=|..|..| + | o/..| +0==|+++++| + 0======/ diff --git a/ascii-arts/pooh-bear.txt b/ascii-arts/pooh-bear.txt new file mode 100644 index 0000000..0a6688a --- /dev/null +++ b/ascii-arts/pooh-bear.txt @@ -0,0 +1,14 @@ + _ + __( )_ +( (o____ + | | + | (__/ + \ / ___ + / \ \___/ + / ^ / \ +| | |__|_HUNNY | +| \______)____/ + \ / + \ /_ + | ( __) + (____) diff --git a/ascii-arts/python.txt b/ascii-arts/python.txt new file mode 100644 index 0000000..678afe7 --- /dev/null +++ b/ascii-arts/python.txt @@ -0,0 +1,26 @@ + + .-://++++++++++/:-.` + -/+++++++++++++++++++/:. + +++:` .++++++++++++++++/` + +++: .++++++++++++++///- + +++++++++++++++++++/////- + ::::::::::-:+++++///////- + `--------------------+++/////////-.yyssss+- + ./+++++++++++++++++++++////////////--ddddddddy` + :++++++++++++++++++++++/////////////--dddddddddh` +-+++++++++++++++++++++///////////////.:dddddddddds +/+++++++++++++++++++////////////////:`yddddddddddd ++++++++++++++++++/////////////////:..sdddddddddddd ++++++++++++++/:-.-:////////////::-/sdddddddddddddd +++++++++++++:`:sdmdddddddddddddddddddddddddddddddd +/++++++++++/ ommmddddddddddddddddddddddddddddddddd +-++++++++//:`mmdddddddddddddddddddddddddddddddddd+ + :++++++///:`dddddddddddddddddddddddddddddddddddy` + -/++/////:`dddddddddddddddddddddddddddddddddy: + `.::::::-`dddddddddddds++++++++++++++++++/. + `ddddddddddddhyyyyyyyyyyy/ + `dddddddddddddddddddddddd/ + `ddddddddddddddddd: `+ddd/ + `hdddddddddddddddd/``+ddd/ + `oddddddddddddddddddddh+ + `:+syhdddddddddyy++-` diff --git a/ascii-arts/rubiks.txt b/ascii-arts/rubiks.txt new file mode 100644 index 0000000..820ad94 --- /dev/null +++ b/ascii-arts/rubiks.txt @@ -0,0 +1,7 @@ + _ _ _ + /_/_/_/\ + /_/_/_/\/\ +/_/_/_/\/\/\ +\_\_\_\/\/\/ + \_\_\_\/\/ + \_\_\_\/ diff --git a/ascii-arts/tux.txt b/ascii-arts/tux.txt new file mode 100644 index 0000000..1ee2481 --- /dev/null +++ b/ascii-arts/tux.txt @@ -0,0 +1,16 @@ + _nnnn_ + dGGGGMMb ,"""""""""""""". + @p~qp~~qMb | Linux Rules! | + M|@||@) M| _;..............' + @,----.JM| -' + JS^\__/ qKL + dZP qKRb + dZP qKKb + fZP SMMb + HZM MMMM + FqM MMMM + __| ". |\dS"qML + | `. | `' \Zq +_) \.___.,| .' +\____ )MMMMMM| .' + `-' `--' diff --git a/ascii-arts/vim.txt b/ascii-arts/vim.txt new file mode 100644 index 0000000..eb117f3 --- /dev/null +++ b/ascii-arts/vim.txt @@ -0,0 +1,23 @@ + -o/- + sdddddddddddddddo :///+- yhhhhhhhhhhhhhhh: + hhhhdddddddddhhh+ -/////- dhhhddddddddddds/ + ``.dddddddddho:.`.://///:.`-yhdddddddddy+- + `dddddddddho- ////////-.omdddddddddy+- + `dddddddddho- /////:-.omdddddddddy+- + `dddddddddho- ///:-.smdddddddddyo- + `dddddddddho- /:-.smdddddddddyo-`- + `dddddddddho- ..smdddddddddho:`-:++- + --`dddddddddho-`smdddddddddho:`-:////++- + -so.`dddddddddhosmdddddddddho:`.:////////++- + :+:/.`dddddddddhodddddddddho:`.:///////////:/: + `-:.`dddddddddddddddddhs+:`.:////////////:.` + ```ddddddddddddddddy/hh::////////////:.` + `ddddddddddddddhs./++-///////////:.` + `dddddddddddddo::-::-:-///-:::/:.` .--` + `ddddddddddds/`.odd+-:.hddhssdddhsydddo + `ddddddddds/`.:-ddy./-+dd--..ddo```ydd. + `dddddddy/.`:/.ydd.::-dd/-.`sdh` :dd+ + `dddddy/. `-:-odd/-/.ydy`` :dd: `hdy + +/++/. ``ooo/.:-o+/ /++. -++/` + `-::/-.` + `-.` diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..96403d3 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +__pycache__/* diff --git a/scripts/ascii-table.py b/scripts/ascii-table.py new file mode 100755 index 0000000..c605853 --- /dev/null +++ b/scripts/ascii-table.py @@ -0,0 +1,5 @@ +#!/usr/bin/python3 + +rows = (128-32) // 4 +for i in range(rows): + print("".join(list(map(lambda x: str(x*rows+i+32).ljust(5) + str(chr(x*rows + i + 32)).strip().ljust(2) + "|", range(4))))) diff --git a/scripts/mediaplayer.py b/scripts/mediaplayer.py new file mode 100755 index 0000000..9d422d5 --- /dev/null +++ b/scripts/mediaplayer.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +import argparse +import logging +import sys +import signal +import gi +import json +import threading +gi.require_version('Playerctl', '2.0') +from gi.repository import Playerctl, GLib + +logger = logging.getLogger(__name__) + +cache = {"i": 0, "stopped": True, "text": "Initializing"} + +print_thread = None + +def wrap_text(text, width, update): + if len(text) <= width: + return text + t = text + " | " + n = update % len(t) + return "".join((t[n:] + t[:n])[0:width]) + +def print_from_cache(): + if cache["stopped"]: + cache["text"] = " " + cache["text"] + + sys.stdout.write(json.dumps(cache) + '\n') + sys.stdout.flush() + +def print_every_second(width, period=1): + global print_thread + + print_thread = threading.Timer(period, print_every_second, [width, period]) + print_thread.start() + + cache["i"] += 1 + cache["text"] = wrap_text(cache["formattedText"], width, cache["i"]) + + print_from_cache() + +def save_in_cache(formattedText, player): + logger.info('Writing output') + + cache["formattedText"] = formattedText + cache["class"] = f"custom-{player.props.player_name}" + cache["alt"] = player.props.player_name + + +def on_play(player, status, manager): + logger.info('Received new playback status') + on_metadata(player, player.props.metadata, manager) + +def on_metadata(player, metadata, manager): + logger.info('Received new metadata') + cache["stopped"] = False + track_info = '' + + if player.props.player_name == 'spotify' and \ + 'mpris:trackid' in metadata.keys() and \ + ':ad:' in player.props.metadata['mpris:trackid']: + track_info = 'AD PLAYING' + elif player.get_artist() != '' and player.get_title() != '': + track_info = '{artist} - {title}'.format(artist=player.get_artist(), + title=player.get_title()) + else: + track_info = player.get_title() + + if player.props.status != 'Playing' and track_info: + cache["stopped"] = True + + save_in_cache(track_info, player) + print_from_cache() + + +def on_player_appeared(manager, player, selected_player=None): + if player is not None and (selected_player is None or player.name == selected_player): + cache["stopped"] = False + init_player(manager, player) + else: + logger.debug("New player appeared, but it's not the selected player, skipping") + + +def on_player_vanished(manager, player): + logger.info('Player has vanished') + cache["stopped"] = True + sys.stdout.write('\n') + sys.stdout.flush() + + +def init_player(manager, name): + logger.debug('Initialize player: {player}'.format(player=name.name)) + player = Playerctl.Player.new_from_name(name) + player.connect('playback-status', on_play, manager) + player.connect('metadata', on_metadata, manager) + manager.manage_player(player) + on_metadata(player, player.props.metadata, manager) + + +def signal_handler(sig, frame): + logger.debug('Received signal to stop, exiting') + cache["stopped"] = True + print_thread.cancel() + sys.stdout.write('\n') + sys.stdout.flush() + # loop.quit() + sys.exit(0) + + +def parse_arguments(): + parser = argparse.ArgumentParser() + + # Increase verbosity with every occurrence of -v + parser.add_argument('-v', '--verbose', action='count', default=0) + + # Define for which player we're listening + parser.add_argument('--player') + + parser.add_argument('--width', default=20) + parser.add_argument('--period', default=1) + + return parser.parse_args() + + +def main(): + arguments = parse_arguments() + + # Initialize logging + logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, + format='%(name)s %(levelname)s %(message)s') + + # Logging is set by default to WARN and higher. + # With every occurrence of -v it's lowered by one + logger.setLevel(max((3 - arguments.verbose) * 10, 0)) + + # Log the sent command line arguments + logger.debug('Arguments received {}'.format(vars(arguments))) + + manager = Playerctl.PlayerManager() + loop = GLib.MainLoop() + + manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) + manager.connect('player-vanished', on_player_vanished) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + for player in manager.props.player_names: + if arguments.player is not None and arguments.player != player.name: + logger.debug('{player} is not the filtered player, skipping it' + .format(player=player.name) + ) + continue + + init_player(manager, player) + + print_every_second(int(arguments.width), float(arguments.period)) + loop.run() + + +if __name__ == '__main__': + main() + diff --git a/scripts/songnotification b/scripts/songnotification new file mode 100755 index 0000000..ea5cc00 --- /dev/null +++ b/scripts/songnotification @@ -0,0 +1,4 @@ +#!/bin/sh +song=$(playerctl metadata --format "{{ title }}\n{{ artist }}\n{{ album }}") +notify-send "Spotify" "$song" #--icon=~/.config/spotifyd/penguin.jpg +