From 22bc3681337089d2d5c10d8d019b827464f23a6f Mon Sep 17 00:00:00 2001 From: ineanto Date: Fri, 28 Apr 2023 22:44:39 +0200 Subject: [PATCH] Initial commit --- dot_config/i3/config | 320 ++++++++++++++++++ dot_config/i3/i3blocks.conf | 89 +++++ dot_config/i3/keybindings | 103 ++++++ dot_config/i3/scripts/executable_bandwidth | Bin 0 -> 32384 bytes dot_config/i3/scripts/executable_battery2 | 84 +++++ dot_config/i3/scripts/executable_blur-lock | 11 + dot_config/i3/scripts/executable_cpu_usage | 62 ++++ dot_config/i3/scripts/executable_disk | 48 +++ .../i3/scripts/executable_keyboard-switch | 5 + dot_config/i3/scripts/executable_keyhint | 25 ++ dot_config/i3/scripts/executable_keyhint-2 | 6 + .../executable_literal_empty_workspace | 10 + dot_config/i3/scripts/executable_memory | 69 ++++ dot_config/i3/scripts/executable_openweather | 93 +++++ .../i3/scripts/executable_openweather.conf | 5 + dot_config/i3/scripts/executable_temperature | 87 +++++ dot_config/i3/scripts/executable_volume | 83 +++++ dot_config/i3/scripts/symlink_powermenu.bak | 1 + dot_config/i3/scripts/symlink_vpn | 1 + dot_zshrc | 43 +++ 20 files changed, 1145 insertions(+) create mode 100644 dot_config/i3/config create mode 100644 dot_config/i3/i3blocks.conf create mode 100644 dot_config/i3/keybindings create mode 100644 dot_config/i3/scripts/executable_bandwidth create mode 100644 dot_config/i3/scripts/executable_battery2 create mode 100644 dot_config/i3/scripts/executable_blur-lock create mode 100644 dot_config/i3/scripts/executable_cpu_usage create mode 100644 dot_config/i3/scripts/executable_disk create mode 100644 dot_config/i3/scripts/executable_keyboard-switch create mode 100644 dot_config/i3/scripts/executable_keyhint create mode 100644 dot_config/i3/scripts/executable_keyhint-2 create mode 100644 dot_config/i3/scripts/executable_literal_empty_workspace create mode 100644 dot_config/i3/scripts/executable_memory create mode 100644 dot_config/i3/scripts/executable_openweather create mode 100644 dot_config/i3/scripts/executable_openweather.conf create mode 100644 dot_config/i3/scripts/executable_temperature create mode 100644 dot_config/i3/scripts/executable_volume create mode 100644 dot_config/i3/scripts/symlink_powermenu.bak create mode 100644 dot_config/i3/scripts/symlink_vpn create mode 100644 dot_zshrc diff --git a/dot_config/i3/config b/dot_config/i3/config new file mode 100644 index 0000000..90eacfa --- /dev/null +++ b/dot_config/i3/config @@ -0,0 +1,320 @@ +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +font pango:Noto Sans Regular 10 + +# set the mod key to the winkey: +set $mod Mod4 + +##################### +# workspace layout: # +##################### + +# default i3 tiling mode: +workspace_layout default + +############################## +# extra options for windows: # +############################## + +#border indicator on windows: +default_border none +for_window [class="^.*"] border pixel 3 + +# thin borders +hide_edge_borders both + +# Set inner/outer gaps +gaps inner 10 +gaps outer 15 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# 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 + +# switch to workspace with numlock numpad keys +bindcode $mod+Mod2+87 workspace $ws1 +bindcode $mod+Mod2+88 workspace $ws2 +bindcode $mod+Mod2+89 workspace $ws3 +bindcode $mod+Mod2+83 workspace $ws4 +bindcode $mod+Mod2+84 workspace $ws5 +bindcode $mod+Mod2+85 workspace $ws6 +bindcode $mod+Mod2+79 workspace $ws7 +bindcode $mod+Mod2+80 workspace $ws8 +bindcode $mod+Mod2+81 workspace $ws9 +bindcode $mod+Mod2+90 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 + +# move focused container to workspace with numpad keys +bindcode $mod+Shift+87 move container to workspace $ws1 +bindcode $mod+Shift+88 move container to workspace $ws2 +bindcode $mod+Shift+89 move container to workspace $ws3 +bindcode $mod+Shift+83 move container to workspace $ws4 +bindcode $mod+Shift+84 move container to workspace $ws5 +bindcode $mod+Shift+85 move container to workspace $ws6 +bindcode $mod+Shift+79 move container to workspace $ws7 +bindcode $mod+Shift+80 move container to workspace $ws8 +bindcode $mod+Shift+81 move container to workspace $ws9 +bindcode $mod+Shift+90 move container to workspace $ws10 + +# resize window (you can also use the mouse for that): +mode "resize" { +# the arrow keys +bindsym Left resize shrink width 10 px or 10 ppt +bindsym Down resize grow height 10 px or 10 ppt +bindsym Up resize shrink height 10 px or 10 ppt +bindsym Right resize grow width 10 px or 10 ppt + +# back to normal: Enter or Escape +bindsym Return mode "default" +bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +###################################### +# keybindings for different actions: # +###################################### + +# start a terminal +bindsym $mod+Return exec st + +# kill focused window +bindsym $mod+q kill + +# exit-menu +bindsym $mod+Shift+e exec rofi -show power-menu -modi power-menu:$HOME/.local/bin/powermenu + +# Lock the system +# lock with a picture: +#bindsym $mod+l exec i3lock -i ~/.config/i3/i3-lock-screen.png -p default|win -t +# lock by blurring the screen: +bindsym $mod+l exec ~/.config/i3/scripts/blur-lock + +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace (preserves your layout/session, can be used to update i3) +bindsym $mod+Shift+r restart + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+b focus up +bindsym $mod+o focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +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+b move up +bindsym $mod+Shift+o move right + +# alternatively, you can use the cursor 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 + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+g layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +## Multimedia Keys + +# volume +bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks +bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks +bindsym XF86AudioMute exec amixer sset Master toggle && killall -USR1 i3blocks + +bindsym XF86AudioPlay exec playerctl play +bindsym XF86AudioPause exec playerctl pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +# Redirect sound to headphones +bindsym $mod+p exec /usr/local/bin/switch-audio-port + +## App shortcuts +bindsym $mod+w exec /usr/bin/firefox +bindsym $mod+Shift+s exec kazam + +########################################## +# configuration for workspace behaviour: # +########################################## + +# 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:home" +set $ws2 "2:game/files/st" +set $ws3 "3:web" +set $ws4 "4:other" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# bind program to workspace and focus to them on startup: +assign [class="st"] $ws2 +assign [class="(?i)firefox"] $ws3 + +# then the current: +############################################# +# autostart applications/services on login: # +############################################# + +exec --no-startup-id gnome-keyring-daemon + +# num lock activated +exec --no-startup-id numlockx on +# configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example) +#exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle' + +# start conky: +exec_always --no-startup-id conky + +# start blueberry app for managing bluetooth devices from tray: +#exec --no-startup-id blueberry-tray + +# transparency +exec --no-startup-id picom -b + +# networkmanager-applet +exec --no-startup-id nm-applet + +# set wallpaper +exec --no-startup-id nitrogen --restore + +# set powersavings for display: +exec --no-startup-id xset s 480 dpms 600 600 600 + +# Desktop notifications +exec --no-startup-id dbus-launch dunst --config ~/.config/dunst/dunstrc + +# set focus upon starting +for_window [class="Firefox" instance="firefox"] focus +for_window [title="Firefox"] focus + +# set floating (nontiling) for special apps +for_window [class="Xsane" instance="xsane"] floating enable +for_window [class="Pavucontrol" instance="pavucontrol"] 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="vlc"] sticky enable + +###################################### +# color settings for bar and windows # +###################################### + +# Define colors variables: +set $darkbluetrans #08052be6 +set $darkblue #08052b +set $lightblue #5294e2 +set $urgentred #e53935 +set $white #ffffff +set $black #000000 +set $purple #e345ff +set $darkgrey #383c4a +set $grey #b0b5bd +set $mediumgrey #8b8b8b +set $yellowbrown #e1b700 +set $orange #fe8019 + +# define colors for windows: +#class border bground text indicator child_border +client.focused $lightblue $darkblue $grey $grey $grey +client.unfocused $darkblue $darkblue $grey $darkgrey $darkgrey +client.focused_inactive $darkblue $darkblue $grey $grey $black +client.urgent $urgentred $urgentred $grey $grey $yellowbrown + +############################################ +# bar settings (input comes from i3blocks) # +############################################ + +# Start i3bar to display a workspace bar +bar { + font pango:Fira Sans 14 + status_command i3blocks -c ~/.config/i3/i3blocks.conf + position top + tray_output primary + tray_padding 0 + + # When strip_workspace_numbers is set to yes, + # any workspace that has a name of the form + # “[n][:][NAME]” will display only the name. + strip_workspace_numbers yes + + colors { + separator #504945 + background #282828 + statusline $white + + # border bg txt indicator + focused_workspace $7c6f64 $orange $white $purple + active_workspace $7c6f64 $mediumgrey $darkgrey $purple + inactive_workspace $darkgrey $darkgrey $grey $purple + urgent_workspace $urgentred $urgentred $white $purple + } +} + +##################################### +# Application menu handled by rofi: # +##################################### + +## rofi bindings fancy application menu d+d /F9 optional disabled) +bindsym $mod+d exec rofi -modi drun -show drun +bindsym $mod+shift+d exec rofimoji -f all + +## rofi bindings for window menu ($mod+t /F10 optional disabled) +bindsym $mod+x exec rofi -show window diff --git a/dot_config/i3/i3blocks.conf b/dot_config/i3/i3blocks.conf new file mode 100644 index 0000000..c65838a --- /dev/null +++ b/dot_config/i3/i3blocks.conf @@ -0,0 +1,89 @@ +# i3blocks config file changed for EndeavourOS-i3 setup + +# cheatsheet for icon fonts used on the block-bar: +# https://fontawesome.com/v4.7/cheatsheet/ +# --> to update this run the following command: +# wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf -P ~/.config/i3/ + +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +separator=false +markup=pango + + +# Spotify icon \uF1BC +[spotify] +label= +command=.local/bin/i3blocks-mpris -p spotify +color=#fffff + +[simple] +full_text=/ +color=#bdae93 + +# Memory usage +# +# The type defaults to "mem" if the instance is not specified. +[memory] +label= +command=~/.config/i3/scripts/memory +interval=15 + +[cpu_usage] +label= +command=~/.config/i3/scripts/cpu_usage +interval=15 + +# Retiré lorsque sur batterie. +#[bandwidth] +#command=~/.config/i3/scripts/bandwidth +#interval=persist + +[simple-2] +full_text=/ +color=#bdae93 + +# Battery indicator +[battery] +command=~/.config/i3/scripts/battery2 +interval=60 + +[pavucontrol] +full_text= +command=pavucontrol + +[volume-pulseaudio] +command=~/.config/i3/scripts/volume +instance=Master +interval=1 + +[simple-2] +full_text=/ +color=#bdae93 + +[time] +#label= +command=date '+%a %d %b %H:%M' +interval=60 + +[shutdown_menu] +full_text= +command=~/.config/i3/scripts/powermenu diff --git a/dot_config/i3/keybindings b/dot_config/i3/keybindings new file mode 100644 index 0000000..693a1ad --- /dev/null +++ b/dot_config/i3/keybindings @@ -0,0 +1,103 @@ +EndeavourOS i3wm Keybindings cheat sheet: + +--> to update this run the following command: +wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/keybindings -P ~/.config/i3/ + +All sources and updates are available at GitHub: +https://github.com/endeavouros-team/endeavouros-i3wm-setup + +For reference consult our WIKI: +https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ + + = windows key + +# start xfce4-terminal ++Return + +# kill focused window ++q + +# Application menu search by typing (fancy Rofi menu): ++d + +# Window switcher menu (fancy Rofi menu): ++t + +# fancy exit-menu on bottom right: ++Shift+e + +# Lock the system +# lock with a picture or blurring the screen (options in config) ++l + +# reload the configuration file ++Shift+c + +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) ++Shift+r + +# full keybinding list in editor: ++F1 + +# change window focus ++j focus left ++k focus down ++b focus up ++o focus right + +# alternatively, you can use the cursor keys: ++Left focus left ++Down focus down ++Up focus up ++Right focus right + +# move a focused window ++Shift+j move left ++Shift+k move down ++Shift+b move up ++Shift+o move right + +# alternatively, you can use the cursor keys: ++Shift+Left move left ++Shift+Down move down ++Shift+Up move up ++Shift+Right move right + +# split in horizontal orientation ++h split h + +# split in vertical orientation ++v split v + +# enter fullscreen mode for the focused container ++f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) ++s layout stacking ++g layout tabbed ++e layout toggle split + +# toggle tiling / floating ++Shift+space floating toggle + +# change focus between tiling / floating windows ++space focus mode_toggle + +# focus the parent container ++a focus parent + +# focus the child container +#+d focus child + +# resize floating window ++right mouse button + +## Multimedia Keys + +# Redirect sound to headphones ++p + +## App shortcuts ++w starts Firefox ++n starts Thunar + Button screenshot diff --git a/dot_config/i3/scripts/executable_bandwidth b/dot_config/i3/scripts/executable_bandwidth new file mode 100644 index 0000000000000000000000000000000000000000..3e3e083e6824f9f28b0c892c849f6eb0b433d3d5 GIT binary patch literal 32384 zcmeHw33!y%z4v*yS+dN8BtY0?fP_u6fj~si1PD$rY$0H98zz$pnQNHDnF$1|f&`F= zsiak_)e2gxwAEXyR#6nPS`=edt3 z&wI}KujhaMXM5+o?|ZVTymFzgX-ox!ox=#)HB4Yi6`@6C7%OEZEFJMgmd9*Bo486P zIXQhp7X+0$B%gtlu8Kss8WnM##~l#<+F;g(cEQ7Ow1Fv(ezm2h&JpDy@Rs_60Z zJc7=W(vw^%V=7IQBj0rA3%TyONvZUUSJq$25t`&qO1YC#PNhf5AOw{vf09q=Dv|n< z(^AkVl=7IdWVu!;mz*w;{3@j~D6DulR`-8X-ZCjSIalaOPE|Q7r7|cihaCCk+XmIl zRkFOn+95}_gG!})Sz%+ScIKIdjdl5rp>RuUerw6h{F!GKM4JkxaTCa{B3#t`=Pg;u z^v$e`a7tcd8i$?0QP3r<=){|ii`-7~^>v>g{_3O1ZIiD3WL#~<_dG8?_>UvRL-imT z;-Nq|x>O+fQMibQ`-cqDvUS4I*cpRs%9!g%pLKla=!fq5EEC{>p%vJHh&K#^C%psl zTQI}}T5|9KF%bX!LGYIif`4cb{56B%Hw}UxJ_!EVLGXox;KvP8-$jG)zc2{CZV)`w z59qhs2f@!A1V3jG{Er5~-!}-pXps6w2H~f9W<0LsPy@seHi8{36%;ie?T~m+S%3U; ziDyZ87L7%s!Di<31zP>S`cT;47`h_J>emKiQ6Mpj1HNd?ABp+a`9opi4yq z1^kVTO#v1QtqU?Tm}Z%o?7Yf~dGmeK3TDM~XU22W`?AvtW-wnx^dIfrr&fFGHFSN)o%W15TOLH1w5 z(;TXT>hFYC_dG<)DW#Y(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Fr`nO;<|Gy+ul`@-8->J;H(^B*kCnViKL;gI zo|Q`0B9V4UP$f!Er8dXnIDS-xbC zQHXBikdX)=Px}c;ES$qLO)&mM?#U^!WZvRIj#lPn-(^N4I+uhs$7L2ILSm#+9&1J#7@&n7B1xu owSGE*Q+<~U%4lDc$UK=uOfH`uE+w&W!4`RcMW@;%h9r>vFW@X6^8f$< literal 0 HcmV?d00001 diff --git a/dot_config/i3/scripts/executable_battery2 b/dot_config/i3/scripts/executable_battery2 new file mode 100644 index 0000000..a117f5b --- /dev/null +++ b/dot_config/i3/scripts/executable_battery2 @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2016 James Murphy +# Licensed under the GPL version 2 only +# +# A battery indicator blocklet script for i3blocks + +from subprocess import check_output +import os +import re + +config = dict(os.environ) +status = check_output(['acpi'], universal_newlines=True) + +if not status: + # stands for no battery found + fulltext = "\uf00d \uf240".format(color) + percentleft = 100 +else: + # if there is more than one battery in one laptop, the percentage left is + # available for each battery separately, although state and remaining + # time for overall block is shown in the status of the first battery + batteries = status.split("\n") + state_batteries=[] + commasplitstatus_batteries=[] + percentleft_batteries=[] + for battery in batteries: + if battery!='': + state_batteries.append(battery.split(": ")[1].split(", ")[0]) + commasplitstatus = battery.split(", ") + p = int(commasplitstatus[1].rstrip("%\n")) + if p>0: + percentleft_batteries.append(p) + commasplitstatus_batteries.append(commasplitstatus) + state = state_batteries[0] + commasplitstatus = commasplitstatus_batteries[0] + if percentleft_batteries: + percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries)) + else: + percentleft = 0 + + def color(percent): + if percent < 35: + return colors.get("low") + if percent < 75 and percent > 35: + return colors.get("mid") + if percent > 50: + return colors.get("high") + return "#FFFFFF" + + B_TEMPLATE = "{}" + + B_FULL = B_TEMPLATE.format("\uf240") + B_MID = B_TEMPLATE.format("\uf242") + + B_DISCHARING = B_TEMPLATE.format("\uf241") + B_CHARGING = B_TEMPLATE.format("\uf1e6") + B_DOWN = B_TEMPLATE.format("\uf06a") + B_UNKNOWN = B_TEMPLATE.format("\uf128") + + colors = { + 'low': '#fb4934', + 'mid': '#fabd2f', + 'high': '#b8bb26' + } + + display = "{}{}%" + battery = "" + color = color(percentleft) + + if state == "Discharging": + battery = B_DISCHARING + " " + elif state == "Full": + battery = B_FULL + " " + elif state == "Unknown": + battery = B_UNKNOWN + " " + B_FULL + " " + else: + battery = B_CHARGING + " " + B_MID + " " + + display = display.format(color, battery, percentleft) + +print(display) +if percentleft < 10: + exit(33) diff --git a/dot_config/i3/scripts/executable_blur-lock b/dot_config/i3/scripts/executable_blur-lock new file mode 100644 index 0000000..08e6bf3 --- /dev/null +++ b/dot_config/i3/scripts/executable_blur-lock @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +PICTURE=/tmp/i3lock.png +SCREENSHOT="scrot $PICTURE" + +BLUR="5x4" + +$SCREENSHOT +convert $PICTURE -blur $BLUR $PICTURE +i3lock -i $PICTURE +rm $PICTURE diff --git a/dot_config/i3/scripts/executable_cpu_usage b/dot_config/i3/scripts/executable_cpu_usage new file mode 100644 index 0000000..d12e5d6 --- /dev/null +++ b/dot_config/i3/scripts/executable_cpu_usage @@ -0,0 +1,62 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# +# Licensed under the terms of the GNU GPL v3, or any later version. + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +# default values +my $t_warn = $ENV{T_WARN} // 50; +my $t_crit = $ENV{T_CRIT} // 80; +my $cpu_usage = -1; +my $decimals = $ENV{DECIMALS} // 0; +my $label = $ENV{LABEL} // ""; + +sub help { + print "Usage: cpu_usage [-w ] [-c ] [-d ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + print "-d : Use decimals for percentage (default is $decimals) \n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit, + "d=i" => \$decimals, +); + +# Get CPU usage +$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is +open (MPSTAT, 'mpstat 1 1 |') or die; +while () { + if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) { + $cpu_usage = 100 - $1; # 100% - %idle + last; + } +} +close(MPSTAT); + +$cpu_usage eq -1 and die 'Can\'t find CPU information'; + +# Print short_text, full_text +print "${label}"; +printf "%.${decimals}f%%\n", $cpu_usage; +print "${label}"; +printf "%.${decimals}f%%\n", $cpu_usage; + +# Print color, if needed +if ($cpu_usage >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($cpu_usage >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/dot_config/i3/scripts/executable_disk b/dot_config/i3/scripts/executable_disk new file mode 100644 index 0000000..e18c7aa --- /dev/null +++ b/dot_config/i3/scripts/executable_disk @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +DIR="${DIR:-$BLOCK_INSTANCE}" +DIR="${DIR:-$HOME}" +ALERT_LOW="${ALERT_LOW:-$1}" +ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%) + +LOCAL_FLAG="-l" +if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then + LOCAL_FLAG="" +fi + +df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW ' +/\/.*/ { + # full text + print label $4 + + # short text + print label $4 + + use=$5 + + # no need to continue parsing + exit 0 +} + +END { + gsub(/%$/,"",use) + if (100 - use < alert_low) { + # color + print "#FF0000" + } +} +' diff --git a/dot_config/i3/scripts/executable_keyboard-switch b/dot_config/i3/scripts/executable_keyboard-switch new file mode 100644 index 0000000..9a3e314 --- /dev/null +++ b/dot_config/i3/scripts/executable_keyboard-switch @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +KBD=$(/usr/bin/xkblayout-state print '%s') +echo $KBD + diff --git a/dot_config/i3/scripts/executable_keyhint b/dot_config/i3/scripts/executable_keyhint new file mode 100644 index 0000000..4997786 --- /dev/null +++ b/dot_config/i3/scripts/executable_keyhint @@ -0,0 +1,25 @@ +#!/bin/bash + +Main() { + source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1 + + local command=( + eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list + --column=key: --column=description: --column=command: + "ESC" "close this app" "" + "=" "modkey" "(set mod Mod4)" + "+enter" "open a terminal" "" + "+Shift+n" "new empty workspace" "" + "+w" "open Browser" "" + "+n" "open Filebrowser" "" + "+d" "app menu" "" + "+q" "close focused app" "" + "Print-key" "screenshot" "" + "+Shift+e" "logout menu" "" + "+F1" "open keybinding helper" "" + ) + + "${command[@]}" +} + +Main "$@" diff --git a/dot_config/i3/scripts/executable_keyhint-2 b/dot_config/i3/scripts/executable_keyhint-2 new file mode 100644 index 0000000..2e86d12 --- /dev/null +++ b/dot_config/i3/scripts/executable_keyhint-2 @@ -0,0 +1,6 @@ +I3_CONFIG=$HOME/.config/i3/config +mod_key=$(sed -nre 's/^set \$mod (.*)/\1/p' ${I3_CONFIG}) +grep "^bindsym" ${I3_CONFIG} \ + | sed "s/-\(-\w\+\)\+//g;s/\$mod/${mod_key}/g;s/Mod1/Alt/g;s/exec //;s/bindsym //;s/^\s\+//;s/^\([^ ]\+\) \(.\+\)$/\2: \1/;s/^\s\+//" \ + | tr -s ' ' \ + | rofi -dmenu -theme ~/.config/rofi/rofikeyhint.rasi diff --git a/dot_config/i3/scripts/executable_literal_empty_workspace b/dot_config/i3/scripts/executable_literal_empty_workspace new file mode 100644 index 0000000..b962cde --- /dev/null +++ b/dot_config/i3/scripts/executable_literal_empty_workspace @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +MAX_DESKTOPS=20 + +WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS}) + +EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \ + echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1) + +i3-msg workspace ${EMPTY_WORKSPACE} diff --git a/dot_config/i3/scripts/executable_memory b/dot_config/i3/scripts/executable_memory new file mode 100644 index 0000000..6a69a6f --- /dev/null +++ b/dot_config/i3/scripts/executable_memory @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +TYPE="${BLOCK_INSTANCE:-mem}" + +awk -v type=$TYPE ' +/^MemTotal:/ { + mem_total=$2 +} +/^MemFree:/ { + mem_free=$2 +} +/^Buffers:/ { + mem_free+=$2 +} +/^Cached:/ { + mem_free+=$2 +} +/^SwapTotal:/ { + swap_total=$2 +} +/^SwapFree:/ { + swap_free=$2 +} +END { + if (type == "swap") { + free=swap_free/1024/1024 + used=(swap_total-swap_free)/1024/1024 + total=swap_total/1024/1024 + } else { + free=mem_free/1024/1024 + used=(mem_total-mem_free)/1024/1024 + total=mem_total/1024/1024 + } + + pct=0 + if (total > 0) { + pct=used/total*100 + } + + # full text + # printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct) + + # short text + printf("%.f%%\n", pct) + + # color + if (pct > 90) { + print("#FF0000") + } else if (pct > 80) { + print("#FFAE00") + } else if (pct > 70) { + print("#FFF600") + } +} +' /proc/meminfo diff --git a/dot_config/i3/scripts/executable_openweather b/dot_config/i3/scripts/executable_openweather new file mode 100644 index 0000000..ad1f8c7 --- /dev/null +++ b/dot_config/i3/scripts/executable_openweather @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# Edited by Andreas Lindlbauer + +temps=("#0600FF" "#0500FF" "#0400FF" "#0300FF" "#0200FF" "#0100FF" "#0000FF" "#0002FF" "#0012FF" "#0022FF" "#0032FF" "#0044FF" "#0054FF" "#0064FF" "#0074FF" "#0084FF" "#0094FF" "#00A4FF" "#00B4FF" "#00C4FF" "#00D4FF" "#00E4FF" "#00FFF4" "#00FFD0" "#00FFA8" "#00FF83" "#00FF5C" "#00FF36" "#00FF10" "#17FF00" "#3EFF00" "#65FF00" "#B0FF00" "#FDFF00" "#FFF000" "#FFDC00" "#FFC800" "#FFB400" "#FFA000" "#FF8C00" "#FF7800" "#FF6400" "#FF5000" "#FF3C00" "#FF2800" "#FF1400" "#FF0000") + +command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed. +Aborting."; exit 1; } +command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed. +Aborting."; exit 1; } + +APIKEY="get your key first" +#ZIPCODE="1234" +#CITY_ID="Get your City ID first" +#URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&units=metric&APPID=${APIKEY}" +LAT="Find out your position with your latitude" +LON="and longitude" +URL="http://api.openweathermap.org/data/2.5/onecall?lat=${LAT}&lon=${LON}&units=metric&exclude=minutely,hourly,daily&APPID=${APIKEY}" +WEATHER_RESPONSE=$(wget -qO- "${URL}") + +WEATHER_CONDITION=$(echo "$WEATHER_RESPONSE" | jq '.current.weather[0].main' | sed 's/"//g') +WEATHER_TEMP=$(echo "$WEATHER_RESPONSE" | jq '.current.feels_like') +WEATHER_INT=${WEATHER_TEMP%.*} + +TIME_NOW=$( echo "$WEATHER_RESPONSE" | jq '.current.dt') +SUNRISE=$( echo "$WEATHER_RESPONSE" | jq '.current.sunrise') +SUNSET=$( echo "$WEATHER_RESPONSE" | jq '.current.sunset') +DESCRIPTION=$( echo "$WEATHER_RESPONSE" | jq '.current.weather[0].description' | sed 's/"//g') +WEATHER_ALERT=$( echo "$WEATHER_RESPONSE" | jq '.alerts[0].event' | sed 's/"//g') +DAYTIME="n" + +if [[ "$TIME_NOW" > "$SUNRISE" ]] && [[ "$TIME_NOW" < "$SUNSET" ]]; then + DAYTIME="d" +fi + +case $WEATHER_CONDITION in + 'Clouds') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + 'Rain') + WEATHER_ICON="" + ;; + 'Drizzle') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + 'Thunderstorm') + WEATHER_ICON="" + ;; + 'Snow') + WEATHER_ICON="" + ;; + 'Clear') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + *) + WEATHER_ICON="🌫" + ;; +esac + +WEATHER_COLOR="#FFFFFF" +if [ "$WEATHER_INT" -lt "-11" ]; then + WEATHER_COLOR="#0000FF" +elif [ "$WEATHER_INT" -gt 35 ]; then + WEATHER_COLOR="#FF0000" +else + WEATHER_INT=$(( WEATHER_INT + 11 )) + WEATHER_COLOR="${temps[$WEATHER_INT]}" +fi + +full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} " +if [ "$WEATHER_ALERT" != "null" ]; then + WARN_START=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].start') + WARN_END=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].end') + WARN_START=$(date -d @"$WARN_START" +%a_%k:%M) + WARN_END=$(date -d @"$WARN_END" +%a_%k:%M) + full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION}  ${WEATHER_ALERT} from ${WARN_START} to ${WARN_END}  " +fi + + +echo "${full_text}" +echo "${WEATHER_TEMP}°C " +echo "${WEATHER_COLOR}" diff --git a/dot_config/i3/scripts/executable_openweather.conf b/dot_config/i3/scripts/executable_openweather.conf new file mode 100644 index 0000000..f11aa86 --- /dev/null +++ b/dot_config/i3/scripts/executable_openweather.conf @@ -0,0 +1,5 @@ +# Weather +[Weather] +command=~/.config/i3/scripts/openweather +interval=1800 +color=#7275b3 diff --git a/dot_config/i3/scripts/executable_temperature b/dot_config/i3/scripts/executable_temperature new file mode 100644 index 0000000..6b1eecf --- /dev/null +++ b/dot_config/i3/scripts/executable_temperature @@ -0,0 +1,87 @@ +#!/usr/bin/env perl +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# Copyright 2014 Benjamin Chretien + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Edited by Andreas Lindlbauer + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +binmode(STDOUT, ":utf8"); + +# default values +my $t_warn = $ENV{T_WARN} || 70; +my $t_crit = $ENV{T_CRIT} || 90; +my $chip = $ENV{SENSOR_CHIP} || ""; +my $temperature = -9999; +my $label = "GPU:"; + +sub help { + print "Usage: temperature [-w ] [-c ] [--chip ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + print "--chip : sensor chip\n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit, + "chip=s" => \$chip); + +# Get chip temperature +open (SENSORS, "sensors -u $chip |") or die; +while () { + if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { + $temperature = $1; + last; + } +} +close(SENSORS); + +$temperature eq -9999 and die 'Cannot find temperature'; + +#if ($temperature < 45) { +# $label = ' '; +#} elsif ($temperature < 55) { +# $label = ''; +#} elsif ($temperature < 65) { +# $label = ''; +#} elsif ($temperature < 75) { +# $label = ''; +#} else { +# $label = ''; +#} + +# Print short_text, full_text +print "${label}"; +print " $temperature°C\n"; +print "${label}"; +print " $temperature°C\n"; + +# Print color, if needed +if ($temperature >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($temperature >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/dot_config/i3/scripts/executable_volume b/dot_config/i3/scripts/executable_volume new file mode 100644 index 0000000..4f0a2c2 --- /dev/null +++ b/dot_config/i3/scripts/executable_volume @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +# The second parameter overrides the mixer selection +# For PulseAudio users, eventually use "pulse" +# For Jack/Jack2 users, use "jackplug" +# For ALSA users, you may use "default" for your primary card +# or you may use hw:# where # is the number of the card desired +if [[ -z "$MIXER" ]] ; then + MIXER="pulse" + if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then + # pulseaudio is running, but not all installations use "pulse" + if amixer -D pulse info >/dev/null 2>&1 ; then + MIXER="pulse" + fi + fi + [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" + MIXER="${2:-$MIXER}" +fi + +# The instance option sets the control to report and configure +# This defaults to the first control of your selected mixer +# For a list of the available, use `amixer -D $Your_Mixer scontrols` +if [[ -z "$SCONTROL" ]] ; then + SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | + sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | + head -n1 + )}" +fi + +# The first parameter sets the step to change the volume by (and units to display) +# This may be in in % or dB (eg. 5% or 3dB) +if [[ -z "$STEP" ]] ; then + STEP="${1:-5%}" +fi + +#------------------------------------------------------------------------ + +capability() { # Return "Capture" if the device is a capture device + amixer -D $MIXER get $SCONTROL | + sed -n "s/ Capabilities:.*cvolume.*/Capture/p" +} + +volume() { + amixer -D $MIXER get $SCONTROL $(capability) +} + +format() { + + perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' + perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' + # If dB was selected, print that instead + perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') + perl_filter+='"; exit}' + output=$(perl -ne "$perl_filter") + echo "$LABEL$output" +} + +#------------------------------------------------------------------------ + +case $BLOCK_BUTTON in + 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute + 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase + 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease +esac + +volume | format diff --git a/dot_config/i3/scripts/symlink_powermenu.bak b/dot_config/i3/scripts/symlink_powermenu.bak new file mode 100644 index 0000000..761c0f1 --- /dev/null +++ b/dot_config/i3/scripts/symlink_powermenu.bak @@ -0,0 +1 @@ +/home/aro/.dotfiles/config/i3/scripts/powermenu diff --git a/dot_config/i3/scripts/symlink_vpn b/dot_config/i3/scripts/symlink_vpn new file mode 100644 index 0000000..96d9657 --- /dev/null +++ b/dot_config/i3/scripts/symlink_vpn @@ -0,0 +1 @@ +/home/aro/.dotfiles/config/i3/scripts/vpn diff --git a/dot_zshrc b/dot_zshrc new file mode 100644 index 0000000..95388e7 --- /dev/null +++ b/dot_zshrc @@ -0,0 +1,43 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=500 +SAVEHIST=750 +setopt autocd notify +unsetopt beep +bindkey -e +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '/home/aro/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall +source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme + +path+=('/home/aro/.local/bin') + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# (20/10/22, Aro) Export DBUS_SESSION_BUS_ADDRESS for Napster. +export $(dbus-launch) +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" + + +# CUSTOM GIT SHORTCUTS +alias grma="git remote add" +alias gs="git status" +alias ga='git add .' +alias gp="git push" +alias gc='git commit' +alias gcom='git checkout master' +alias gcob='git checkout -b' +alias gcm='git commit --message' +alias glg='git log --graph --oneline --decorate --all' +alias gld='git log --pretty=format:"%h %ad %s" --date=short --all'