Browse Source

Late night updates

main
Yigit Colakoglu 4 years ago
parent
commit
211c961eb5
21 changed files with 88 additions and 89 deletions
  1. +0
    -1
      arch-setup/chroot.sh
  2. +4
    -0
      arch-setup/packages.full
  3. +4
    -0
      arch-setup/packages.minimal
  4. +6
    -8
      config/X11/xinitrc
  5. +1
    -1
      config/zsh/.zshrc
  6. +14
    -2
      config/zsh/cmds
  7. +12
    -13
      local/bin/daily-update
  8. +18
    -35
      local/bin/dmenu-bluetooth
  9. +6
    -6
      local/bin/dmenu-mconnect
  10. +3
    -3
      local/bin/dmenu-refresh
  11. +1
    -1
      local/bin/dmenu-udevil
  12. +1
    -1
      local/bin/edit_screen.sh
  13. +3
    -3
      local/bin/lf-ueberzug
  14. +3
    -3
      local/bin/nextcloud-sync
  15. +1
    -1
      local/bin/st-copyout
  16. +4
    -4
      local/bin/status-bar/weather
  17. +1
    -1
      local/share/.gitignore
  18. +1
    -1
      local/share/vim/templates/skeleton.py
  19. +1
    -1
      local/share/vim/templates/skeleton.sh
  20. +1
    -2
      suckless/dmenu/colors.h
  21. +3
    -2
      suckless/dwm/rules.h

+ 0
- 1
arch-setup/chroot.sh View File

@ -249,7 +249,6 @@ clear
rm -rf /etc/sudoers.d/nopwd
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/wheel
rm -rf /bin/sh
ln -sf /bin/dash /bin/sh
clear


+ 4
- 0
arch-setup/packages.full View File

@ -332,6 +332,7 @@ haskell-data-default-instances-containers
haskell-data-default-instances-dlist
haskell-data-default-instances-old-locale
haskell-data-fix
haskell-diff
haskell-digest
haskell-distributive
haskell-dlist
@ -374,6 +375,8 @@ haskell-pem
haskell-primitive
haskell-quickcheck
haskell-random
haskell-regex-base
haskell-regex-tdfa
haskell-resourcet
haskell-safe
haskell-scientific
@ -1379,6 +1382,7 @@ serd
shaderc
shadow
shared-mime-info
shellcheck
simplescreenrecorder
slang
smbclient


+ 4
- 0
arch-setup/packages.minimal View File

@ -303,6 +303,7 @@ haskell-data-default-instances-containers
haskell-data-default-instances-dlist
haskell-data-default-instances-old-locale
haskell-data-fix
haskell-diff
haskell-digest
haskell-distributive
haskell-dlist
@ -345,6 +346,8 @@ haskell-pem
haskell-primitive
haskell-quickcheck
haskell-random
haskell-regex-base
haskell-regex-tdfa
haskell-resourcet
haskell-safe
haskell-scientific
@ -1347,6 +1350,7 @@ serd
shaderc
shadow
shared-mime-info
shellcheck
simplescreenrecorder
slang
smbclient


+ 6
- 8
config/X11/xinitrc View File

@ -1,14 +1,12 @@
#!/bin/bash
mkdir -p /tmp/yigit
pkill -f clipmenud
pkill -9 devmon
pkill -f "bash /sbin/clipmenud"
pkill -f "/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh"
pkill -f "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
pkill -f devmon
rm -rf /tmp/day_cache
rm -rf $XDG_RUNTIME_DIR/day_cache
source ~/.config.env
gpgconf --dry-run --create-socketdir
@ -18,11 +16,11 @@ dbus-update-activation-environment --systemd DISPLAY
export SSH_AUTH_SOCK
clipmenud > /tmp/clipmenud.out 2> /tmp/clipmenud.err &
clipmenud > $XDG_RUNTIME_DIR/clipmenud.out 2> $XDG_RUNTIME_DIR/clipmenud.err &
rm -f ~/.surf/tabbed-surf.xid
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
~/.local/bin/daily-update
~/.local/bin/keyboard > /tmp/keyboard.out 2> /tmp/keyboard.err
~/.local/bin/keyboard > $XDG_RUNTIME_DIR/keyboard.out 2> $XDG_RUNTIME_DIR/keyboard.err
xrdb ~/.config/X11/Xresources &
~/.local/bin/mailsync &
@ -32,7 +30,7 @@ fi
mkdir -p ~/Downloads/neomutt
if [ "$MCONNECT" = true ] ; then
mkdir -p ~/Downloads/mconnect
(cd ~/Downloads/mconnect; mconnect -d > /tmp/mconnect 2> /tmp/mconnect.err &)
(cd ~/Downloads/mconnect; mconnect -d > $XDG_RUNTIME_DIR/mconnect 2> $XDG_RUNTIME_DIR/mconnect.err &)
fi
if [ "$ACTIVITYWATCHER" = true ] ; then
pkill -f aw-watcher-window
@ -72,7 +70,7 @@ touch ~/.cache/dwm-restart
while [ -f /home/yigit/.cache/dwm-restart ];
do
rm -rf /home/yigit/.cache/dwm-restart
dwmblocks > /tmp/dwmblocks.out 2> /tmp/dwmblocks.err &
dwm > /tmp/dwm.log 2> /tmp/dwm.err
dwmblocks > $XDG_RUNTIME_DIR/dwmblocks.out 2> $XDG_RUNTIME_DIR/dwmblocks.err &
dwm > $XDG_RUNTIME_DIR/dwm.log 2> $XDG_RUNTIME_DIR/dwm.err
sleep 0.2
done

+ 1
- 1
config/zsh/.zshrc View File

@ -1,4 +1,4 @@
eval "$(direnv hook zsh)" >> /tmp/direnv
eval "$(direnv hook zsh)" >> $XDG_RUNTIME_DIR/direnv
paleofetch
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"


+ 14
- 2
config/zsh/cmds View File

@ -44,8 +44,8 @@ colors() {
# TMATE Functions
TMATE_PAIR_NAME="$(whoami)-pair"
TMATE_SOCKET_LOCATION="/tmp/tmate-pair.sock"
TMATE_TMUX_SESSION="/tmp/tmate-tmux-session"
TMATE_SOCKET_LOCATION="$XDG_RUNTIME_DIR/tmate-pair.sock"
TMATE_TMUX_SESSION="$XDG_RUNTIME_DIR/tmate-tmux-session"
# Get current tmate connection url
tmate-url() {
@ -108,6 +108,18 @@ tmate-pair() {
tmate -S "$TMATE_SOCKET_LOCATION" attach-session -t "$TMATE_PAIR_NAME"
}
# Colored man
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
LESS_TERMCAP_ue=$'\e[0m' \
command man "$@"
}
genccls() {
cat > .ccls << EOF
-I


+ 12
- 13
local/bin/daily-update View File

@ -5,27 +5,26 @@ hour=$(date +"%-H")
morning=6
afternoon=12
night=19
cached=$(cat /tmp/day_cache)
cached=$(cat "$XDG_RUNTIME_DIR"/day_cache)
if [ $hour -le $morning ]; then
if [ "$hour" -le "$morning" ]; then
if [ ! "$cached" = "night" ]; then
feh --no-fehbg --bg-fill ~/.local/backgrounds/evening/$(ls ~/.local/backgrounds/evening | sort -R | tail -1 )
echo "night" > /tmp/day_cache
feh --no-fehbg --bg-fill ~/.local/backgrounds/evening/"$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
echo "night" > "$XDG_RUNTIME_DIR/day_cache"
fi
elif [ $night -le $hour ]; then
elif [ "$night" -le "$hour" ]; then
if [ ! "$cached" = "night" ]; then
feh --no-fehbg --bg-fill ~/.local/backgrounds/evening/$(ls ~/.local/backgrounds/evening | sort -R | tail -1 )
echo "night" > /tmp/day_cache
feh --no-fehbg --bg-fill ~/.local/backgrounds/evening/"$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
echo "night" > "$XDG_RUNTIME_DIR/day_cache"
fi
elif [ $afternoon -le $hour ]; then
elif [ "$afternoon" -le "$hour" ]; then
if [ ! "$cached" = "afternoon" ]; then
feh --no-fehbg --bg-fill ~/.local/backgrounds/afternoon/$(ls ~/.local/backgrounds/afternoon| sort -R | tail -1 )
echo "afternoon" > /tmp/day_cache
feh --no-fehbg --bg-fill ~/.local/backgrounds/afternoon/"$(find ~/.local/backgrounds/afternoon| sort -R | tail -1 )"
echo "afternoon" > "$XDG_RUNTIME_DIR/day_cache"
fi
else
if [ ! "$cached" = "morning" ]; then
feh --no-fehbg --bg-fill ~/.local/backgrounds/morning/$(ls ~/.local/backgrounds/morning | sort -R | tail -1 )
echo "morning" > /tmp/day_cache
feh --no-fehbg --bg-fill ~/.local/backgrounds/morning/"$(find ~/.local/backgrounds/morning | sort -R | tail -1 )"
echo "morning" > "$XDG_RUNTIME_DIR/day_cache"
fi
fi

+ 18
- 35
local/bin/dmenu-bluetooth View File

@ -1,21 +1,4 @@
#!/usr/bin/env bash
# _ _ _ _ _ _
# __| |_ __ ___ ___ _ __ _ _ | |__ | |_ _ ___| |_ ___ ___ | |_ | |__
# / _` | '_ ` _ \ / _ \ '_ \| | | |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __|| '_ \
# | (_| | | | | | | __/ | | | |_| |_____| |_) | | |_| | __/ || (_) | (_) | |_ | | | |
# \__,_|_| |_| |_|\___|_| |_|\__,_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__||_| |_|
#
# Author: Nick Clyde (clydedroid)
# dmenu support by: Layerex
#
# A script that generates a dmenu menu that uses bluetoothctl to
# connect to bluetooth devices and display status info.
#
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
#
# Depends on:
# Arch repositories: dmenu, bluez-utils (contains bluetoothctl)
#!/bin/bash
# Checks if bluetooth controller is powered on
power_on() {
@ -98,8 +81,8 @@ toggle_discoverable() {
# Checks if a device is connected
device_connected() {
device_info=$(bluetoothctl info "$1")
if echo "$device_info" | grep -q "Connected: yes"; then
device_info=$(bluetoothctl info ""$1"")
if echo ""$device"_info" | grep -q "Connected: yes"; then
return 0
else
return 1
@ -108,10 +91,10 @@ device_connected() {
# Toggles device connection
toggle_connection() {
if device_connected $1; then
bluetoothctl disconnect $1
if device_connected "$1"; then
bluetoothctl disconnect "$1"
else
bluetoothctl connect $1
bluetoothctl connect "$1"
fi
}
@ -129,10 +112,10 @@ device_paired() {
# Toggles device paired state
toggle_paired() {
if device_paired $1; then
bluetoothctl remove $1
if device_paired "$1"; then
bluetoothctl remove "$1"
else
bluetoothctl pair $1
bluetoothctl pair "$1"
fi
}
@ -150,10 +133,10 @@ device_trusted() {
# Toggles device connection
toggle_trust() {
if device_trusted $1; then
bluetoothctl untrust $1
if device_trusted "$1"; then
bluetoothctl untrust "$1"
else
bluetoothctl trust $1
bluetoothctl trust "$1"
fi
}
@ -167,8 +150,8 @@ print_status() {
counter=0
for device in "${paired_devices[@]}"; do
if device_connected $device; then
device_alias=$(bluetoothctl info $device | grep "Alias" | cut -d ' ' -f 2-)
if device_connected "$device"; then
device_alias=$(bluetoothctl info "$device" | grep "Alias" | cut -d ' ' -f 2-)
if [ $counter -gt 0 ]; then
printf ", %s" "$device_alias"
@ -190,11 +173,11 @@ print_status() {
# A submenu for a specific device that allows connecting, pairing, and trusting
device_menu() {
device=$1
device="$1"
# Get device name and mac address
device_name=$(echo $device | cut -d ' ' -f 3-)
mac=$(echo $device | cut -d ' ' -f 2)
device_name=$(echo "$device" | cut -d ' ' -f 3-)
mac=$(echo "$device" | cut -d ' ' -f 2)
# Build options
if device_connected $mac; then
@ -272,7 +255,7 @@ show_menu() {
*)
device=$(bluetoothctl devices | grep "$chosen")
# Open a submenu if a device is selected
if [[ $device ]]; then device_menu "$device"; fi
if [[ "$device" ]]; then device_menu "$device"; fi
;;
esac
}


+ 6
- 6
local/bin/dmenu-mconnect View File

@ -79,7 +79,7 @@ show_devices (){
SendKeys(){
output="?"
TEMPFILE=/tmp/VimFloat
TEMPFILE=$XDG_RUNTIME_DIR/VimFloat
> $TEMPFILE
st -t "vim-anywhere" -n 'popup' -e "${EDITOR:-vi}" -c 'startinsert' $TEMPFILE
xsel -i < $TEMPFILE
@ -96,11 +96,11 @@ show_menu () {
case "$menu" in
*'Send File')
if [ $Picker == 'ranger' ]; then
mkdir -p /tmp/ranger/
rm -rf /tmp/ranger/sentfile
st -c ranger -e ranger --choosefile=/tmp/ranger/sentfile
if [ -f /tmp/ranger/sentfile ]; then
mconnectctl share-file "$2" "$(cat /tmp/ranger/sentfile)"
mkdir -p $XDG_RUNTIME_DIR/ranger/
rm -rf $XDG_RUNTIME_DIR/ranger/sentfile
st -c ranger -e ranger --choosefile=$XDG_RUNTIME_DIR/ranger/sentfile
if [ -f $XDG_RUNTIME_DIR/ranger/sentfile ]; then
mconnectctl share-file "$2" "$(cat $XDG_RUNTIME_DIR/ranger/sentfile)"
fi
fi;;
*'Send SMS' )


+ 3
- 3
local/bin/dmenu-refresh View File

@ -33,15 +33,15 @@ case $selection in
;;
dwmblocks)
kill -9 $(pidof dwmblocks)
dwmblocks > /tmp/dwmblocks.out 2> /tmp/dwmblocks.err &
dwmblocks > $XDG_RUNTIME_DIR/dwmblocks.out 2> $XDG_RUNTIME_DIR/dwmblocks.err &
;;
mconnect)
kill -9 $(pidof mconnect)
(cd ~/Downloads/mconnect; mconnect -d > /tmp/mconnect 2> /tmp/mconnect.err &)
(cd ~/Downloads/mconnect; mconnect -d > $XDG_RUNTIME_DIR/mconnect 2> $XDG_RUNTIME_DIR/mconnect.err &)
;;
clipmenud)
pkill -f clipmenud
clipmenud > /tmp/clipmenud.out 2> /tmp/clipmenud.err &
clipmenud > $XDG_RUNTIME_DIR/clipmenud.out 2> $XDG_RUNTIME_DIR/clipmenud.err &
;;
mpd)
kill -9 $(pidof mpd)


+ 1
- 1
local/bin/dmenu-udevil View File

@ -3,7 +3,7 @@
DMENU=${DMENU:-dmenu}
DEV_LABEL="/dev/disk/by-label/"
TMP="/tmp/dmnt-udevil-$(date +%s)"
TMP="$XDG_RUNTIME_DIR/dmnt-udevil-$(date +%s)"
trap "rm -f $TMP" EXIT


+ 1
- 1
local/bin/edit_screen.sh View File

@ -1,5 +1,5 @@
#!/bin/sh
tmpfile=$(mktemp /tmp/st-edit.XXXXXX)
tmpfile=$(mktemp $XDG_RUNTIME_DIR/st-edit.XXXXXX)
trap 'rm "$tmpfile"' 0 1 15
cat > "$tmpfile"
st -e "$EDITOR" "$tmpfile"

+ 3
- 3
local/bin/lf-ueberzug View File

@ -13,17 +13,17 @@ mkfifo "$LF_UEBERZUG_FIFO"
tail -f "$LF_UEBERZUG_FIFO" | ueberzug layer --silent &
ueberzugpid=$!
last_dir=$(cat /tmp/lf-last-dir)
last_dir="$([ ! -f $XDG_RUNTIME_DIR/lf-last-dir ] || cat $XDG_RUNTIME_DIR/lf-last-dir)"
fid="$(mktemp)"
prev=$(pwd)
cd $last_dir
lf -command '$printf $id > '"$fid"'' -last-dir-path=/tmp/lf-last-dir "$@"
lf -command '$printf $id > '"$fid"'' -last-dir-path=$XDG_RUNTIME_DIR/lf-last-dir "$@"
cd $prev
id="$(cat "$fid")"
archivemount_dir="/tmp/__lf_archivemount_$id"
archivemount_dir="$XDG_RUNTIME_DIR/__lf_archivemount_$id"
if [ -f "$archivemount_dir" ]; then
cat "$archivemount_dir" | \
while read -r line; do


+ 3
- 3
local/bin/nextcloud-sync View File

@ -2,14 +2,14 @@
source $HOME/.config/nextcloud/nextcloud
rm -rf /tmp/nextcloud.out
rm -rf /tmp/nextcloud.err
rm -rf $XDG_RUNTIME_DIR/nextcloud.out
rm -rf $XDG_RUNTIME_DIR/nextcloud.err
for i in "${!mappings[@]}"; do
echo "Syncing: $i"
mkdir -p "${mappings[$i]}"
nextcloudcmd -h -u "$NEXTCLOUD_USERNAME" -p "$NEXTCLOUD_PASSWORD" \
"${mappings[$i]}" "$i" >> /tmp/nextcloud.out 2>> /tmp/nextcloud.err
"${mappings[$i]}" "$i" >> $XDG_RUNTIME_DIR/nextcloud.out 2>> $XDG_RUNTIME_DIR/nextcloud.err
done
echo $(date '+%R') > $HOME/.cache/nextcloud-track


+ 1
- 1
local/bin/st-copyout View File

@ -3,7 +3,7 @@
# allowing the user to copy the output of one.
# xclip required for this script.
# By Jaywalker and Luke
tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX)
tmpfile=$(mktemp $XDG_RUNTIME_DIR/st-cmd-output.XXXXXX)
trap 'rm "$tmpfile"' 0 1 15
sed -n "w $tmpfile"
sed -i 's/\x0//g' "$tmpfile"


+ 4
- 4
local/bin/status-bar/weather View File

@ -2,8 +2,8 @@
source ~/.config.env
weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"
weatherreportjson="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreportjson"
weatherreport="${XDG_CACHE_HOME:-$HOME/.local/share}/weatherreport"
weatherreportjson="${XDG_CACHE_HOME:-$HOME/.local/share}/weatherreportjson"
WCODES=(
["113"]="^c#ebcb8b^ "
@ -87,10 +87,10 @@ esac
# The test if our forcecast is updated to the day. If it isn't download a new
# weather report from wttr.in with the above function.
[ "$(date -r "/home/yigit/.local/share/weatherreport" "+%d-%m-%Y")" = "$(date '+%d-%m-%Y')" ] ||
[ "$(date -r "$XDG_CACHE_HOME/weatherreport" "+%d-%m-%Y")" = "$(date '+%d-%m-%Y')" ] ||
getforecast
[ "$(date -r "/home/yigit/.local/share/weatherreportjson" "+%d-%m-%Y %H")" = "$(date '+%d-%m-%Y %H')" ] ||
[ "$(date -r "$XDG_CACHE_HOME/weatherreportjson" "+%d-%m-%Y %H")" = "$(date '+%d-%m-%Y %H')" ] ||
getforecastjson
showweather

+ 1
- 1
local/share/.gitignore View File

@ -3,7 +3,7 @@
!fonts
!icons
!themes
!applications
!applications/**
!vim
!nerdfont_icons
!vim/**

+ 1
- 1
local/share/vim/templates/skeleton.py View File

@ -1,4 +1,4 @@
#!/usr/local/bin/python3
#!/bin/python
#
# [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
# [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]


+ 1
- 1
local/share/vim/templates/skeleton.sh View File

@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh

+ 1
- 2
suckless/dmenu/colors.h View File

@ -5,9 +5,8 @@ static const char *colors[SchemeLast][2] = {
[SchemeNorm] = { "#e5e9f0", "#0f111a" },
[SchemeSel] = { "#0f111a", "#bf616a" },
[SchemeOut] = { "#000000", "#00ffff" },
[SchemeNormHighlight] = { "#88c0d0", "#0f111a" },
[SchemeNormHighlight] = { "#81a1c1", "#0f111a" },
[SchemeSelHighlight] = { "#88c0d0", "#bf616a" },
// [SchemeHp] = { "#e5e9f0", "#4c566a" },
};


+ 3
- 2
suckless/dwm/rules.h View File

@ -8,6 +8,7 @@ static const Rule rules[] = {
RULE(.class = "discord", .tags = 1 << 8)
RULE(.class = "firefoxdeveloperedition", .tags = 1 << 1)
RULE(.class = "Brave-browser", .tags = 1 << 1)
RULE(.class = "firefox", .tags = 1 << 1)
RULE(.class = "tabbed-surf", .tags = 1 << 1)
RULE(.class = "bitwarden", .tags = 1 << 6)
RULE(.class = "Bitwarden", .tags = 1 << 6)
@ -37,8 +38,8 @@ static const Rule rules[] = {
RULE(.class = "mpv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H")
RULE(.instance = "sxiv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H")
RULE(.class = "neomutt-send", 0, .isfloating = 1, .floatpos="50% 50% 1000W 700H")
RULE(.class = "Zathura", 0, .isfloating = 1, .floatpos="100% 50% 700W 1000H")
RULE(.class = "Surf", 0, .isfloating = 1, .floatpos="100% 100% 800W 1200H")
//RULE(.class = "Zathura", 0, .isfloating = 1, .floatpos="100% 50% 700W 1000H")
//RULE(.class = "Surf", 0, .isfloating = 1, .floatpos="100% 100% 800W 1200H")
RULE(.class = "weather", 0, .isfloating = 1, .floatpos="50% 50% 1200W 800H")
RULE(.class = "center", 0, .isfloating = 1, .floatpos="50% 50% 1000W 600H")
RULE(.class = "htop", 0, .isfloating = 1, .floatpos="50% 50% 1200W 600H")


Loading…
Cancel
Save