Compare commits

...

5 commits

13 changed files with 180 additions and 53 deletions

View file

@ -7,7 +7,7 @@ env:
font:
normal:
family: JetBrains Mono
family: JetBrains Mono NF
size: 13.0
draw_bold_text_with_bright_colors: true

View file

@ -55,6 +55,7 @@ bspc config external_rules_command "$HOME/.config/bspwm/external_rules"
bspc rule -a 'firefox' desktop='web'
bspc rule -a 'qutebrowser' desktop='web'
bspc rule -a 'gcr-prompter' desktop='web'
bspc rule -a 'qutebrowser:kiosk' follow='true' desktop='side-view' state='fullscreen'
bspc rule -a 'firefox:Toolkit' follow='true' desktop='side-view' state='fullscreen'
@ -81,5 +82,7 @@ bspc rule -a 'Xarchiver' state='floating'
bspc rule -a 'Signal' desktop='messenger'
bspc rule -a 'Thunderbird:Mail' desktop='messenger' locked='true'
$HOME/.config/polybar/focus-voip.py &
$HOME/.config/polybar/launch.sh &
$HOME/.config/bspwm/swallow.py &
$HOME/.config/bspwm/focus-voip.py &

View file

@ -52,7 +52,7 @@
modules-left = bspwm
modules-center = mpd
modules-right = memory cpu temperature eth check-arch-updates date
modules-right = openweather memory cpu temperature eth check-arch-updates date
eth-interface = enp0s31f6

View file

@ -45,3 +45,11 @@
[module/bsp-layout-secondary]
inherit = module/bsp-layout
exec = bsp-layout get $(bspc query -D --names -d ${MONITOR_SECONDARY}:focused)
[module/openweather]
type = custom/script
exec = $HOME/.config/polybar/scripts/openweather.sh
interval = 600
format-prefix-foreground = ${colors.foreground}
format-underline = ${colors.green}

View file

@ -0,0 +1,58 @@
#!/usr/bin/env sh
. "$HOME/.config/environment.local"
get_icon() {
case $1 in
# Icons for Font Awesome 5 Pro
01d) icon="";;
01n) icon="";;
02d) icon="";;
02n) icon="";;
03d) icon="";;
03n) icon="";;
04*) icon="";;
09*) icon="";;
10d) icon="";;
10n) icon="";;
11*) icon="";;
13*) icon="";;
50*) icon="";;
*) icon="";
esac
echo $icon
}
KEY="$OPENWEATHER_KEY"
CITY="$OPENWEATHER_CITY"
UNITS="metric"
SYMBOL="°"
API="https://api.openweathermap.org/data/2.5"
if [ -n "$CITY" ]; then
if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
CITY_PARAM="id=$CITY"
else
CITY_PARAM="q=$CITY"
fi
weather=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
else
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
if [ -n "$location" ]; then
location_lat="$(echo "$location" | jq '.location.lat')"
location_lon="$(echo "$location" | jq '.location.lng')"
weather=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
fi
fi
if [ -n "$weather" ]; then
weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1)
weather_icon=$(echo "$weather" | jq -r ".weather[0].icon")
echo "$(get_icon "$weather_icon")" "$weather_temp$SYMBOL"
fi

View file

@ -1,6 +1,6 @@
import keybindings
config.load_autoconfig(False)
config.load_autoconfig()
c.tabs.show = 'never'
c.statusbar.show = 'never'

View file

@ -18,10 +18,11 @@ super + p
super + Escape
pkill -USR1 -x sxhkd
#super + {_, ctrl +, shift + } Print
# suas {sel, win, }
super + Print
screenshot
super + ctrl + Print
screenshot no_upload
super + Pause
rofi-shutdown

View file

@ -11,6 +11,8 @@ call plug#begin('~/.config/vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'vim-scripts/DoxygenToolkit.vim'
Plug 'drmikehenry/vim-headerguard'
"Emmet is a plugin which greatly improves HTML & CSS workflow
Plug 'mattn/emmet-vim'
" Eye-Candy
Plug 'machakann/vim-highlightedyank'

View file

@ -1,5 +1,13 @@
#!/usr/bin/sh
alias get_priv="sudo"
if [ -x "$(command -v doas)" ]
then
alias get_priv="doas"
fi
get_priv echo
paru -Syu
if [ $? -eq 0 ]; then
@ -13,12 +21,7 @@ fi
echo "==================================================================="
if [ -x "$(command -v doas)" ]
then
doas checkservices
else
sudo checkservices
fi
get_priv checkservices
if [ $? -eq 0 ]; then
echo "CHECKSERVICES SUCCEDEED"

View file

@ -1,5 +1,7 @@
#!/usr/bin/sh
set -e
priv_cmd="sudo"
if [ -x "$(command -v doas)" ]

View file

@ -3,26 +3,45 @@
s3_bucket=public.serguzim.me/screenshots
s3_host=https://sos-de-fra-1.exo.io
path=/tmp/screenshot.png
file=$(date "+%F_%H-%M-%S").png
process_image()
clip_image()
{
file=$(date "+%F_%H-%M-%S").png
xclip -t image/png $1 -selection clipboard
}
s3cmd put -P $1 s3://$s3_bucket/$file
upload_image()
{
echo -n "$s3_host/$s3_bucket/$file" | xclip -selection primary
s3cmd put -P $1 s3://$s3_bucket/$file
notify-send -a "Screenshot" "Uploaded screenshot to s3"
}
if [ -n "$1" ] && [ -e "$1" ]
then
convert $1 $path
process_image $path
else
main_no_upload()
{
if flameshot gui -r > $path
then
process_image $path
clip_image $path
fi
fi
}
main()
{
if [ -n "$1" ] && [ -e "$1" ]
then
convert $1 $path
clip_image $path
upload_image $path
else
if flameshot gui -r > $path
then
clip_image $path
upload_image $path
fi
fi
}
case $1 in
no_upload) main_no_upload ;;
*) main $1 ;;
esac

View file

@ -27,3 +27,5 @@ then
Mopidy:out_jackaudiosink0_1 Speaker:playback_1 \
Mopidy:out_jackaudiosink0_2 Speaker:playback_2 &
fi
sleep 3

View file

@ -25,6 +25,50 @@ fi
# #xrandr --output HDMI-2 --left-of eDP-1 --auto
#}
wait_for_service()
{
until systemctl is-active --quiet $1
do
sleep 0.5
done
}
_autostart_workspace_voip()
{
#/opt/teamspeak5/TeamSpeak &
#sleep 2
#alacritty --class "mail" --command sh -c "neomutt" &
teamspeak3 &
sleep 1
element-desktop &
sleep 1
discord &
}
_autostart_workspace_messenger()
{
signal-desktop &
sleep 1
thunderbird &
}
_autostart_webapps()
{
syncthing -no-browser &
/usr/lib/kdeconnectd &
#transmission-gtk --minimized &
qbittorrent &
}
_autostart_audioapps()
{
#steam-runtime -silent -tcp &
flatpak run com.valvesoftware.Steam -silent &
qutebrowser &
mopidy &
}
_autostart_defaults()
{
dunst &
@ -33,46 +77,31 @@ _autostart_defaults()
solaar --window hide &
sxhkd &
$HOME/.config/bspwm/swallow.py &
$HOME/.config/bspwm/focus-voip.py &
conky --daemonize --config="$HOME/.config/conky/clock.conf"
conky --daemonize --config="$HOME/.config/conky/system.conf"
conky --daemonize --config="$HOME/.config/conky/archlinux-updates.conf"
feh --bg-fill $XDG_PICTURES_DIR/wallpaper/active_wallpaper
### wait for internet and audio
sleep 10
start_jack
sleep 2
syncthing -no-browser &
#actkbd --grab --config ~/.config/actkbd/actkbd.conf --device /dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd &
}
/usr/lib/kdeconnectd &
#transmission-gtk --minimized &
qbittorrent &
#steam-runtime -silent -tcp &
flatpak run com.valvesoftware.Steam -silent &
qutebrowser &
_autostart()
{
_autostart_defaults &
sleep 1
### wait for internet
wait_for_service "network-online.target"
_autostart_webapps &
### Workspace VOIP
teamspeak3 &
#/opt/teamspeak5/TeamSpeak &
#sleep 2
#alacritty --class "mail" --command sh -c "neomutt" &
sleep 1
element-desktop &
### wait for audio
wait_for_service "--user pulseaudio.socket"
start_jack
### Workspace Messenger
signal-desktop &
sleep 1
thunderbird &
_autostart_audioapps &
mopidy &
_autostart_workspace_voip &
_autostart_workspace_messenger &
}
host_name=$(cat /proc/sys/kernel/hostname)
@ -82,6 +111,6 @@ elif [[ $host_name == *"laptop"* ]]; then
_autostart_laptop &
fi
_autostart_defaults &
_autostart &
# vim: ft=sh