diff --git a/.local/bin/scripts/autostart b/.local/bin/scripts/autostart new file mode 100755 index 0000000..cf517cf --- /dev/null +++ b/.local/bin/scripts/autostart @@ -0,0 +1,51 @@ +#!/bin/bash +# _ _ _ +# __ _ _ _| |_ ___ ___| |_ __ _ _ __| |_ +# / _` | | | | __/ _ \/ __| __/ _` | '__| __| +# | (_| | |_| | || (_) \__ \ || (_| | | | |_ +# \__,_|\__,_|\__\___/|___/\__\__,_|_| \__| + +# Load .Xresources +xrdb ~/.Xresources +# Wallpaper +if [ "$HOSTNAME" == "pc" ];then + feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1920x1080/ & +elif [ "$HOSTNAME" == "laptop" ];then + feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1366x768/ & +fi + +# Polybar +# killall -q polybar +# while pgrep -u $UID -x polybar >/dev/null; do killall -q polybar; done +# polybar polybarexe & +# sxhkd +# killall -q sxhkd +# while pgrep -u $UID -x sxhkd >/dev/null; do killall -q sxhkd; done +# sxhkd & +# Dunst +killall -q dunst +while pgrep -u $UID -x dunst >/dev/null; do killall -q dunst; done +dunst & +# Picom +killall -q picom +while pgrep -u $UID -x picom >/dev/null; do killall -q picom; done +picom & + +# Set keyboard layout & key swaping +setxkbmap -layout 'pl' -option caps:swapescape & +# Cursor +xsetroot -cursor_name left_ptr & # change the cursor shape from "x" to normal +xsetroot -name " samedamci " + +# Not reload +[[ -z $(pgrep udiskie) ]] && udiskie & +[[ -z $(pgrep clipmenud) ]] && clipmenud & +[[ -z $(pgrep mpd) ]] && mpd & +[[ -z $(pgrep dunst) ]] && dunst & +[[ -z $(pgrep syncthing) ]] && syncthing -no-browser & +telegram-desktop & + +~/.scripts/dwmbar & + +# Welcome notify +dunstify "Hello ${USER}!" diff --git a/.local/bin/scripts/dwmbar b/.local/bin/scripts/dwmbar new file mode 100755 index 0000000..e14e5d2 --- /dev/null +++ b/.local/bin/scripts/dwmbar @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +while true; do + xsetroot -name "  $(awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master)) |  $(date "+%H:%M:%S %p") |  $(pacman -Qu | wc -l) " + sleep 1 +done diff --git a/.local/bin/scripts/lockscreen b/.local/bin/scripts/lockscreen new file mode 100755 index 0000000..9464619 --- /dev/null +++ b/.local/bin/scripts/lockscreen @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +mkdir ~/.cache/lock/ +f="$HOME/.cache/lock/lock.jpg" + +maim -u -m 7 -f jpg "$f" +convert "$f" -blur 0x6 "$f" + +i3lock -i "$f" --composite --insidecolor=55443311 --ringcolor=99443300 --insidevercolor=55443311 --keyhlcolor=99999999 --indicator --veriftext= --wrongtext=! --radius 180 -b --separatorcolor=00000000 + +rm "$f" diff --git a/.local/bin/scripts/powermenu b/.local/bin/scripts/powermenu new file mode 100755 index 0000000..126a098 --- /dev/null +++ b/.local/bin/scripts/powermenu @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +WHAT="$(printf "Shutdown\nSuspend\nLock\nReboot" | dmenu -i -p 'What do you want?' -h 24)" +if [ -z "$WHAT" ]; then exit; fi + +case "$WHAT" in + Shutdown) systemctl poweroff;; + Suspend) sh ~/.scripts/lockscreen; systemctl suspend;; + Lock) sh ~/.scripts/lockscreen;; + Reboot) systemctl reboot +esac diff --git a/.local/bin/scripts/screenshot b/.local/bin/scripts/screenshot new file mode 100755 index 0000000..207e94d --- /dev/null +++ b/.local/bin/scripts/screenshot @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +m() { rofi -dmenu -i -l "$@"; } + +TYPE="$(printf "Screen\nArea\n" | m 2 -p 'What do you want to screenshot?')" +[ ! "$TYPE" ] && exit +SAVE="$(printf "No\nYes" | m 2 -p 'Do you want to copy to clipboard?')" +[ ! "$SAVE" ] && exit +TIME="$(printf "0.7\n5\n10\n15" | m 3 -p 'How many seconds you want to wait?')" +[ ! "$TIME" ] && exit + +[ "$TYPE" = "Area" ] && TYPE="-s -u" || TYPE="" + +mkdir -p ~/Pictures/Screenshots +sleep "$TIME" +SCREEN_PATH=~/Pictures/Screenshots/$(date +%G-%m-%d_%s).png + +maim $TYPE "$SCREEN_PATH" && + notify-send -u low -t 1400 -i "$SCREEN_PATH" "Screenshot created!" + +[ "$SAVE" = "Yes" ] && + xclip -sel clip /dev/null; sleep 0.5 + xclip -selection clipboard -t image/png "$SCREEN_PATH" || exit diff --git a/.local/bin/scripts/update-check b/.local/bin/scripts/update-check new file mode 100755 index 0000000..394ee02 --- /dev/null +++ b/.local/bin/scripts/update-check @@ -0,0 +1,10 @@ +#!/bin/bash + +# killall wificheck.sh &> /dev/null + +if ping -w 1 archlinux.org &> /dev/null +then + printf "$(checkupdates | wc -l)" +else + echo "  " +fi diff --git a/.local/bin/scripts/updater b/.local/bin/scripts/updater new file mode 100755 index 0000000..3cdd386 --- /dev/null +++ b/.local/bin/scripts/updater @@ -0,0 +1,14 @@ +#!/bin/sh + +CHECK="$(printf "Yes\nNo\nShow packages" | dmenu -i -p 'Do you want to make packages update?' -h 24)" +if [ -z "$CHECK" ]; then exit; fi + +case "$CHECK" in + Yes) + export PASS=$(printf | dmenu -P -p "Enter password: " -h 24) + if [ -z "$PASS" ]; then exit; fi + st -e sh -c 'bspc node -d '^10'; echo $PASS | sudo -S -v && clear; sudo pacman -Su --noconfirm';; + "Show packages") + pacman -Qu | dmenu -l 50 ;; + *) exit +esac diff --git a/.local/bin/scripts/websearch b/.local/bin/scripts/websearch new file mode 100755 index 0000000..a68bbe2 --- /dev/null +++ b/.local/bin/scripts/websearch @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +bookmarks="redd.it\narch wiki\ninvidio.us\ngithub\ngitlab\ndotfiles\npython doc\nvulcan" +PHRASE="$(printf "${bookmarks}" | dmenu -h 24 -p "Web search:")" + +case "$PHRASE" in + "redd.it") PG="https://reddit.com" ;; + "arch wiki") PG="https://wiki.archlinux.org" ;; + "invidio.us") PG="https://invidio.us" ;; + "github") PG="https://github.com" ;; + "gitlab") PG="https://gitlab.com" ;; + "dotfiles") PG="https:github.com/samedamci/biual-dot-conf" ;; + "python doc") PG="https://docs.python.org/3/" ;; + "vulcan") PG="https://uonetplus.vulcan.net.pl/powiatrycki" ;; + *) PG="$PHRASE" +esac + +if [ -n "$PG" ]; then + qutebrowser "$PG" & + bspc desktop -f '^3' +fi + diff --git a/.local/bin/scripts/wifi-ip b/.local/bin/scripts/wifi-ip new file mode 100755 index 0000000..4fd3755 --- /dev/null +++ b/.local/bin/scripts/wifi-ip @@ -0,0 +1 @@ +ip a show wlp8s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255' diff --git a/.profile b/.profile index d0dbbd0..d2367e3 100644 --- a/.profile +++ b/.profile @@ -22,7 +22,7 @@ export TERMINAL="st" export GOPATH=$HOME/.local/go export NPM_PACKAGES="$HOME/.yarn/bin/" -export PATH="$PATH:$HOME/Dotfiles:$HOME/.local/bin:$NPM_PACKAGES:$GOROOT/bin:$GOPATH/bin" +export PATH="$PATH:$HOME/.local/bin/:$HOME/.local/bin/scripts/:$NPM_PACKAGES:$GOROOT/bin:$GOPATH/bin" export SCRD=$HOME/.scripts/