diff options
59 files changed, 1286 insertions, 132 deletions
@@ -1,4 +1,4 @@ -all_files := basics emacs spacemacs doom-emacs git i3wm vim nvim tmux x zsh fish +all_files := basics emacs spacemacs doom-emacs git i3wm bspwm vim nvim tmux x zsh fish simple_files := emacs spacemacs doom-emacs vim x zsh fish @@ -12,12 +12,19 @@ $(simple_files): basics: yay yay -Q - < meta/basic_deps || yay -S --needed - < meta/basic_deps stow -t ~ $@ + git: pacman -Q git || sudo pacman -S git stow -t ~ $@ + i3wm: yay pacman -Q - < meta/i3wm_deps || yay -S --needed - < meta/i3wm_deps stow -t ~ $@ + +bspwm: yay + pacman -Q - < meta/bspwm_deps || yay -S --needed - < meta/bspwm_deps + stow -t ~ $@ + yay: git pacman -Q yay || (git clone aur:yay && pushd yay && makepkg -si && popd) diff --git a/basics/.config/alacritty/alacritty.yml b/basics/.config/alacritty/alacritty.yml index 8c2ad85..aba774a 100644 --- a/basics/.config/alacritty/alacritty.yml +++ b/basics/.config/alacritty/alacritty.yml @@ -59,15 +59,6 @@ scrolling: # scrollback is enabled (history > 0). multiplier: 3 - # Faux Scrolling - # - # The `faux_multiplier` setting controls the number of lines the terminal - # should scroll when the alternate screen buffer is active. This is used - # to allow mouse scrolling for applications like `man`. - # - # Specifying `0` will disable faux scrolling. - faux_multiplier: 3 - # Scroll to the bottom when new text is written to the terminal. auto_scroll: false diff --git a/basics/.bin/battery-monitor b/basics/.local/bin/battery-monitor index ff1ef8b..ff1ef8b 100755 --- a/basics/.bin/battery-monitor +++ b/basics/.local/bin/battery-monitor diff --git a/basics/.local/bin/edit-config b/basics/.local/bin/edit-config new file mode 100755 index 0000000..7d1baae --- /dev/null +++ b/basics/.local/bin/edit-config @@ -0,0 +1,6 @@ +#/bin/sh + +FILE=$(locate-config) +[ -z "$FILE" ] && exit 1 + +$EDITOR $FILE diff --git a/basics/.local/bin/locate-config b/basics/.local/bin/locate-config new file mode 100755 index 0000000..d798a39 --- /dev/null +++ b/basics/.local/bin/locate-config @@ -0,0 +1,24 @@ +#! /usr/bin/env bash + +set -e + +CONFIG_FILES=`ls -1 ~/.local/share/config-files | cut -d "" -f 1 | sort -d` +CONFIG_ARRAY=(`find ~/.local/share/config-files/ -maxdepth 1 -mindepth 1 -print0 | sort -z | xargs -r0 echo`) + +INDEX=`echo "$CONFIG_FILES" | rofi -dmenu -format "i" -no-custom -mesg "Find config file for..."` +[ -z "$INDEX" ] && exit 1 +SOURCE=${CONFIG_ARRAY[$INDEX]} +#echo "$CONFIG_FILES" +#for item in ${CONFIG_ARRAY[*]} +#do +# printf " %s\n" $item +#done +# (https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself) +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + +echo $SOURCE diff --git a/basics/.local/share/config-files/alacritty b/basics/.local/share/config-files/alacritty new file mode 120000 index 0000000..2f6fb52 --- /dev/null +++ b/basics/.local/share/config-files/alacritty @@ -0,0 +1 @@ +../../../.config/alacritty/alacritty.yml
\ No newline at end of file diff --git a/basics/.local/share/config-files/dotfiles b/basics/.local/share/config-files/dotfiles new file mode 120000 index 0000000..11a54ed --- /dev/null +++ b/basics/.local/share/config-files/dotfiles @@ -0,0 +1 @@ +../../../../
\ No newline at end of file diff --git a/basics/.local/share/config-files/dunst b/basics/.local/share/config-files/dunst new file mode 120000 index 0000000..0faa1f8 --- /dev/null +++ b/basics/.local/share/config-files/dunst @@ -0,0 +1 @@ +../../../.config/dunst/dunstrc
\ No newline at end of file diff --git a/basics/.local/share/config-files/kitty b/basics/.local/share/config-files/kitty new file mode 120000 index 0000000..71c3f1a --- /dev/null +++ b/basics/.local/share/config-files/kitty @@ -0,0 +1 @@ +../../../.config/kitty/kitty.conf
\ No newline at end of file diff --git a/basics/.local/share/config-files/ranger b/basics/.local/share/config-files/ranger new file mode 120000 index 0000000..5ecd95a --- /dev/null +++ b/basics/.local/share/config-files/ranger @@ -0,0 +1 @@ +../../../.config/ranger/rc.conf
\ No newline at end of file diff --git a/basics/.local/share/config-files/rofi b/basics/.local/share/config-files/rofi new file mode 120000 index 0000000..2695e7e --- /dev/null +++ b/basics/.local/share/config-files/rofi @@ -0,0 +1 @@ +../../../.config/rofi/config
\ No newline at end of file diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc new file mode 100755 index 0000000..b514a7a --- /dev/null +++ b/bspwm/.config/bspwm/bspwmrc @@ -0,0 +1,31 @@ +#! /bin/sh + +# reset polybar +$HOME/.config/polybar/launch.sh & + +# Autostart +[[ ! $(pidof -x sxhkd) ]] && sxhkd & +[[ ! $(pidof -x compton) ]] && compton & +[[ ! $(pidof -x nm-applet) ]] && nm-applet & +[[ ! $(pidof -x feh ) ]] && feh --bg-scale "$HOME/.local/share/images/wallpaper.jpg" & + +# locker +[[ ! $(pidof -x xautolock) ]] && xautolock -locker "$HOME/.local/share/scripts/lock.sh" -time 60 -detectsleep -notify 10 & + +bspc monitor -d I II III IV V VI VII VIII IX X + +bspc config border_width 2 +bspc config window_gap 12 + +bspc config split_ratio 0.52 +bspc config borderless_monocle true +bspc config gapless_monocle true + +bspc rule -a Gimp desktop='^8' state=floating follow=on +bspc rule -a Chromium desktop='^2' +bspc rule -a mplayer2 state=floating +bspc rule -a Kupfer.py focus=on +bspc rule -a Screenkey manage=off + +bspc rule -a scratchpad sticky=on state=floating hidden=on +alacritty --class scratchpad,scratchpad -e ~/code/dotfiles/bspwm/.bin/scratch & diff --git a/bspwm/.config/polybar/config b/bspwm/.config/polybar/config new file mode 100644 index 0000000..05d6334 --- /dev/null +++ b/bspwm/.config/polybar/config @@ -0,0 +1,637 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/jaagr/polybar +; +; The README contains alot of information +; +;========================================================== + +[colors] +;background = ${xrdb:color0:#222} +background = #222 +background-alt = #444 +;foreground = ${xrdb:color7:#222} +foreground = #dfdfdf +foreground-alt = #555 +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +[bar/topbar] +monitor = ${env:MONITOR:eDP-1} +width = 100% +height = 40 +dpi = 96 +;offset-x = 1% +;offset-y = 1% +radius = 6.0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = #f00 + +border-size = 10 +border-bottom-size = 0 +border-color = #00000000 + +padding-left = 2 +padding-right = 2 + +font-0 = fixed:pixelsize=10;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = siji:pixelsize=10;1 +font-3 = "Font Awesome 5 Brands:style=Regular:pixelsize=8;1" +font-4 = "Font Awesome 5 Free:style=Regular:pixelsize=8;1" +font-5 = "Font Awesome 5 Free:style=Solid:pixelsize=8;1" + +tray-position = right +tray-padding = 2 +;tray-transparent = true +;tray-background = #0063ff +tray-scale = 1 +tray-detached = false + +wm-restack = bspwm +override-redirect = false + +scroll-up = bspwm-desknext +scroll-down = bspwm-deskprev +cursor-click = pointer +cursor-scroll = ns-resize + +module-margin-left = 2 +module-margin-right = 2 +modules-left = hostname xwindow +modules-center = +modules-right = filesystem backlight pulseaudio xkeyboard memory cpu wlan eth ethvpn battery temperature + +[bar/topbar-second] +monitor = ${env:MONITOR:eDP-1} +width = 100% +height = 40 +dpi = 96 +;offset-x = 1% +offset-y = 50 +radius = 6.0 +fixed-center = true + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = #f00 + +border-size = 10 +border-top-size = 0 +border-bottom-size = 0 +border-color = #00000000 + +padding-left = 2 +padding-right = 2 + +font-0 = fixed:pixelsize=10;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = siji:pixelsize=10;1 +font-3 = "Font Awesome 5 Brands:style=Regular:pixelsize=8;1" +font-4 = "Font Awesome 5 Free:style=Regular:pixelsize=8;1" +font-5 = "Font Awesome 5 Free:style=Solid:pixelsize=8;1" + +wm-restack = bspwm +override-redirect = false + +scroll-up = bspwm-desknext +scroll-down = bspwm-deskprev +cursor-click = pointer +cursor-scroll = ns-resize + +module-margin-left = 2 +module-margin-right = 2 +modules-left = bspwm +modules-center = spotify +modules-right = taskwarrior date + +[module/hostname] +type = custom/script +interval = 256 +format = "<label> " +"format-prefix = " " +format-prefix = " ƸӜƷ " +format-prefix-foreground = ${colors.secondary} +format-padding = 0 +exec = echo "$(uname -n)" + +[module/spotify] +type = custom/script +exec = spotifycl status +tail = true +format = <label> +format-foreground = ${colors.foreground-alt} +format-underline = ${colors.primary} +click-right = playerctl play-pause +click-left = playerctl play-pause +click-middle = playerctl next +scroll-up = playerctl next +scroll-down = playerctl previous +label-maxlen = 120 +label-ellipsis = true + +[module/xwindow] +type = internal/xwindow +label = %title:0:40:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format = <label-layout> +format-prefix = " " +format-prefix-foreground = ${colors.foreground} +format-prefix-underline = ${colors.secondary} + +label-layout = %name% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm + +pin-workspaces = true +inline-mode = false +enable-click = true +enable-scroll = false +reverse-scroll = false +fuzzy-matching = true + +; Available tags: +; <label-monitor> +; <label-state> - gets replaced with <label-(focused|urgent|occupied|empty)> +; <label-mode> - gets replaced with +; <label-(monocle|tiled|fullscreen|floating|locked|sticky|private)> +; Default: <label-state> +format = <label-state> <label-mode> + +; Available tokens: +; %name% +; Default: %name% +label-monitor = %name% + +; If any values for label-dimmed-N are defined, the workspace/mode +; colors will get overridden with those values if the monitor is out of focus +; To only override workspaces in a specific state, use: +; label-dimmed-focused +; label-dimmed-occupied +; label-dimmed-urgent +; label-dimmed-empty +label-dimmed-foreground = #555 +label-dimmed-underline = ${colors.background} +label-dimmed-focused-background = #f00 + +; Available tokens: +; %name% +; %icon% +; %index% +; Default: %icon% %name% +label-focused = %icon% %name% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +; Available tokens: +; %name% +; %icon% +; %index% +; Default: %icon% %name% +label-occupied = %icon% %name% +label-occupied-padding = 2 + +; Available tokens: +; %name% +; %icon% +; %index% +; Default: %icon% %name% +label-urgent = %icon% %name%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +; Available tokens: +; %name% +; %icon% +; %index% +; Default: %icon% %name% +label-empty = %icon% %name% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 0 + +; The following labels will be used to indicate the layout/mode +; for the focused workspace. Requires <label-mode> +; +; Available tokens: +; None +;label-monocle = +;label-tiled = +;label-fullscreen = +;label-floating = +;label-pseudotiled = P +;label-locked = +;label-locked-foreground = #bd2c40 +;label-sticky = +;label-sticky-foreground = #fba922 +;label-private = +;label-private-foreground = #bd2c40 +;label-marked = M + +; Separator in between workspaces +label-separator = +label-separator-padding = 0 +label-separator-foreground = #ffb52a + +[module/i3] +type = internal/i3 +; Only show workspaces on the same output as the bar +pin-workspaces = true +strip-wsnumbers = true +format = <label-state> <label-mode> +index-sort = true +wrapping-scroll = false + +label-mode = %mode% +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %name% +label-focused-background = ${module/bspwm.label-focused-background} +label-focused-underline = ${module/bspwm.label-focused-underline} +label-focused-padding = ${module/bspwm.label-focused-padding} + +; unfocused = Inactive workspace on any monitor +label-unfocused = %name% +label-unfocused-padding = ${module/bspwm.label-occupied-padding} + +; visible = Active workspace on unfocused monitor +label-visible = %name% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %name% +label-urgent-background = ${module/bspwm.label-urgent-background} +label-urgent-padding = ${module/bspwm.label-urgent-padding} + +; Separator in between workspaces +; label-separator = | + + +[module/taskwarrior] +interval = 30 +type = custom/script +exec = $HOME/.config/polybar/task_polybar.sh +format = <label> +format-foreground = #FFF +format-prefix = "§ " +click-left = task "$((`cat /tmp/tw_polybar_id`))" done + +[module/line-l] +type = custom/text +content = "____[ " +content-foreground = ${colors.primary} + +[module/line-r] +type = custom/text +content = " ]____" +content-foreground = ${colors.primary} + +[module/mpd] +type = internal/mpd +format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next> + +icon-prev = +icon-stop = +icon-play = +icon-pause = +icon-next = + +label-song-maxlen = 25 +label-song-ellipsis = true + +[module/backlight] +type = internal/backlight +card = intel_backlight +format = <label> <ramp> +label = "" + +ramp-0 = 🌕 +ramp-1 = 🌔 +ramp-2 = 🌓 +ramp-3 = 🌒 +ramp-4 = 🌑 + +bar-width = 10 +bar-indicator = | +bar-indicator-foreground = #fff +bar-indicator-font = 2 +bar-fill = ─ +bar-fill-font = 2 +bar-fill-foreground = #9f78e1 +bar-empty = ─ +bar-empty-font = 2 +bar-empty-foreground = ${colors.foreground-alt} + +[module/xbacklight] +type = internal/xbacklight + +format = <label> <bar> +label = + +bar-width = 10 +bar-indicator = | +bar-indicator-foreground = #fff +bar-indicator-font = 2 +bar-fill = ─ +bar-fill-font = 2 +bar-fill-foreground = #9f78e1 +bar-empty = ─ +bar-empty-font = 2 +bar-empty-foreground = ${colors.foreground-alt} + +[module/backlight-acpi] +inherit = module/xbacklight +type = internal/backlight +card = intel_backlight + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.foreground} +format-underline = #f90000 +label = %percentage:2%% + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.foreground} +format-underline = #4bffdc +label = %percentage_used%% + +[module/wlan] +type = internal/network +interface = wlp3s0 +interval = 3.0 +accumulate-stats = true + +format-connected-prefix = " " +format-connected = <label-connected> +format-connected-underline = #9f78e1 +label-connected = %essid% %local_ip% ↓%downspeed% ↑%upspeed% (%signal%) + +format-disconnected = +;format-disconnected = <label-disconnected> +;format-disconnected-underline = ${self.format-connected-underline} +;label-disconnected = %ifname% disconnected +;label-disconnected-foreground = ${colors.foreground-alt} + +ramp-signal-0 = +ramp-signal-foreground = ${colors.foreground-alt} + +[module/eth] +type = internal/network +interface = eno1 +interval = 3.0 +accumulate-stats = true + +format-connected-underline = #55aa55 +format-connected-prefix = " " +format-connected-prefix-foreground = ${colors.foreground} +label-connected = %local_ip% ↓%downspeed% ↑%upspeed% ↕%linkspeed% + +format-disconnected = +;format-disconnected = <label-disconnected> +;format-disconnected-underline = ${self.format-connected-underline} +;label-disconnected = %ifname% disconnected +;label-disconnected-foreground = ${colors.foreground-alt} + +[module/ethvpn] +type = internal/network +interface = tun0 +interval = 3.0 +accumulate-stats = true + +format-connected-underline = #55aa55 +format-connected-prefix = "" +format-connected-prefix-foreground = ${colors.foreground} +label-connected = %local_ip% %local_ip6% + +format-disconnected = +;format-disconnected = <label-disconnected> +;format-disconnected-underline = ${self.format-connected-underline} +label-disconnected = %ifname% disconnected +;label-disconnected-foreground = ${colors.foreground-alt} + +[module/date] +type = internal/date +interval = 1 + +date = +date-alt = " %Y-%m-%d" + +time = %H:%M:%S +time-alt = %H:%M:%S + +format-prefix = +format-prefix-foreground = ${colors.foreground} +format-underline = #0a6cf5 + +label = %date% %time% + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume = <label-volume> <bar-volume> +label-volume = %percentage%% +label-volume-foreground = ${root.foreground} + +label-muted = +label-muted-foreground = #666 + +bar-volume-width = 10 +bar-volume-foreground-0 = #55aa55 +bar-volume-foreground-1 = #55aa55 +bar-volume-foreground-2 = #55aa55 +bar-volume-foreground-3 = #55aa55 +bar-volume-foreground-4 = #55aa55 +bar-volume-foreground-5 = #f5a70a +bar-volume-foreground-6 = #ff5555 +bar-volume-gradient = false +bar-volume-indicator = | +bar-volume-indicator-font = 2 +bar-volume-fill = ─ +bar-volume-fill-font = 2 +bar-volume-empty = ─ +bar-volume-empty-font = 2 +bar-volume-empty-foreground = ${colors.foreground-alt} + +ramp-volume-0 = +ramp-volume-1 = + +[module/alsa] +type = internal/alsa + +format-volume = <label-volume> <bar-volume> +label-volume = VOL +label-volume-foreground = ${root.foreground} + +format-muted-foreground = ${colors.foreground-alt} +label-muted = + +bar-volume-width = 10 +bar-volume-foreground-0 = #55aa55 +bar-volume-foreground-1 = #55aa55 +bar-volume-foreground-2 = #55aa55 +bar-volume-foreground-3 = #55aa55 +bar-volume-foreground-4 = #55aa55 +bar-volume-foreground-5 = #f5a70a +bar-volume-foreground-6 = #ff5555 +bar-volume-gradient = false +bar-volume-indicator = | +bar-volume-indicator-font = 2 +bar-volume-fill = ─ +bar-volume-fill-font = 2 +bar-volume-empty = ─ +bar-volume-empty-font = 2 +bar-volume-empty-foreground = ${colors.foreground-alt} + +[module/battery] +type = internal/battery +time-format = %H:%M +battery = BAT0 +adapter = AC +full-at = 89 + +format-charging = <animation-charging> <label-charging> +format-charging-underline = #ffb52a +label-charging = %percentage%% | %time% + +format-discharging = <animation-discharging> <label-discharging> +format-discharging-underline = ${self.format-charging-underline} +label-discharging = %percentage%% | %time% + +format-full = +format-full-foreground = ${colors.foreground} +format-full-underline = ${self.format-charging-underline} + +ramp-capacity-0 = +ramp-capacity-1 = +ramp-capacity-2 = +ramp-capacity-3 = +ramp-capacity-4 = +ramp-capacity-foreground = ${colors.foreground-alt} + +animation-charging-0 = +animation-charging-1 = +animation-charging-2 = +animation-charging-3 = +animation-charging-4 = +animation-charging-foreground = ${colors.foreground} +animation-charging-framerate = 750 + +animation-discharging-0 = +animation-discharging-1 = +animation-discharging-2 = +animation-discharging-3 = +animation-discharging-4 = +animation-discharging-foreground = ${colors.foreground} +animation-discharging-framerate = 1000 + +[module/temperature] +type = internal/temperature +thermal-zone = 0 +warn-temperature = 60 + +format = <ramp> <label> +format-underline = #f50a4d +format-warn = <ramp> <label-warn> +format-warn-underline = ${self.format-underline} + +label = %temperature-c% +label-warn = %temperature-c% +label-warn-foreground = ${colors.secondary} + +ramp-0 = +ramp-1 = +ramp-2 = +ramp-foreground = ${colors.foreground} + +[module/powermenu] +type = custom/menu + +expand-right = true + +format-spacing = 1 + +label-open = +label-open-foreground = ${colors.secondary} +label-close = cancel +label-close-foreground = ${colors.secondary} +label-separator = | +label-separator-foreground = ${colors.foreground-alt} + +menu-0-0 = reboot +menu-0-0-exec = menu-open-1 +menu-0-1 = power off +menu-0-1-exec = menu-open-2 +menu-0-2 = sleep +menu-0-2-exec = systemctl suspend + +menu-1-0 = cancel +menu-1-0-exec = menu-open-0 +menu-1-1 = reboot +menu-1-1-exec = sudo reboot + +menu-2-0 = power off +menu-2-0-exec = sudo poweroff +menu-2-1 = cancel +menu-2-1-exec = menu-open-0 + +[settings] +screenchange-reload = true +;compositing-background = xor +;compositing-background = screen +;compositing-foreground = source +;compositing-border = over + +[global/wm] +margin-top = 5 +margin-bottom = 5 + +; vim:ft=dosini diff --git a/bspwm/.config/polybar/launch.sh b/bspwm/.config/polybar/launch.sh new file mode 100755 index 0000000..c45e085 --- /dev/null +++ b/bspwm/.config/polybar/launch.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + +# Launch bar1 and bar2 +MONITOR=$(polybar -m|tail -n1|sed -e 's/:.*$//g') polybar topbar & +sleep 1 +MONITORS=$(polybar -m|sed -e 's/:.*$//g') +while read -r monitor; do + MONITOR=$monitor polybar topbar-second & + sleep 1 +done <<< $MONITORS + +echo "Bars launched..." diff --git a/bspwm/.config/polybar/task_polybar.sh b/bspwm/.config/polybar/task_polybar.sh new file mode 100755 index 0000000..555ff1b --- /dev/null +++ b/bspwm/.config/polybar/task_polybar.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +most_urgent_desc=`task rc.verbose: rc.report.next.columns:description rc.report.next.labels:1 limit:1 next` +most_urgent_id=`task rc.verbose: rc.report.next.columns:id rc.report.next.labels:1 limit:1 next` +most_urgent_due=`task rc.verbose: rc.report.next.columns:due.relative rc.report.next.labels:1 limit:1 next` +echo "$most_urgent_id" > /tmp/tw_polybar_id +echo "$most_urgent_desc · $most_urgent_due" diff --git a/bspwm/.config/sxhkd/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..48f764d --- /dev/null +++ b/bspwm/.config/sxhkd/sxhkdrc @@ -0,0 +1,146 @@ +# +# wm independent hotkeys +# + +# terminal emulator +super + Return + alacritty + +# program launcher +super + {space, x} + rofi -show {drun, run} + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# +# bspwm hotkeys +# + +# quit/restart bspwm +super + alt + {q,r} + bspc {quit,wm -r} + +# close and kill +super + {_,shift + }w + bspc node -{c,k} + +# alternate between the tiled and monocle layout +super + m + bspc desktop -l next + +# send the newest marked node to the newest preselected node +super + y + bspc node newest.marked.local -n newest.!automatic.local + +super + p + bspc node -n 'last.!automatic' + +# swap the current node and the biggest node +super + g + bspc node -s biggest.local + +super + {_,shift + }r + bspc node @/ --rotate {90,-90} + +super + o + bspc node -s @parent/ + +# state/flags +# + +# set the window state +super + {t,shift + t,s,f} + bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +super + ctrl + {m,x,y,z} + bspc node -g {marked,locked,sticky,private} + +# +# focus/swap +# + +# focus the node in the given direction +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# focus the node for the given path jump +super + {p,b,comma,period} + bspc node -f @{parent,brother,first,second} + +# focus the next/previous node in the current desktop +super + {_,shift + }c + bspc node -f {next,prev}.local + +# focus the next/previous desktop in the current monitor +super + bracket{left,right} + bspc desktop -f {prev,next}.local + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +super + {o,i} + bspc wm -h off; \ + bspc node {older,newer} -f; \ + bspc wm -h on + +# focus or send to the given desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# +# preselect +# + +# preselect the direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# cancel the preselection for the focused node +super + ctrl + space + bspc node -p cancel + +# cancel the preselection for the focused desktop +super + ctrl + shift + space + bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# +# move/resize +# + +# expand a window by moving one of its side outward +super + alt + {h,j,k,l} + bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} + +# contract a window by moving one of its side inward +super + alt + shift + {h,j,k,l} + bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} + +# move a floating window +super + {Left,Down,Up,Right} + bspc node -v {-20 0,0 20,0 -20,20 0} + + +# Media keys + +XF86Audio{Lower,Raise}Volume + pactl set-sink-mute 0 false && pactl set-sink-volume 0 {-,+}5% +XF86AudioMute + pactl set-sink-mute 0 toggle + +XF86MonBrightness{Down,Up} + brightnessctl s {5%-,+5%} + +XF86Audio{Play,Pause,Next,Prev} + playerctl {play-pause,pause,next,previous} + +super + shift + Delete + xautolock -locknow diff --git a/bspwm/.local/bin/rofi_goto_workspace b/bspwm/.local/bin/rofi_goto_workspace new file mode 100755 index 0000000..35e8762 --- /dev/null +++ b/bspwm/.local/bin/rofi_goto_workspace @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NAME=`rofi_workspace_prompt` +i3-msg workspace $NAME diff --git a/bspwm/.local/bin/rofi_moveto_workspace b/bspwm/.local/bin/rofi_moveto_workspace new file mode 100755 index 0000000..9cc0b9d --- /dev/null +++ b/bspwm/.local/bin/rofi_moveto_workspace @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NAME=`rofi_workspace_prompt` +i3-msg move container to workspace $NAME diff --git a/bspwm/.local/bin/rofi_workspace_prompt b/bspwm/.local/bin/rofi_workspace_prompt new file mode 100755 index 0000000..f59d1fa --- /dev/null +++ b/bspwm/.local/bin/rofi_workspace_prompt @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo `i3-msg -t get_workspaces | jq '.[].name' | sed 's/\"//g' | rofi -dmenu` diff --git a/bspwm/.local/bin/scratch b/bspwm/.local/bin/scratch new file mode 100755 index 0000000..9fd5901 --- /dev/null +++ b/bspwm/.local/bin/scratch @@ -0,0 +1,3 @@ +#!/usr/bin/sh +bspc query -N -n .floating > /tmp/scratchid +$SHELL diff --git a/i3wm/.bin/spotifycl b/bspwm/.local/bin/spotifycl index ffee9f0..ffee9f0 100755 --- a/i3wm/.bin/spotifycl +++ b/bspwm/.local/bin/spotifycl diff --git a/bspwm/.local/share/config-files/bspwm b/bspwm/.local/share/config-files/bspwm new file mode 120000 index 0000000..37a4903 --- /dev/null +++ b/bspwm/.local/share/config-files/bspwm @@ -0,0 +1 @@ +../../../.config/bspwm/bspwmrc
\ No newline at end of file diff --git a/bspwm/.local/share/config-files/polybar b/bspwm/.local/share/config-files/polybar new file mode 120000 index 0000000..87fad9e --- /dev/null +++ b/bspwm/.local/share/config-files/polybar @@ -0,0 +1 @@ +../../../.config/polybar/config
\ No newline at end of file diff --git a/bspwm/.local/share/config-files/sxhkd b/bspwm/.local/share/config-files/sxhkd new file mode 120000 index 0000000..6b3d56f --- /dev/null +++ b/bspwm/.local/share/config-files/sxhkd @@ -0,0 +1 @@ +../../../.config/sxhkd/sxhkdrc
\ No newline at end of file diff --git a/i3wm/.wallpaper.jpg b/bspwm/.local/share/images/wallpaper.jpg Binary files differindex cc1ff0e..cc1ff0e 100644 --- a/i3wm/.wallpaper.jpg +++ b/bspwm/.local/share/images/wallpaper.jpg diff --git a/i3wm/.lock.png b/bspwm/.local/share/lock/lock.png Binary files differindex 7759b82..7759b82 100644 --- a/i3wm/.lock.png +++ b/bspwm/.local/share/lock/lock.png diff --git a/i3wm/.rick_lock.png b/bspwm/.local/share/lock/rick_lock.png Binary files differindex 4037c32..4037c32 100644 --- a/i3wm/.rick_lock.png +++ b/bspwm/.local/share/lock/rick_lock.png diff --git a/i3wm/.lock.sh b/bspwm/.local/share/scripts/lock.sh index 927b168..7a3dd42 100755 --- a/i3wm/.lock.sh +++ b/bspwm/.local/share/scripts/lock.sh @@ -6,7 +6,7 @@ revert() { trap revert HUP INT TERM xset +dpms dpms 0 0 5 -ffmpeg -loglevel quiet -y -f x11grab -video_size `xdpyinfo | grep 'dimensions' | awk '{print $2}'` -i $DISPLAY -i ~/.rick_lock.png -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w-400):(main_h-overlay_h-5)" -vframes 1 /tmp/screen.png +ffmpeg -loglevel quiet -y -f x11grab -video_size `xdpyinfo | grep 'dimensions' | awk '{print $2}'` -i $DISPLAY -i ~/.local/share/lock/rick_lock.png -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w-400):(main_h-overlay_h-5)" -vframes 1 /tmp/screen.png #scrot -d 1 /tmp/locking_screen.png #convert -blur 0x8 /tmp/locking_screen.png /tmp/screen_blur.png diff --git a/doom-emacs/.doom.d/config.el b/doom-emacs/.doom.d/config.el index bcfb408..10d7116 100644 --- a/doom-emacs/.doom.d/config.el +++ b/doom-emacs/.doom.d/config.el @@ -1,9 +1,9 @@ (setq - doom-font (font-spec :family "Source Code Pro" :size 20) - doom-big-font (font-spec :family "Source Code Pro" :size 36) - doom-variable-pitch-font (font-spec :family "Source Sans Pro" :size 18)) + doom-font (font-spec :family "Fira Code" :size 14) + doom-big-font (font-spec :family "Fira Code" :size 24) + doom-variable-pitch-font (font-spec :family "Fira Code" :size 16)) -(setq projectile-project-search-path '("~/repos/" "~/Documents/Work/" "~/code")) +(setq projectile-project-search-path '("~/Documents/Work" "~/code")) (setq display-line-numbers-type 'relative) @@ -33,7 +33,7 @@ (file+headline +org-capture-project-notes-file "Unreleased") "* TODO %?\n%i\n%a" :prepend t :kill-buffer t)))) -(def-package! org-super-agenda +(use-package! org-super-agenda :after org-agenda :init (setq org-super-agenda-groups '((:name "Today" @@ -63,29 +63,29 @@ (set-popup-rule! "^\\*Ilist" :side 'right :size 35 :quit nil :select nil :ttl 0)) -(map! :leader - (:prefix-map ("/" . "search")) - (:when (featurep! :ui workspaces) - (:prefix-map ("TAB" . "workspace"))) - (:prefix-map ("b" . "buffer")) - (:prefix-map ("c" . "code")) - (:prefix-map ("f" . "file")) - (:prefix-map ("g" . "git")) - (:prefix-map ("i" . "insert")) - (:prefix-map ("n" . "notes")) - (:prefix-map ("o" . "open") - (:prefix-map ("p" . "project")) - (:prefix-map ("q" . "session")) - (:when (featurep! :editor upload) - (:prefix-map ("r" . "remote"))) - (:when (featurep! :editor snipets) - (:prefix-map ("s" . "snippets"))) - (:prefix-map ("t" . "toggle") - :desc "Toggle imenu-list" "m" #'imenu-list-smart-toggle))) +;;(map! :leader +;; (:prefix-map ("/" . "search")) +;; (:when (featurep! :ui workspaces) +;; (:prefix-map ("TAB" . "workspace"))) +;; (:prefix-map ("b" . "buffer")) +;; (:prefix-map ("c" . "code")) +;; (:prefix-map ("f" . "file")) +;; (:prefix-map ("g" . "git")) +;; (:prefix-map ("i" . "insert")) +;; (:prefix-map ("n" . "notes")) +;; (:prefix-map ("o" . "open") +;; (:prefix-map ("p" . "project")) +;; (:prefix-map ("q" . "session")) +;; (:when (featurep! :editor upload) +;; (:prefix-map ("r" . "remote"))) +;; (:when (featurep! :editor snipets) +;; (:prefix-map ("s" . "snippets"))) +;; (:prefix-map ("t" . "toggle") +;; :desc "Toggle imenu-list" "m" #'imenu-list-smart-toggle))) (setq dired-dwim-target t) -(def-package! tide +(use-package! tide :after (typescript-mode company flycheck) :hook ((typescript-mode . tide-setup) (typescript-mode . tide-hl-identifier-mode) diff --git a/doom-emacs/.doom.d/config.org b/doom-emacs/.doom.d/config.org index bffa946..f3ada01 100644 --- a/doom-emacs/.doom.d/config.org +++ b/doom-emacs/.doom.d/config.org @@ -3,15 +3,15 @@ * Font settings #+BEGIN_SRC emacs-lisp (setq - doom-font (font-spec :family "Source Code Pro" :size 20) - doom-big-font (font-spec :family "Source Code Pro" :size 36) - doom-variable-pitch-font (font-spec :family "Source Sans Pro" :size 18)) + doom-font (font-spec :family "Fira Code" :size 14) + doom-big-font (font-spec :family "Fira Code" :size 24) + doom-variable-pitch-font (font-spec :family "Fira Code" :size 16)) #+END_SRC * Projectile Projectile Path #+BEGIN_SRC emacs-lisp -(setq projectile-project-search-path '("~/repos/" "~/Documents/Work/" "~/code")) +(setq projectile-project-search-path '("~/Documents/Work" "~/code")) #+END_SRC * Relative line numbers @@ -55,7 +55,7 @@ Org capture Org Super Agenda #+BEGIN_SRC emacs-lisp -(def-package! org-super-agenda +(use-package! org-super-agenda :after org-agenda :init (setq org-super-agenda-groups '((:name "Today" @@ -89,25 +89,25 @@ Org Super Agenda #+END_SRC * Leader keys #+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix-map ("/" . "search")) - (:when (featurep! :ui workspaces) - (:prefix-map ("TAB" . "workspace"))) - (:prefix-map ("b" . "buffer")) - (:prefix-map ("c" . "code")) - (:prefix-map ("f" . "file")) - (:prefix-map ("g" . "git")) - (:prefix-map ("i" . "insert")) - (:prefix-map ("n" . "notes")) - (:prefix-map ("o" . "open") - (:prefix-map ("p" . "project")) - (:prefix-map ("q" . "session")) - (:when (featurep! :editor upload) - (:prefix-map ("r" . "remote"))) - (:when (featurep! :editor snipets) - (:prefix-map ("s" . "snippets"))) - (:prefix-map ("t" . "toggle") - :desc "Toggle imenu-list" "m" #'imenu-list-smart-toggle))) +;;(map! :leader +;; (:prefix-map ("/" . "search")) +;; (:when (featurep! :ui workspaces) +;; (:prefix-map ("TAB" . "workspace"))) +;; (:prefix-map ("b" . "buffer")) +;; (:prefix-map ("c" . "code")) +;; (:prefix-map ("f" . "file")) +;; (:prefix-map ("g" . "git")) +;; (:prefix-map ("i" . "insert")) +;; (:prefix-map ("n" . "notes")) +;; (:prefix-map ("o" . "open") +;; (:prefix-map ("p" . "project")) +;; (:prefix-map ("q" . "session")) +;; (:when (featurep! :editor upload) +;; (:prefix-map ("r" . "remote"))) +;; (:when (featurep! :editor snipets) +;; (:prefix-map ("s" . "snippets"))) +;; (:prefix-map ("t" . "toggle") +;; :desc "Toggle imenu-list" "m" #'imenu-list-smart-toggle))) #+END_SRC * Dired Do what I mean target allows dired to use window context for copying and moving @@ -117,7 +117,7 @@ Do what I mean target allows dired to use window context for copying and moving * Laguages Typescript #+BEGIN_SRC emacs-lisp -(def-package! tide +(use-package! tide :after (typescript-mode company flycheck) :hook ((typescript-mode . tide-setup) (typescript-mode . tide-hl-identifier-mode) diff --git a/doom-emacs/.doom.d/init.el b/doom-emacs/.doom.d/init.el index 472a904..470647f 100644 --- a/doom-emacs/.doom.d/init.el +++ b/doom-emacs/.doom.d/init.el @@ -34,10 +34,11 @@ (popup ; tame sudden yet inevitable temporary windows +all ; catch all popups that start with an asterix +defaults) ; default popup rules - ;;pretty-code ; replace bits of code with pretty symbols - ;;tabbar ; FIXME an (incomplete) tab bar for Emacs + ;;(pretty-code) ; replace bits of code with pretty symbols + ;; +fira) + tabs ; a tab bar for Emacs treemacs ; a project drawer, like neotree but cooler - ;;unicode ; extended unicode support for various languages + unicode ; extended unicode support for various languages vc-gutter ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB window-select ; visually switch windows @@ -48,16 +49,19 @@ file-templates ; auto-snippets for empty files fold ; (nigh) universal code folding ;;(format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys ;;lispy ; vim for lisp, for people who dont like vim multiple-cursors ; editing in many places at once ;;objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to + word-wrap ; soft wrapping with language-aware indent :emacs dired ; making dired pretty [functional] electric ; smarter, keyword-based electric-indent + ibuffer ; interactive buffer management vc ; version-control and Emacs, sitting in a tree :term @@ -68,12 +72,12 @@ :tools ;;ansible - ;;debugger ; FIXME stepping through code, to help you add bugs + debugger ; FIXME stepping through code, to help you add bugs ;;direnv ;;docker editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs - eval ; run code, run (also, repls) + (eval +overlay) ; run code, run (also, repls) flycheck ; tasing you for every semicolon you forget ;;flyspell ; tasing you for misspelling mispelling ;;gist ; interacting with github gists @@ -90,7 +94,6 @@ ;;terraform ; infrastructure as code tmux ; an API for interacting with tmux upload ; map local to remote projects via ssh/ftp - wakatime :lang ;;agda ; types of types of types of types... @@ -104,14 +107,15 @@ ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans data ; config/data formats - erlang ; an elegant language for a more civilized age elixir ; erlang done right ;;elm ; care for a cup of TEA? emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilied age ;;ess ; emacs speaks statistics - ;;fsharp ; ML stands for Microsoft's Language + ;;faust ; dsp, but you get to keep your soul + ;;fsharp ; ML stands for Microsoft's Language go ; the hipster dialect - ;;(haskell +intero) ; a language that's lazier than I am + ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; ;;(java +meghanada) ; the poster child for carpal tunnel syndrome @@ -119,6 +123,8 @@ ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) latex ; writing papers in Emacs has never been so fun + ;;lean + ;;factor ledger ; an accounting system in Emacs ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore @@ -138,6 +144,7 @@ ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs rest ; Emacs as a REST client + ;;rst $ ReST in peace ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good @@ -147,7 +154,6 @@ ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. web ; the tubes - ;;vala ; GObjective-C :email ;;(mu4e +gmail) ; WIP @@ -162,16 +168,10 @@ ;;irc ; how neckbeards socialize ;;(rss +org) ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought - (write ; emacs for writers (fiction, notes, papers, etc.) - +wordnut ; wordnet (wn) search - +langtool) ; a proofreader (grammar/style check) for Emacs + ;;(write ; emacs for writers (fiction, notes, papers, etc.) + ;; +wordnut ; wordnet (wn) search + ;; +langtool) ; a proofreader (grammar/style check) for Emacs :config - ;; For literate config users. This will tangle+compile a config.org - ;; literate config in your `doom-private-dir' whenever it changes. literate - - ;; The default module sets reasonable defaults for Emacs. It also - ;; provides a Spacemacs-inspired keybinding scheme and a smartparens - ;; config. Use it as a reference for your own modules. (default +bindings +smartparens)) diff --git a/doom-emacs/.emacs.d b/doom-emacs/.emacs.d -Subproject ea34b111945fbd6d9719de36b64331e9033a1c3 +Subproject 0dc173a63156e8a875705d1ef9e820120c42083 diff --git a/doom-emacs/.local/bin/doom b/doom-emacs/.local/bin/doom new file mode 120000 index 0000000..088002a --- /dev/null +++ b/doom-emacs/.local/bin/doom @@ -0,0 +1 @@ +../../.emacs.d/bin/doom
\ No newline at end of file diff --git a/doom-emacs/.local/bin/org-capture b/doom-emacs/.local/bin/org-capture new file mode 120000 index 0000000..43a2703 --- /dev/null +++ b/doom-emacs/.local/bin/org-capture @@ -0,0 +1 @@ +../../.emacs.d/bin/org-capture
\ No newline at end of file diff --git a/doom-emacs/.local/bin/org-tangle b/doom-emacs/.local/bin/org-tangle new file mode 120000 index 0000000..685ce04 --- /dev/null +++ b/doom-emacs/.local/bin/org-tangle @@ -0,0 +1 @@ +../../.emacs.d/bin/org-tangle
\ No newline at end of file diff --git a/doom-emacs/.local/share/config-files/doom-emacs_config b/doom-emacs/.local/share/config-files/doom-emacs_config new file mode 120000 index 0000000..444f7a3 --- /dev/null +++ b/doom-emacs/.local/share/config-files/doom-emacs_config @@ -0,0 +1 @@ +../../../.doom.d/config.org
\ No newline at end of file diff --git a/doom-emacs/.local/share/config-files/doom-emacs_init b/doom-emacs/.local/share/config-files/doom-emacs_init new file mode 120000 index 0000000..69c2377 --- /dev/null +++ b/doom-emacs/.local/share/config-files/doom-emacs_init @@ -0,0 +1 @@ +../../../.doom.d/init.el
\ No newline at end of file diff --git a/git/.gitconfig b/git/.gitconfig index 20a4e3d..7990333 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -7,7 +7,7 @@ excludesfile = ~/.gitignore_global [credential] helper = cache --timeout=600 -[url "https://github/"] +[url "https://github.com/"] insteadOf = "gh:" [url "git@github.com:"] pushInsteadOf = "gh:" @@ -15,3 +15,8 @@ insteadOf = "aur:" [url "ssh+git://aur@aur.archlinux.org/"] pushInsteadOf = "aur:" +[filter "lfs"] + required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process diff --git a/i3wm/.bin/rofiworkspace b/i3wm/.bin/rofiworkspace deleted file mode 100755 index 2b808e9..0000000 --- a/i3wm/.bin/rofiworkspace +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -NAME=`rofi -dmenu` -i3-msg workspace $NAME
\ No newline at end of file diff --git a/i3wm/.config/i3/config b/i3wm/.config/i3/config index 29e90c2..21635b8 100644 --- a/i3wm/.config/i3/config +++ b/i3wm/.config/i3/config @@ -10,12 +10,12 @@ # Please see https://i3wm.org/docs/userguide.html for a complete reference! exec_always --no-startup-id $HOME/.config/polybar/launch.sh -exec_always --no-startup-id xautolock -locker "~/.lock.sh" -time 60 -detectsleep -notify 10 +exec_always --no-startup-id xautolock -locker "$HOME/.local/bin/lock.sh" -time 60 -detectsleep -notify 10 exec --no-startup-id nm-applet exec --no-startup-id compton set $mod Mod4 -exec_always --no-startup-id feh --bg-scale ~/.wallpaper.jpg +exec_always --no-startup-id feh --bg-scale $HOME/.local/share/images/wallpaper.jpg new_window 1pixel # Font for window titles. Will also be used by the bar unless a different font @@ -37,7 +37,7 @@ font pango:DejaVu Sans Mono 8 floating_modifier $mod # start a terminal -bindsym $mod+Return exec kitty #i3-sensible-terminal +bindsym $mod+Return exec alacritty #kitty #i3-sensible-terminal # kill focused window bindsym $mod+Shift+q kill @@ -74,7 +74,8 @@ bindsym $mod+Shift+Control+Right move workspace to output right bindsym $mod+b workspace back_and_forth bindsym $mod+Shift+b move container to workspace back_and_forth -bindsym $mod+n exec --no-startup-id rofiworkspace +bindsym $mod+n exec --no-startup-id rofi_goto_workspace +bindsym $mod+m exec --no-startup-id rofi_moveto_workspace # move focused window bindsym $mod+Control+j move left @@ -257,3 +258,4 @@ for_window [class="Spotify"] move to workspace Spotify assign [class="Firefox"] → Browser assign [class="Zeal"] → Zeal assign [class="kitty"] → Term +assign [class="Alacritty"] → Term diff --git a/i3wm/.config/polybar/config b/i3wm/.config/polybar/config index 419ff49..0cda3cf 100644 --- a/i3wm/.config/polybar/config +++ b/i3wm/.config/polybar/config @@ -31,7 +31,7 @@ alert = #bd2c40 monitor = ${env:MONITOR:eDP-1} width = 100% height = 40 -dpi = 156 +dpi = 96 ;offset-x = 1% ;offset-y = 1% radius = 6.0 @@ -82,9 +82,9 @@ modules-right = filesystem backlight pulseaudio xkeyboard memory cpu wlan eth et monitor = ${env:MONITOR:eDP-1} width = 100% height = 40 -dpi = 156 +dpi = 96 ;offset-x = 1% -;offset-y = 0 +offset-y = 50 radius = 6.0 fixed-center = true @@ -335,14 +335,14 @@ label = %percentage_used%% [module/wlan] type = internal/network -interface = wlp13s0 +interface = wlp3s0 interval = 3.0 accumulate-stats = true format-connected-prefix = " " format-connected = <label-connected> format-connected-underline = #9f78e1 -label-connected = %essid% %local_ip% ↓%downspeed% ↑%upspeed% +label-connected = %essid% %local_ip% ↓%downspeed% ↑%upspeed% (%signal%) format-disconnected = ;format-disconnected = <label-disconnected> diff --git a/i3wm/.local/bin/lock.sh b/i3wm/.local/bin/lock.sh new file mode 100755 index 0000000..a3ddc2c --- /dev/null +++ b/i3wm/.local/bin/lock.sh @@ -0,0 +1,15 @@ +#!/bin/bash +revert() { + rm /tmp/*screen*.png + xset dpms 0 0 0 +} +trap revert HUP INT TERM +xset +dpms dpms 0 0 5 + +ffmpeg -loglevel quiet -y -f x11grab -video_size `xdpyinfo | grep 'dimensions' | awk '{print $2}'` -i $DISPLAY -i ~/.local/share/images/rick_lock.png -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w-400):(main_h-overlay_h-5)" -vframes 1 /tmp/screen.png + +#scrot -d 1 /tmp/locking_screen.png +#convert -blur 0x8 /tmp/locking_screen.png /tmp/screen_blur.png +#convert -composite /tmp/screen_blur.png ~/.rick_lock.png -gravity South -geometry -20x1200 /tmp/screen.png +i3lock -eui /tmp/screen.png +revert diff --git a/i3wm/.local/bin/rofi_goto_workspace b/i3wm/.local/bin/rofi_goto_workspace new file mode 100755 index 0000000..35e8762 --- /dev/null +++ b/i3wm/.local/bin/rofi_goto_workspace @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NAME=`rofi_workspace_prompt` +i3-msg workspace $NAME diff --git a/i3wm/.local/bin/rofi_moveto_workspace b/i3wm/.local/bin/rofi_moveto_workspace new file mode 100755 index 0000000..9cc0b9d --- /dev/null +++ b/i3wm/.local/bin/rofi_moveto_workspace @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NAME=`rofi_workspace_prompt` +i3-msg move container to workspace $NAME diff --git a/i3wm/.local/bin/rofi_workspace_prompt b/i3wm/.local/bin/rofi_workspace_prompt new file mode 100755 index 0000000..f59d1fa --- /dev/null +++ b/i3wm/.local/bin/rofi_workspace_prompt @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo `i3-msg -t get_workspaces | jq '.[].name' | sed 's/\"//g' | rofi -dmenu` diff --git a/i3wm/.local/bin/spotifycl b/i3wm/.local/bin/spotifycl new file mode 100755 index 0000000..ffee9f0 --- /dev/null +++ b/i3wm/.local/bin/spotifycl @@ -0,0 +1,207 @@ +#!/usr/bin/env python + +# MIT License +# +# Copyright (c) 2018 Andreas Backx +# +# 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 socket +import sys +import time +import traceback +from concurrent.futures import ThreadPoolExecutor + +import click +import dbus +import dbus.mainloop.glib +import spotipy +import spotipy.util as util +from dbus.mainloop.glib import DBusGMainLoop +from gi.repository import GLib +from spotipy import SpotifyException +from spotipy.oauth2 import SpotifyClientCredentials + +inactive_color = '%{F#6E6E6E}' +active_color = '%{F#CECECE}' +default_color = '%{F-}' + +server_address = '/tmp/spotifycl-socket' + + +class Spotify: + + SPOTIFY_BUS = 'org.mpris.MediaPlayer2.spotify' + SPOTIFYD_BUS = 'org.mpris.MediaPlayer2.spotifyd' + SPOTIFY_OBJECT_PATH = '/org/mpris/MediaPlayer2' + + PLAYER_INTERFACE = 'org.mpris.MediaPlayer2.Player' + PROPERTIES_INTERFACE = 'org.freedesktop.DBus.Properties' + + SAVE_REMOVE = b'save' + + def __init__(self): + DBusGMainLoop(set_as_default=True) + self.session_bus = dbus.SessionBus() + self.last_output = '' + self.empty_output = True + + # Last shown metadata + self.last_title = None + # Whether the current song is added to the library + self.saved_track = False + # Whether to ignore the update + self.ignore = False + + def monitor(self): + self.setup_properties_changed() + self.freedesktop = self.session_bus.get_object( + "org.freedesktop.DBus", + "/org/freedesktop/DBus" + ) + self.freedesktop.connect_to_signal( + "NameOwnerChanged", + self.on_name_owner_changed, + arg0=self.SPOTIFYD_BUS + ) + + executor = ThreadPoolExecutor(max_workers=2) + executor.submit(self._start_glib_loop) + executor.submit(self._start_server) + + def _start_glib_loop(self): + loop = GLib.MainLoop() + loop.run() + + def _start_server(self): + try: + os.unlink(server_address) + except OSError: + if os.path.exists(server_address): + raise + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + sock.bind(server_address) + sock.listen(5) + + @property + def metadata_status(self): + spotify_properties = dbus.Interface( + self.spotify, + dbus_interface=Spotify.PROPERTIES_INTERFACE + ) + metadata = spotify_properties.Get( + Spotify.PLAYER_INTERFACE, + 'Metadata' + ) + playback_status = spotify_properties.Get( + Spotify.PLAYER_INTERFACE, + 'PlaybackStatus' + ) + return metadata, playback_status + + def output(self, line): + if not line: + self.empty_output = True + if line != self.last_output: + print(line, flush=True) + self.last_output = line + + def setup_spotify(self): + try: + self.spotify = self.session_bus.get_object( + Spotify.SPOTIFY_BUS, + Spotify.SPOTIFY_OBJECT_PATH + ) + except dbus.DBusException: + self.spotify = self.session_bus.get_object(Spotify.SPOTIFYD_BUS, Spotify.SPOTIFY_OBJECT_PATH) + + def setup_properties_changed(self): + try: + self.setup_spotify() + self.spotify.connect_to_signal( + 'PropertiesChanged', + self.on_properties_changed + ) + + if self.empty_output: + metadata, playback_status = self.metadata_status + self.output_playback_status( + data={ + 'Metadata': metadata, + 'PlaybackStatus': playback_status, + } + ) + + except dbus.DBusException: + self.output('') + + def output_playback_status(self, data, retry=False): + if self.ignore: + return + + metadata = data['Metadata'] + artists = metadata['xesam:artist'] + artist = artists[0] if artists else None + + if not artist: + self.output('') + return + + title = metadata['xesam:title'] + playback_status = data['PlaybackStatus'] + same_song = title == self.last_title + + color = active_color if playback_status == 'Playing' else inactive_color + # divider = '+' if same_song and self.saved_track else '-' + self.output(f'{color}{artist} - {title}{default_color}') + + if not same_song: + self.last_title = title + + def on_properties_changed(self, interface, data, *args, **kwargs): + self.output_playback_status(data) + + def on_name_owner_changed(self, name, old_owner, new_owner): + if name == self.SPOTIFY_BUS: + if new_owner: + # Spotify was opened. + self.setup_properties_changed() + else: + # Spotify was closed. + self.spotify = None + self.output('') + + +@click.group() +def cli(): + """Script for listening to Spotify over dbus and adding tracks to your library.""" + pass + + +@cli.command() +def status(): + """Follow the status of the currently playing song on Spotify.""" + spotify = Spotify() + spotify.monitor() + + +if __name__ == '__main__': + cli() diff --git a/i3wm/.local/share/config-files/i3 b/i3wm/.local/share/config-files/i3 new file mode 120000 index 0000000..97ca8a9 --- /dev/null +++ b/i3wm/.local/share/config-files/i3 @@ -0,0 +1 @@ +../../../.config/i3/config
\ No newline at end of file diff --git a/i3wm/.local/share/config-files/polybar b/i3wm/.local/share/config-files/polybar new file mode 120000 index 0000000..87fad9e --- /dev/null +++ b/i3wm/.local/share/config-files/polybar @@ -0,0 +1 @@ +../../../.config/polybar/config
\ No newline at end of file diff --git a/i3wm/.local/share/images/lock.png b/i3wm/.local/share/images/lock.png Binary files differnew file mode 100644 index 0000000..7759b82 --- /dev/null +++ b/i3wm/.local/share/images/lock.png diff --git a/i3wm/.local/share/images/rick_lock.png b/i3wm/.local/share/images/rick_lock.png Binary files differnew file mode 100644 index 0000000..4037c32 --- /dev/null +++ b/i3wm/.local/share/images/rick_lock.png diff --git a/i3wm/.local/share/images/wallpaper.jpg b/i3wm/.local/share/images/wallpaper.jpg Binary files differnew file mode 100644 index 0000000..cc1ff0e --- /dev/null +++ b/i3wm/.local/share/images/wallpaper.jpg diff --git a/meta/bspwm_deps b/meta/bspwm_deps new file mode 100644 index 0000000..9d2e379 --- /dev/null +++ b/meta/bspwm_deps @@ -0,0 +1,11 @@ +bspwm-git +sxhkd-git +i3lock +feh +rofi +python-click +python-dbus +python-spotipy +ffmpeg +polybar +xorg-xdpyinfo diff --git a/vim/.local/share/config-files/vim b/vim/.local/share/config-files/vim new file mode 120000 index 0000000..639f1ed --- /dev/null +++ b/vim/.local/share/config-files/vim @@ -0,0 +1 @@ +../../../.vimrc
\ No newline at end of file diff --git a/x/.local/share/config-files/xinit b/x/.local/share/config-files/xinit new file mode 120000 index 0000000..82ae9c7 --- /dev/null +++ b/x/.local/share/config-files/xinit @@ -0,0 +1 @@ +../../../.xinitrc
\ No newline at end of file @@ -9,3 +9,4 @@ systemctl --user import-environment DISPLAY #exec startxfce4 exec i3 +#exec bspwm diff --git a/zsh/.local/share/config-files/zprofile b/zsh/.local/share/config-files/zprofile new file mode 120000 index 0000000..5c57bdf --- /dev/null +++ b/zsh/.local/share/config-files/zprofile @@ -0,0 +1 @@ +../../../.zprofile
\ No newline at end of file diff --git a/zsh/.local/share/config-files/zshrc b/zsh/.local/share/config-files/zshrc new file mode 120000 index 0000000..673de52 --- /dev/null +++ b/zsh/.local/share/config-files/zshrc @@ -0,0 +1 @@ +../../../.zshrc
\ No newline at end of file diff --git a/zsh/.zprofile b/zsh/.zprofile index d1e8f03..a4514ae 100755 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -1,12 +1,13 @@ -if type "cowfortune" > /dev/null; then - cowfortune -fi +source /etc/zsh/zprofile +#if type "cowfortune" > /dev/null; then +# cowfortune +#fi #. /etc/profile.d/vte.sh -export TERM=xterm-256color +#export TERM=xterm-256color -export EDITOR=emacsclient +export EDITOR="emacsclient -c" export DEFAULT_USER=peter @@ -16,9 +17,11 @@ export QT_SCALE_FACTOR=0 export MTP_NO_PROBE="1" +export XDG_CONFIG_HOME="$HOME/.config" + # Android SDK -export ANDROID_HOME=/home/peter/Android/Sdk +export ANDROID_HOME="$HOME/.local/share/android-sdk" export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin:$PATH" # bin @@ -22,52 +22,53 @@ antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-history-substring-search if [ "$TERM" = "linux" ]; then - _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p' - for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do - echo -en "$i" - done - clear + _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p' + for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do + echo -en "$i" + done + clear fi -# THEME -POWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9k -POWERLEVEL9K_PROMPT_ON_NEWLINE=true -POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" -#POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ " -POWERLEVEL9K_PROMPT_ADD_NEWLINE=true -POWERLEVEL9K_MODE='awesome-fontconfig' -POWERLEVEL9K_SHORTEN_DIR_LENGTH=3 +if [ "$TERM" != "linux" ]; then + # THEME + POWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9k + POWERLEVEL9K_PROMPT_ON_NEWLINE=true + POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" + #POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ " + POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + POWERLEVEL9K_MODE='awesome-fontconfig' + POWERLEVEL9K_SHORTEN_DIR_LENGTH=3 -POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context virtualenv dir dir_writable vcs) -POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time root_indicator background_jobs history time) + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context virtualenv dir dir_writable vcs) + POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time root_indicator background_jobs history time) -# antigen theme https://gist.github.com/pstruschka/c05686e6cf10e12471a3104e42e6366b.git agnoster_custom -antigen theme bhilburn/powerlevel9k powerlevel9k - -antigen apply + # antigen theme https://gist.github.com/pstruschka/c05686e6cf10e12471a3104e42e6366b.git agnoster_custom + antigen theme bhilburn/powerlevel9k powerlevel9k + antigen apply +fi if type "kitty" > /dev/null; then - autoload -Uz compinit - compinit - # Completion for kitty - kitty + complete setup zsh | source /dev/stdin - - alias kdiff="kitty +kitten diff" - alias kicat="kitty +kitten icat" - alias kunicode="kitty +kitten unicode_input" - alias kpanel="kitty +kitten panel" - alias khints="kitty +kitten hints" - alias kclip="kitty +kitten clipboard" + autoload -Uz compinit + compinit + # Completion for kitty + kitty + complete setup zsh | source /dev/stdin + + alias kdiff="kitty +kitten diff" + alias kicat="kitty +kitten icat" + alias kunicode="kitty +kitten unicode_input" + alias kpanel="kitty +kitten panel" + alias khints="kitty +kitten hints" + alias kclip="kitty +kitten clipboard" fi if type "exa" > /dev/null; then - alias ls=exa + alias ls=exa fi if type "thefuck" > /dev/null; then - eval $(thefuck --alias) + eval $(thefuck --alias) fi if type "fasd" > /dev/null; then |
