diff --git a/.config/i3/config b/.config/i3/config index 93606b6..5bc7865 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -152,24 +152,32 @@ exec --no-startup-id compton exec --no-startup-id nextcloud # Conky -exec --no-startup-id $HOME/bin/startconky.sh +exec --no-startup-id $HOME/bin/startup/start_conky.sh # Redshift exec --no-startup-id redshift-gtk # KeePassXC -exec --no-startup-id $HOME/bin/start_keepassxc.sh +exec --no-startup-id $HOME/bin/startup/start_keepassxc.sh # Nemo bindsym $mod+n exec nemo -# Turn on/off internal laptop monitor -bindsym $mod+Shift+s exec $HOME/bin/switch_monitors.sh +# Turn on/off monitors +bindsym $mod+m exec $HOME/bin/xrandr/switch_monitors.sh -i +bindsym $mod+Shift+m exec $HOME/bin/xrandr/switch_monitors.sh -e + +# Monitor setup +exec --no-startup-id $HOME/bin/xrandr/monitor_setup.sh single + +# Window titlebar +for_window [class="^.*"] border pixel 2 # reload the configuration file bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart + # exit i3 (logs you out of your X session) bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" diff --git a/.config/polybar/config b/.config/polybar/config index d674b3d..ca134c5 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -45,13 +45,13 @@ padding-right = 2 module-margin-left = 2 module-margin-right = 2 -font-0 = Icons:size=10;1 +font-0 = FontAwesome:size=10;1 font-1 = siji:pixelsize=10;1 font-2 = Weather Icons:size=10;1 -modules-left = i3 +modules-left = powermenu i3 modules-center = datetime openweathermap -modules-right = system-usb-udev updates pulseaudio-tail wlan eth xkeyboard battery +modules-right = system-usb-udev updates pulseaudio-tail wlan eth vpn xkeyboard battery tray-detached = false tray-position = right @@ -75,7 +75,7 @@ label-indicator-underline = ${colors.secondary} [module/openweathermap] type = custom/script -exec = ~/bin/openweathermap-simple.sh +exec = ~/bin/polybar/openweathermap-simple.sh interval = 600 label-font = 3 @@ -148,7 +148,7 @@ interface = wlo1 interval = 3.0 format-connected =  -label-connected = "" +label-connected = " %essid%" format-disconnected = @@ -175,6 +175,10 @@ label-close-foreground = ${colors.foreground} label-separator = " / " label-separator-foreground = ${colors.foreground} +;logout +menu-0-2 = "" +menu-0-2-exec = i3-msg exit +menu-0-2-foreground = ${colors.foreground} ; reboot menu-0-1 = "" menu-0-1-exec = systemctl reboot @@ -196,19 +200,25 @@ click-left = gsimplecal [module/system-usb-udev] type = custom/script -exec = ~/bin/system-usb-udev.sh +exec = ~/bin/polybar/system-usb-udev.sh tail = true -click-left = ~/bin/system-usb-udev.sh --mount -click-right = ~/bin/system-usb-udev.sh --unmount +click-left = ~/bin/polybar/system-usb-udev.sh --mount +click-right = ~/bin/polybar/system-usb-udev.sh --unmount [module/pulseaudio-tail] type = custom/script -exec = ~/bin/pulseaudio-tail.sh 2> /dev/null +exec = ~/bin/polybar/pulseaudio-tail.sh 2> /dev/null tail = true -click-right = ~/bin/pulseaudio-tail.sh --show 2> /dev/null -click-left = ~/bin/pulseaudio-tail.sh --mute 2> /dev/null -scroll-up = ~/bin/pulseaudio-tail.sh --up 2> /dev/null -scroll-down = ~/bin/pulseaudio-tail.sh --down 2> /dev/null +click-right = ~/bin/polybar/pulseaudio-tail.sh --show 2> /dev/null +click-left = ~/bin/polybar/pulseaudio-tail.sh --mute 2> /dev/null +scroll-up = ~/bin/polybar/pulseaudio-tail.sh --up 2> /dev/null +scroll-down = ~/bin/polybar/pulseaudio-tail.sh --down 2> /dev/null + +[module/vpn] +type = custom/script +exec = ~/bin/polybar/vpn_running.sh +interval = 5 +click-left = ~/bin/polybar/vpn_country.sh [module/updates] type = custom/script @@ -229,6 +239,11 @@ format-charging-underline = ${colors.secondary} format-discharging = format-discharging-underline = ${colors.alert} +label-full = "" +label-discharging = " %percentage%" +label-charging = " %percentage%" + + [global/wm] margin-top = 5 margin-bottom = 5 diff --git a/.profile b/.profile new file mode 100644 index 0000000..73ee15a --- /dev/null +++ b/.profile @@ -0,0 +1 @@ +export TERMINAL=tilix diff --git a/.zshrc b/.zshrc index b48821c..4425d07 100644 --- a/.zshrc +++ b/.zshrc @@ -23,3 +23,8 @@ antigen theme gentoo # Tell Antigen that you're done. antigen apply + +# VTE +if [ $TILIX_ID ] || [ $VTE_VERSION ]; then + source /etc/profile.d/vte.sh +fi diff --git a/bin/openweathermap-simple.sh b/bin/polybar/openweathermap-simple.sh similarity index 96% rename from bin/openweathermap-simple.sh rename to bin/polybar/openweathermap-simple.sh index 122b211..3386fda 100755 --- a/bin/openweathermap-simple.sh +++ b/bin/polybar/openweathermap-simple.sh @@ -25,7 +25,12 @@ get_icon() { } KEY=`secret-tool lookup openweathermap api_key` -CITY="" + +BRNO_CZ="3078610" +ZVOLEN_SK="3056459" + +CITY=$BRNO_CZ + UNITS="metric" SYMBOL="°" diff --git a/bin/pulseaudio-tail.sh b/bin/polybar/pulseaudio-tail.sh similarity index 77% rename from bin/pulseaudio-tail.sh rename to bin/polybar/pulseaudio-tail.sh index bad37bc..aa0dbc3 100755 --- a/bin/pulseaudio-tail.sh +++ b/bin/polybar/pulseaudio-tail.sh @@ -15,14 +15,8 @@ volume_mute() { } volume_print() { - if pacmd list-sinks | grep active | head -n 1 | grep -q speaker; then - icon="" - elif pacmd list-sinks | grep active | head -n 1 | grep headphones; then - icon="" - else - icon="" - fi - + + icon="" muted=$(pamixer --sink $sink --get-mute) if [ "$muted" = true ]; then diff --git a/bin/system-usb-udev.sh b/bin/polybar/system-usb-udev.sh similarity index 100% rename from bin/system-usb-udev.sh rename to bin/polybar/system-usb-udev.sh diff --git a/bin/updates.sh b/bin/polybar/updates.sh similarity index 100% rename from bin/updates.sh rename to bin/polybar/updates.sh diff --git a/bin/polybar/vpn_running.sh b/bin/polybar/vpn_running.sh new file mode 100755 index 0000000..8c20338 --- /dev/null +++ b/bin/polybar/vpn_running.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$(pgrep openvpn)" ]; then + echo "" +else + echo +fi \ No newline at end of file diff --git a/bin/startconky.sh b/bin/startup/start_conky.sh similarity index 100% rename from bin/startconky.sh rename to bin/startup/start_conky.sh diff --git a/bin/start_keepassxc.sh b/bin/startup/start_keepassxc.sh similarity index 100% rename from bin/start_keepassxc.sh rename to bin/startup/start_keepassxc.sh diff --git a/bin/switch_monitors.sh b/bin/switch_monitors.sh deleted file mode 100755 index a3683f7..0000000 --- a/bin/switch_monitors.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -intern=eDP-1 -extern=HDMI-1 - -if xrandr --listactivemonitors | grep "$intern"; then - xrandr --output "$intern" --off -else - xrandr --output "$intern" --auto -fi diff --git a/bin/monitor_setup.sh b/bin/xrandr/monitor_setup.sh similarity index 100% rename from bin/monitor_setup.sh rename to bin/xrandr/monitor_setup.sh diff --git a/bin/xrandr/switch_monitors.sh b/bin/xrandr/switch_monitors.sh new file mode 100755 index 0000000..810e83d --- /dev/null +++ b/bin/xrandr/switch_monitors.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +intern=eDP-1 +extern=HDMI-1 + +case $1 in + "-i") + m=$intern + ;; + "-e") + m=$extern + ;; + *) + echo "Wrong option" +esac + +if xrandr --listactivemonitors | grep "$m"; then + xrandr --output "$m" --off +else + xrandr --output "$m" --auto +fi \ No newline at end of file