diff --git a/X11/.Xresources b/X11/.Xresources new file mode 100644 index 0000000..9a43f7c --- /dev/null +++ b/X11/.Xresources @@ -0,0 +1,9 @@ +Xft.dpi: 144 +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintslight +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb +Xcursor.theme: Adwaita +Xcursor.size: 24 diff --git a/X11/.xinitrc b/X11/.xinitrc new file mode 100644 index 0000000..4b857d3 --- /dev/null +++ b/X11/.xinitrc @@ -0,0 +1,3 @@ +i3 +export GTK_THEME=Adwaita-dark +export QT_QPA_PLATFORMTHEME=gtk2 diff --git a/etc/i3blocks.conf b/etc/i3blocks.conf index 1ca8fe0..95a6c0e 100644 --- a/etc/i3blocks.conf +++ b/etc/i3blocks.conf @@ -1,22 +1,22 @@ -# i3blocks configuration file -# -# The i3blocks man page describes the usage of the binary, -# and its website describes the configuration: -# -# https://vivien.github.io/i3blocks - - # Global properties separator=true separator_block_width=20 [greetings] -color=#f5af19 -command=echo "$USER" +color=#00b894 +command=echo "[$USER@$HOSTNAME ~]" interval=once +[batteries_mouse] +command=/home/agres/.config/i3/scripts/mouse_battery.sh +interval=60 + +[batteries_keyboard] +command=/home/agres/.config/i3/scripts/keyboard_battery.sh +interval=60 + [cpu] -command=mpstat 1 1 | awk '/Average/ {print 100 - $NF"%"}' +command=sh -c 'usage=$(mpstat 1 1 | awk "/Average/ {print 100 - \$NF}"); temp=$(sensors | awk "/^Tctl:/ {gsub(/[+°]C/, \"\", \$2); print \$2; exit}"); temp=${temp#+}; printf "%s%% %s°C\n" "$usage" "$temp"' interval=5 label=CPU: @@ -30,21 +30,6 @@ command=free -h | awk '/^Mem/ {print $3 "/" $2}' interval=10 label=MEM: -#[down] -#command=vnstat -tr 2 | tail -n 3 | awk '/rx/ {print $2}' -#interval=5 -#label=DOWN: - -#[up] -#command=vnstat -tr 2 | tail -n 3 | awk '/tx/ {print $2}' -#interval=5 -#label=UP: - [time] command=date '+%d.%m %H:%M:%S' interval=1 - - - - - diff --git a/i3/config b/i3/config old mode 100755 new mode 100644 index 82734f9..bcbf7d2 --- a/i3/config +++ b/i3/config @@ -1,13 +1,10 @@ set $mod Mod4 -#font pango:monospace 8 -#font pango:DejaVu Sans Mono 8 -#font pango:JetBrains Mono 8 +# Set i3 font font pango:MesloLGL Nerd Font Mono 8 - +# Start basic functionality apps exec --no-startup-id dex --autostart --environment i3 -#exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork exec --no-startup-id nm-applet exec --no-startup-id xautolock -time 30 -locker "/home/agres/.config/i3/scripts/lock.sh" @@ -20,8 +17,6 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU bindsym --release $mod+Shift+S exec --no-startup-id sh -c '/home/agres/.config/i3/scripts/focused-monitor.sh | xclip -selection clipboard -t image/png' bindsym --release $mod+Shift+Ctrl+S exec --no-startup-id sh -c '/home/agres/.config/i3/scripts/focused-monitor.sh ~/pictures/$(date +%Y-%m-%d_%H-%M-%S).png' - - floating_modifier $mod tiling_drag modifier titlebar @@ -32,10 +27,10 @@ bindsym $mod+Shift+q kill bindsym $mod+d exec --no-startup-id rofi -show run -theme solarized # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right +bindsym $mod+h focus left bindsym $mod+Left focus left bindsym $mod+Down focus down @@ -43,10 +38,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right +bindsym $mod+Shift+h move left bindsym $mod+Shift+Left move left bindsym $mod+Shift+Down move down @@ -54,8 +49,7 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # split in horizontal orientation -bindsym $mod+h split h - +bindsym $mod+b split h # split in vertical orientation bindsym $mod+v split v @@ -63,8 +57,8 @@ bindsym $mod+v split v bindsym $mod+f fullscreen toggle # change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed +#bindsym $mod+s layout stacking +#bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split # toggle tiling / floating @@ -74,21 +68,20 @@ bindsym $mod+Shift+space floating toggle bindsym $mod+space focus mode_toggle # focus the parent container -bindsym $mod+a focus parent - +#bindsym $mod+a focus parent # focus the child container #bindsym $mod+d focus child # Define names for default workspaces for which we configure key bindings later on. # We use variables to avoid repeating the names in multiple places. -set $ws1 "1" -set $ws2 "2" +set $ws1 "1:Code" +set $ws2 "2:Term" set $ws3 "3" set $ws4 "4" -set $ws5 "5" -set $ws6 "6" -set $ws7 "7" -set $ws8 "8" +set $ws5 "5:Web" +set $ws6 "6:Mail" +set $ws7 "7:Music" +set $ws8 "8:Chat" set $ws9 "9" set $ws10 "10" @@ -147,16 +140,56 @@ mode "resize" { bindsym $mod+r mode "resize" -gaps inner 5 -#gaps outer 2 +gaps inner 3 +gaps outer 0 -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) +# Separate bars for dual screen setup bar { - status_command i3blocks - position top + output DisplayPort-0 + status_command i3blocks + position top + tray_output none + workspace_buttons yes + colors { + background #000000 + statusline #ffffff + separator #333333 + + focused_workspace #00675a #00675a #ffffff + active_workspace #1c1c1c #1c1c1c #cccccc + inactive_workspace #000000 #000000 #777777 + urgent_workspace #870000 #870000 #ffffff + } } +bar { + output HDMI-A-0 + status_command i3blocks + position top + tray_output none + workspace_buttons yes + colors { + background #000000 + statusline #ffffff + separator #333333 + + focused_workspace #00675a #00675a #ffffff + active_workspace #1c1c1c #1c1c1c #cccccc + inactive_workspace #000000 #000000 #777777 + urgent_workspace #870000 #870000 #ffffff + } +} + +# Hard defined workspace placement +workspace 1 output DisplayPort-0 +workspace 2 output DisplayPort-0 +workspace 3 output DisplayPort-0 +workspace 4 output DisplayPort-0 +workspace 5 output HDMI-A-0 +workspace 6 output HDMI-A-0 +workspace 7 output HDMI-A-0 +workspace 8 output HDMI-A-1 + # Load Xresources file exec --no-startup-id xrdb -merge ~/.Xresources # Keyboard to German @@ -172,8 +205,9 @@ exec --no-startup-id xset s 7200 7200 exec --no-startup-id xset dpms 7200 7200 7200 # Window overlay theme -client.focused #00b5af #00b5af #fdf6e3 #073642 -client.focused_inactive #073642 #073642 #fdf6e3 #073642 -client.unfocused #073642 #073642 #fdf6e3 #073642 - +client.focused #00b894 #00675a #ffffff #00b894 #00675a +client.focused_inactive #303030 #1c1c1c #cccccc #303030 #1c1c1c +client.unfocused #1c1c1c #000000 #999999 #1c1c1c #000000 +client.urgent #ff5f5f #870000 #ffffff #ff5f5f #870000 +client.placeholder #000000 #000000 #ffffff #000000 #000000 diff --git a/i3/scripts/gpu_usage.sh b/i3/scripts/gpu_usage.sh index 5d49d45..2a81f93 100755 --- a/i3/scripts/gpu_usage.sh +++ b/i3/scripts/gpu_usage.sh @@ -1,8 +1,12 @@ #!/bin/bash +# ~/.config/i3/scripts/gpu_usage.sh -if [ -f /sys/module/amdgpu/drivers/pci:amdgpu/0000:2b:00.0/gpu_busy_percent ]; then - usage=$(awk '{print $1}' /sys/module/amdgpu/drivers/pci:amdgpu/0000:2b:00.0/gpu_busy_percent) - echo "${usage}%" +if command -v rocm-smi &>/dev/null; then + output=$(rocm-smi --showtemp --showuse) + temp=$(echo "$output" | awk -F': ' '/Sensor edge/ {print $3; exit}') + usage=$(echo "$output" | awk -F': ' '/GPU use/ {print $3; exit}') + echo "${usage}% ${temp}°C" else - echo "N/A" + echo "N/A" fi + diff --git a/i3/scripts/keyboard_battery.sh b/i3/scripts/keyboard_battery.sh index 3aa20ed..e8f5666 100755 --- a/i3/scripts/keyboard_battery.sh +++ b/i3/scripts/keyboard_battery.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -KBD_PATH="/org/freedesktop/UPower/devices/keyboard_dev_D7_E8_29_FA_0F_CF" +KBD_PATH="/org/freedesktop/UPower/devices/keyboard_dev_D7_E8_29_FA_0F_D0" if upower -i "$KBD_PATH" 2>/dev/null | grep -q "present:.*yes"; then perc=$(upower -i "$KBD_PATH" | awk '/percentage:/ {print $2}') diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..1e4e8ca --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,77 @@ +# Oh my zsh +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="eastwood" +HIST_STAMPS="dd.mm.yyyy" +plugins=(git sudo) +source $ZSH/oh-my-zsh.sh + +# -- Linux Specific -- + +if [[ -z $DISPLAY ]] && [[ $(tty) == /dev/tty1 ]]; then + startx +fi + + + +# -- Local Setup --- + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='nvim' + else + export EDITOR='nvim' + fi + + +# -- Env Paths --- + +# go +#export PATH=/usr/local/go/bin:$PATH + +# pyenv +#export PYENV_ROOT="$HOME/.pyenv" +#export PATH="$PYENV_ROOT/bin:$PATH" +#eval "$(pyenv init --path)" +#eval "$(pyenv init -)" + +# pipx +#export PATH="$PATH:/Users/agres/.local/bin" +#export PATH="$HOME/.local/bin:$PATH" +# pipx Linux +export PATH="$HOME/.local/bin:$PATH" + + +# bun +#[ -s "/Users/agres/.bun/_bun" ] && source "/Users/agres/.bun/_bun" +#export BUN_INSTALL="$HOME/.bun" +#export PATH="$BUN_INSTALL/bin:$PATH" + +# -- Customization -- + +# Alais: ls to run tree (without any flags) +unalias ls 2>/dev/null +ls() { + if [[ $# -eq 0 ]]; then + tree -L 1 + else + command ls -G "$@" + fi +} + +# Alias: list all modified and new files in current directory +alias lsgit='git status --porcelain | cut -c 4- | xargs ls -l' + +# Alias: wifi to print qr code in terminal from file (device adjustable) +alias wifi='cat /Users/agres/Projects/python_lang/wifi_qr/wifi_password.txt | qr --asci' + +# Alias: connect and disconnect bluetooth headphones +alias airpods-connect='echo -e "connect 80:95:3A:DC:8E:41" | bluetoothctl >> /dev/null' +alias airpods-disconnect='echo -e "disconnect 80:95:3A:DC:8E:41" | bluetoothctl >> /dev/null' +alias airpods='echo -e "select 12:34:56:78:9A:BC\ninfo 80:95:3A:DC:8E:41" | bluetoothctl | grep "Connected: "' + +# Alias: avoid nano +alias nano=nvim + +# Alias quick mount network smdb drive +alias md0='sudo mount --mkdir -t cifs //192.168.0.200/MD0 /mnt/md0 -o username=agres' +