Ver Fonte

Adding I3 Config

Vinicius Teshima há 1 ano atrás
pai
commit
6d5923fa97

+ 36 - 0
.config/i3/blocks.conf

@@ -0,0 +1,36 @@
+separator=false
+markup=pango
+
+[comp]
+command=~/.config/i3/scripts/comp.sh
+interval=5
+
+
+[simple-2]
+full_text=: :
+color=#717171
+
+[disk]
+command=~/.config/i3/scripts/disk
+interval=30
+
+[memory]
+command=~/.config/i3/scripts/memory
+interval=2
+
+[cpu]
+command=~/.config/i3/scripts/cpu
+interval=2
+
+[simple-2]
+full_text=: :
+color=#717171
+
+[time]
+command=date '+%a %b'
+#command=date '+%a %d %b %H:%M:%S'
+interval=600
+
+[simple-2]
+full_text=: :
+color=#717171

+ 209 - 0
.config/i3/config

@@ -0,0 +1,209 @@
+#font pango:Fira Code 12, FontAwesome 12, FiraCode Nerd Font 12
+font Unifont, 12
+
+focus_follows_mouse no
+mouse_warping none
+
+floating_minimum_size 100 x 100
+floating_maximum_size 1920 x 1080
+
+# class                 border  bground text    indicator child_border
+client.focused          #FF5555 #6272A4 #F8F8F2 #6272A4   #FF5555
+client.focused_inactive #44475A #44475A #F8F8F2 #44475A   #44475A
+client.unfocused        #282A36 #282A36 #BFBFBF #282A36   #282A36
+client.urgent           #44475A #FF5555 #F8F8F2 #FF5555   #FF5555
+client.placeholder      #282A36 #282A36 #F8F8F2 #282A36   #282A36
+
+client.background       #F8F8F2
+
+exec --no-startup-id    ~/.config/i3/scripts/delayedautostart.sh
+
+for_window [class="Alacritty"] focus
+
+for_window [all] border pixel 2
+
+for_window [all] title_window_icon on
+
+# set floating (nontiling)for apps needing it
+for_window [class="Yad" instance="yad"] floating enable
+for_window [class="com..*"] floating enable
+for_window [title="floatthiswindow"] floating enable
+for_window [class="Galculator" instance="galculator"] floating enable
+for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
+for_window [class="Xsane" instance="xsane"] floating enable
+for_window [class="Pavucontrol" instance="pavucontrol"] floating enable
+for_window [class="qt5ct" instance="qt5ct"] floating enable
+for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
+for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable
+for_window [class="Pamac-manager"] floating enable
+for_window [class="Xfce4.*settings"] floating enable
+for_window [title="PlayOnLinux configuration"] floating enable
+for_window [title="PlayOnLinux"] floating enable
+
+assign [instance="startKitty"]              $ws1
+assign [instance="startEmacs"]              $ws2
+assign [class="^[Ss]team.*"]                 $ws5
+assign [class="airshipper"]                 $ws5
+assign [class="^Minecraft.*"]                $ws5
+assign [class="^MultiMc.*"]                  $ws5
+
+set $mod Mod4
+
+# Use Mouse+$mod to drag floating windows to their wanted position
+floating_modifier $mod
+
+bindsym $mod+Return	exec xrdb -load ~/.config/X11/Xresources; exec terminal
+
+# kill focused window
+bindsym $mod+Shift+c	kill
+
+set $ws1	"1:CMD"
+set $ws2	"2:WORK"
+set $ws3	"3:WWW"
+set $ws4	"4:FILE"
+set $ws5	"5:GAMES"
+set $ws6	"6"
+set $ws7	"7"
+set $ws8	"8"
+set $ws9	"9:CHAT"
+set $ws10	"10:KEY"
+
+# switch to workspace
+bindsym $mod+1		workspace $ws1
+bindsym $mod+2		workspace $ws2
+bindsym $mod+3		workspace $ws3
+bindsym $mod+4		workspace $ws4
+bindsym $mod+5		workspace $ws5
+bindsym $mod+6		workspace $ws6
+bindsym $mod+7		workspace $ws7
+bindsym $mod+8		workspace $ws8
+bindsym $mod+9		workspace $ws9
+bindsym $mod+0		workspace $ws10
+
+# move focused container to workspace
+bindsym $mod+Shift+1	move container to workspace $ws1
+bindsym $mod+Shift+2	move container to workspace $ws2
+bindsym $mod+Shift+3	move container to workspace $ws3
+bindsym $mod+Shift+4	move container to workspace $ws4
+bindsym $mod+Shift+5	move container to workspace $ws5
+bindsym $mod+Shift+6	move container to workspace $ws6
+bindsym $mod+Shift+7	move container to workspace $ws7
+bindsym $mod+Shift+8	move container to workspace $ws8
+bindsym $mod+Shift+9	move container to workspace $ws9
+bindsym $mod+Shift+0	move container to workspace $ws10
+
+bindsym Print		exec "flameshot full"
+bindsym Shift+Print	exec "flameshot gui"
+bindsym Control+Print	exec "flameshot screen"
+
+bindsym $mod+h	focus left
+bindsym $mod+j	focus down
+bindsym $mod+k	focus up
+bindsym $mod+l	focus right
+
+bindsym $mod+Mod1+h	focus output left
+bindsym $mod+Mod1+j	focus output down
+bindsym $mod+Mod1+k	focus output up
+bindsym $mod+Mod1+l	focus output right
+
+bindsym $mod+Shift+h	move left
+bindsym $mod+Shift+j	move down
+bindsym $mod+Shift+k	move up
+bindsym $mod+Shift+l	move right
+
+bindsym $mod+Mod1+Shift+h	move output left; focus output left
+bindsym $mod+Mod1+Shift+j	move output down; focus output down
+bindsym $mod+Mod1+Shift+k	move output up; focus output up
+bindsym $mod+Mod1+Shift+l	move output right; focus output right
+
+bindsym $mod+Mod1+Control+h	move workspace to output left
+bindsym $mod+Mod1+Control+j	move workspace to output down
+bindsym $mod+Mod1+Control+k	move workspace to output up
+bindsym $mod+Mod1+Control+l	move workspace to output right
+
+# Swap workspace between screens
+#bindsym Mod4+Shift+Control+j	exec ~/.config/i3/scripts/display_swap
+
+bindsym $mod+Ctrl+h	resize shrink width 10 px or 10 ppt
+bindsym $mod+Ctrl+k	resize grow height 10 px or 10 ppt
+bindsym $mod+Ctrl+j	resize shrink height 10 px or 10 ppt
+bindsym $mod+Ctrl+l	resize grow width 10 px or 10 ppt
+
+bindsym $mod+Shift+s	split toggle
+
+# Change focus between tiling / floating windows
+bindsym $mod+space		focus mode_toggle
+
+# focus the parent container
+bindsym $mod+a	focus parent
+
+bindsym $mod+t	layout tabbed
+bindsym $mod+v	layout toggle split
+bindsym $mod+f	floating toggle
+bindsym $mod+m	fullscreen
+
+set $rofi "r - Apps | c - Calc"
+
+bindsym $mod+r	exec dmenu_run -b
+
+mode $rofi {
+
+	bindsym r		exec rofi -modi drun -show drun \
+							  -location 6 -m -1 -display-drun "Apps: " \
+							  -show-icons; mode "default"
+
+	bindsym c		exec rofi -modi calc -show calc \
+							  -location 6 -m -1; mode "default"
+
+	bindsym Return	mode "default"
+	bindsym Escape	mode "default"
+}
+
+set $system "p - Power Off | r - Reboot | s - Suspend | h - Hibernate | \
+l - Lock | R - Reload I3 | C-r - Restart I3 | L - Logout"
+
+bindsym $mod+s	mode $system
+
+mode $system {
+	bindsym p		exec "i3-nagbar -t warning -m 'Power off?' \
+							-B 'Yup' 'systemctl poweroff'"; mode "default"
+
+	bindsym r		exec "i3-nagbar -t warning -m 'Restart?' \
+							-B 'Yup' 'systemctl reboot'"; mode "default"
+
+	bindsym s		exec systemctl suspend; mode "default"
+	bindsym h		exec systemctl hibernate; mode "default"
+	bindsym l		exec i3lock -c000000; mode "default"
+
+	bindsym Shift+r	reload; mode "default"
+	bindsym Ctrl+r		restart; mode "default"
+	bindsym Shift+l	exit; mode "default"
+
+	bindsym Return	mode "default"
+	bindsym Escape	mode "default"
+}
+
+bar {
+	#font pango:Fira Code 11, FontAwesome 11
+	font Unifont 11
+
+	tray_output primary
+	tray_padding 0
+
+	status_command i3blocks -c ~/.config/i3/blocks.conf
+	position bottom
+
+	strip_workspace_numbers yes
+
+	colors {
+		background	#2E303F
+		statusline	#F8F8F2
+		separator	#44475A
+
+		focused_workspace	#44475A #44475A #F8F8F2
+		active_workspace	#282A36 #44475A #F8F8F2
+		inactive_workspace	#282A36 #282A36 #BFBFBF
+		urgent_workspace	#FF5555 #FF5555 #F8F8F2
+		binding_mode		#FF5555 #FF5555 #F8F8F2
+	}
+}

+ 12 - 0
.config/i3/scripts/battery

@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+bat=$(awk '
+    $1 == "Battery" && $3 ~ "Discharging" {
+        print substr($4, 1, length($4)-1)
+    }
+    $1 == "Battery" && $3 != "design" && $3 !~ "Discharging" {
+        print $4
+    }
+    ' <(acpi -V)
+)
+
+echo "BAT $bat"

+ 24 - 0
.config/i3/scripts/comp.sh

@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -x
+
+
+if test -z "$(groups | grep -o portage)" && test ! "$(id -u)" = "0"
+then
+    echo 'Comp: Not in Portage group'
+    exit 1
+fi
+
+genlop -cn \
+    | tr -d '\n' \
+    | sed -e 's/.*\* //' \
+	  -e 's/current merge time/CMT/' \
+	  -e 's/ hours\?, /:/g' \
+	  -e 's/ hours\? and /:/g' \
+	  -e 's/ minutes\? and /:/g' \
+	  -e 's/ seconds\?//g' \
+	  -e 's/:\([1-9]\)\./:0\1./g' \
+	  -e 's/:\([1-9]\):/:0\1:/g' \
+	  -e 's/ \([1-9]\):/ 0\1:/g' \
+	  -e 's/!!! Error: no working merge found.*/No working merge found./' \
+    | xargs echo Comp:

+ 28 - 0
.config/i3/scripts/cpu

@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+cpu_perc=$(awk '
+    /^Average/ {
+        printf("%i", 100 - $12)
+    }
+    ' <(mpstat 1 1 --dec=0)
+)
+
+cpu_temp=$(awk '
+    /^Package/ {
+        p=substr($4, 2, length($4))
+    }
+    /^temp5/ {
+        t=substr($2, 2, length($2))
+    }
+    END {
+        if (p) {
+            print p
+            exit
+        }
+        print t
+    }
+    ' <(sensors)
+)
+
+echo "CPU $cpu_perc% $cpu_temp"
+
+[ $cpu_perc -qt 65 ] && exit 33

+ 13 - 0
.config/i3/scripts/delayedautostart.sh

@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+#get auth work with polkit-gnome
+/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
+
+# dex execute .desktop files
+dex -a -s /etc/xdg/autostart/:~/.config/autostart/ &
+dbus-launch dunst --config ~/.config/dunst/dunstrc &
+
+picom -CGb &                    # Start Picom
+~/.screenlayout/monitor.sh &    # Set Monitor Resolution
+numlockx on &                   # Turn Numpad On
+kitty --name startKitty --detach --hold bpytop &
+qbittorrent &                   # Open QBitTorrent

+ 11 - 0
.config/i3/scripts/disk

@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+echo $(awk '
+    $6 == "/" || $6 == "/bedrock/strata/bedrock" {
+        u=$3 / 1024 / 1024;
+        t=$2 / 1024 / 1024;
+        a=$3 / 1024 / 1024;
+    }
+    END {
+        printf("HD %.0fG/%.0fG %.0f%%", u, t, a/t*100);
+    }
+    ' <(df))

+ 17 - 0
.config/i3/scripts/display_swap

@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+DISPLAY_CONFIG=($(i3-msg -t get_outputs | jq -r '.[]|"\(.name):\(.current_workspace)"'))
+
+for ROW in "${DISPLAY_CONFIG[@]}"; do
+	IFS=':'
+	read -ra CONFIG <<< "${ROW}"
+	if [ "${CONFIG[0]}" != "null" ] && [ "${CONFIG[1]}" != "null" ]; then
+		echo "moving ${CONFIG[1]} right..."
+		if [ "${CONFIG[2]}" != "" ]; then
+			i3-msg -- workspace \
+				--no-auto-back-and-forth "${CONFIG[1]}:${CONFIG[2]}"
+		else
+			i3-msg -- workspace --no-auto-back-and-forth "${CONFIG[1]}"
+		fi
+		i3-msg -- move workspace to output right
+	fi
+done

+ 15 - 0
.config/i3/scripts/memory

@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+awk '
+	/^MemTotal:/ {
+        mem_total=$2 / 1024 / 1024
+	}
+	/^MemAvailable:/ {
+	    mem_free=$2 / 1024 / 1024
+	}
+	END {
+	    mem_used=mem_total-mem_free
+
+	    mem_pct=mem_used/mem_total*100
+	    printf("MEM %.1fGib/%.1fGib (%.f%%)\n", mem_used, mem_total, mem_pct)
+	}
+' /proc/meminfo

+ 9 - 0
.config/i3/scripts/volume

@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+echo " $(pamixer --get-volume-human)"
+
+case $BLOCK_BUTTON in
+  1) pavucontrol;;
+  3) pamixer -t;;
+  4) pamixer -i 5;;
+  5) pamixer -d 5;;
+esac