From 014c6b847b0b30d3444b45dcffd3d3cb3670fd66 Mon Sep 17 00:00:00 2001 From: Hassan Afify Date: Sat, 28 Mar 2020 22:38:21 +0300 Subject: [PATCH] fix mbsyncrc,volume, viminfo, ref record_screen deleted: .dialogrc deleted: .gitignore new file: .config/git/.gitignore new file: .scripts/openbsd_rcctl.sh renamed: .gitmessage -> .config/git/.gitmessage modified: .gitconfig modified: .kshrc modified: .mbsyncrc modified: .scripts/battery.sh modified: .scripts/doas_config.sh modified: .scripts/record_screen modified: .scripts/volume_control modified: .vimrc --- .config/git/.gitignore | 28 +++++++++ .gitmessage => .config/git/.gitmessage | 16 ++--- .dialogrc | 107 --------------------------------- .gitconfig | 6 +- .gitignore | 63 ------------------- .kshrc | 5 +- .mbsyncrc | 7 +-- .scripts/battery.sh | 46 ++++---------- .scripts/doas_config.sh | 2 +- .scripts/openbsd_rcctl.sh | 6 ++ .scripts/record_screen | 20 +++--- .scripts/volume_control | 2 +- .vimrc | 1 + 13 files changed, 74 insertions(+), 235 deletions(-) create mode 100644 .config/git/.gitignore rename .gitmessage => .config/git/.gitmessage (89%) delete mode 100644 .dialogrc delete mode 100644 .gitignore rewrite .scripts/battery.sh (72%) create mode 100644 .scripts/openbsd_rcctl.sh diff --git a/.config/git/.gitignore b/.config/git/.gitignore new file mode 100644 index 0000000..e36dcd3 --- /dev/null +++ b/.config/git/.gitignore @@ -0,0 +1,28 @@ +.Xauthority +.cache/ +.config/dconf/ +.config/htop +.config/hub +.config/neofetch/ +.dbus/ +.gnupg/private-keys-v1.d/ +.gnupg/pubring.gpg +.gnupg/pubring.kbx +.gnupg/pubring.kbx~ +.gnupg/random_seed +.gnupg/trustdb.gpg +.local/share/vifm/ +.local/share/xorg/ +.mozilla/ +.password-store/ +.serverauth.* +.ssh/ +.surf/cache/ +.surf/cookies.txt +.surf/script.js +.vim/.netrwhist +.vim/autoload/ +.vim/plugged/ +documents/ +downloads/ +todo.txt diff --git a/.gitmessage b/.config/git/.gitmessage similarity index 89% rename from .gitmessage rename to .config/git/.gitmessage index 5a8d3be..0f2aef8 100644 --- a/.gitmessage +++ b/.config/git/.gitmessage @@ -1,13 +1,4 @@ -[tag] - -# * sub -# - discription - -# problem: -# solution: - -# fix issues -# Fixes #1 +[] # --- COMMIT END --- # Why was this change necessary? @@ -24,3 +15,8 @@ # dbg (Changes in debugging code/frameworks; no production code change) # license (Edits regarding licensing; no production code change) # hack (Temporary fix to make things move forward; please avoid it) +# +# problem +# solution +# fix issues +# Fixes #1 diff --git a/.dialogrc b/.dialogrc deleted file mode 100644 index 4384ff0..0000000 --- a/.dialogrc +++ /dev/null @@ -1,107 +0,0 @@ -# -# Run-time configuration file for dialog -# -# Automatically generated by "dialog --create-rc " -# -# -# Types of values: -# -# Number - -# String - "string" -# Boolean - -# Attribute - (foreground,background,highlight?) -# - - -# Shadow dialog boxes? This also turns on color. -use_shadow = OFF - -# Turn color support ON or OFF -use_colors = ON - -# Screen color -screen_color = (RED,BLACK,ON) - -# Shadow color -shadow_color = (YELLOW,BLACK,OFF) - -# Dialog box color -dialog_color = (GREEN,BLACK,OFF) - -# Dialog box title color -title_color = (RED,BLACK,OFF) - -# Dialog box border color -border_color = (BLACK,BLACK,ON) - -# Active button color -button_active_color = (BLACK,RED,OFF) - -# Inactive button color -button_inactive_color = (YELLOW,BLACK,OFF) - -# Active button key color -button_key_active_color = (BLACK,RED,ON) - -# Inactive button key color -button_key_inactive_color = (RED,BLACK,OFF) - -# Active button label color -button_label_active_color = (blue,RED,OFF) - -# Inactive button label color -button_label_inactive_color = (BLACK,BLACK,ON) - -# Input box color -inputbox_color = (YELLOW,BLACK,OFF) - -# Input box border color -inputbox_border_color = (YELLOW,BLACK,OFF) - -# Search box color -searchbox_color = (YELLOW,BLACK,OFF) - -# Search box title color -searchbox_title_color = (YELLOW,BLACK,ON) - -# Search box border color -searchbox_border_color = (BLACK,BLACK,ON) - -# File position indicator color -position_indicator_color = (RED,BLACK,OFF) - -# Menu box color -menubox_color = (YELLOW,BLACK,OFF) - -# Menu box border color -menubox_border_color = (BLACK,BLACK,ON) - -# Item color -item_color = (WHITE,BLACK,OFF) - -# Selected item color -item_selected_color = (BLACK,RED,OFF) - -# Tag color -tag_color = (YELLOW,BLACK,OFF) - -# Selected tag color -tag_selected_color = (BLACK,RED,OFF) - -# Tag key color -tag_key_color = (RED,BLACK,OFF) - -# Selected tag key color -tag_key_selected_color = (BLACK,RED,ON) - -# Check box color -check_color = (YELLOW,BLACK,OFF) - -# Selected check box color -check_selected_color = (BLACK,RED,ON) - -# Up arrow color -uarrow_color = (RED,BLACK,OFF) - -# Down arrow color -darrow_color = (RED,BLACK,OFF) diff --git a/.gitconfig b/.gitconfig index eeab964..58ee17b 100644 --- a/.gitconfig +++ b/.gitconfig @@ -5,6 +5,7 @@ [core] editor = vim + excludesfile = ~/.config/git/.gitignore [color] ui = true @@ -30,7 +31,7 @@ [commit] gpgsign = true - template = ~/.gitmessage + template = ~/.config/git/.gitmessage [push] default = current @@ -53,7 +54,7 @@ st = status s = status --short --branch ch = checkout - remotes = remote -v # show remotes urls + remotes = remote -v # Merge m = merge @@ -147,4 +148,3 @@ # stash # git stash save # git stash pop - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1e87585..0000000 --- a/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -.Xauthority -.config/dconf/ -.config/gconf/ -.gnome2/ -.abook/ -.cache/ -.config/VirtualBox/ -.config/enchant/ -.config/glib-2.0/ -.config/gnome-games/ -.config/htop/ -.config/hub -.config/libreoffice/ -.config/mutt/cache/ -.config/mutt/tmp/ -.config/neofetch -.config/pavucontrol.ini -.config/pulse/ -.config/vifm/vifm-help.txt -.config/vifm/vifminfo -.dbus/ -.dropbox-dist/ -.dropbox/ -.gnupg/\.* -.gnupg/private-keys-v1.d/ -.gnupg/pubring.* -.gnupg/random_seed -.gnupg/trustdb.gpg -.hashcat/ -.lesshst -.local/share/fonts/.uuid -.local/share/icons/ -.local/share/recently-used.xbel -.local/share/themes/ -.local/share/vifm/ -.local/share/vlc/ -.local/share/webkitgtk/ -.local/share/xorg/ -.mail/ -.mozilla/ -.msmtp.log -.newsboat/cache.db* -.nv/ -.password-store/ -.python_history -.serverauth.* -.sndio/ -.ssh/ -.surf/cache/ -.surf/cookies.txt -.surf/script.js -.tor/ -.vim/.netrwhist -.vim/autoload/ -.vim/plugged/ -.viminfo -Dropbox/ -documents/ -downloads/ -github/ -recorded_screen/ -st.core -todo.txt diff --git a/.kshrc b/.kshrc index ffbbe8f..b30b656 100644 --- a/.kshrc +++ b/.kshrc @@ -1,6 +1,5 @@ #!/bin/ksh -# ifconfig athn0 down; sh /etc/netstart alias k='clear' alias mv='mv -i' alias cp='cp -ir' @@ -23,7 +22,7 @@ alias yv="youtube-dl -i --add-metadata -f webm" alias yvp="youtube-dl -i --add-metadata -f webm -o \"%(autonumber)s-%(title)s.%(ext)s\"" [ "$(id -u)" = 0 ] && col="9m" || col="2m" -export PS1="\[\033[48;5;233m\]\[\033[38;5;$col\]\h \W \[\033[00m\]" +export PS1="\[\033[48;5;233m\]\[\033[38;5;$col\]\h \W\[\033[00m\] " ex(){ [ -f "$1" ] && case $1 in @@ -54,6 +53,4 @@ fixp(){ [ -f "$1" ] || [ -d "$1" ] && find "$1" -type d -exec chmod 700 {} \; && find "$1" -type f -exec chmod 600 {} \; -# find "$1" -type d | xargs chmod 700 && -# find "$1" -type f | xargs chmod 600 } diff --git a/.mbsyncrc b/.mbsyncrc index 6583799..f0424a3 100644 --- a/.mbsyncrc +++ b/.mbsyncrc @@ -10,16 +10,13 @@ Account afify MaildirStore afify-local Path ~/.mail/afify/ -Inbox ~/.mail/afify/Inbox/ +Inbox ~/.mail/afify/Inbox Channel afify Master :afify-remote: Slave :afify-local: Create Both +Sync All Expunge Both SyncState * Patterns * - -# Sync All -# AuthMechs LOGIN -# AuthMechs PLAIN diff --git a/.scripts/battery.sh b/.scripts/battery.sh dissimilarity index 72% index 043ebdb..dfd3bbe 100644 --- a/.scripts/battery.sh +++ b/.scripts/battery.sh @@ -1,33 +1,13 @@ -#!/bin/sh - -if [ "$(uname)" = "OpenBSD" ]; then - ac=$(apm -a) - battery=$(apm -b) - battery_lifetime_p=$(apm -l) - battery_lifetime_m=$(apm -m) - - case $battery in - 0) exit ;; -# 1) echo low ;; -# 2) echo critical ;; - 3) echo " $battery_lifetime_p $battery_lifetime_m" ;; -# 4) echo absent ;; - 255) echo "" ;; - esac - - case $ac in - 0) echo " $battery_lifetime_p $battery_lifetime_m" ;; -# 1) echo connected ;; -# 2) echo backup ;; - 255) echo ac_unknown ;; - esac - -elif [ "$(uname)" = "Linux" ]; then - bstatus=$(acpi | awk '/Battery 0:/ {print $3}') - case $bstatus in - Full,) exit ;; - Discharging,) acpi | awk '/Battery 0:/ {print "  "$4" "$5}' ;; - Charging,) acpi | awk '/Battery 0:/ {print " "$4" "$5}' ;; - *) echo "" ;; - esac -fi +#!/bin/sh + +[ "$(uname)" = "OpenBSD" ] && [ $(apm -l) -lt 100 ] && case $(apm -a) in + 0) echo  $(apm -l)% $(apm -m) ;; + 1) echo  $(apm -l)% ;; esac && exit + +[ "$(uname)" = "Linux" ] && bstatus=$(acpi | awk '/Battery 0:/ {print $3}') &&\ + case $bstatus in + Full,) exit ;; + Discharging,) acpi | awk '/Battery 0:/ {print "  "$4" "$5}' ;; + Charging,) acpi | awk '/Battery 0:/ {print " "$4" "$5}' ;; + *) echo "" ;; + esac diff --git a/.scripts/doas_config.sh b/.scripts/doas_config.sh index 677d4a6..02a6d7e 100644 --- a/.scripts/doas_config.sh +++ b/.scripts/doas_config.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo "permit :wheel +echo "permit :wheel permit nopass hassan cmd pkg_add permit nopass hassan cmd pkg_info permit nopass hassan cmd fw_update diff --git a/.scripts/openbsd_rcctl.sh b/.scripts/openbsd_rcctl.sh new file mode 100644 index 0000000..93a5250 --- /dev/null +++ b/.scripts/openbsd_rcctl.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +rcctl disable smtpd +rcctl disable sshd +rcctl enable apmd +rcctl set apmd flags -A diff --git a/.scripts/record_screen b/.scripts/record_screen index d6b9868..fda9062 100755 --- a/.scripts/record_screen +++ b/.scripts/record_screen @@ -1,20 +1,24 @@ #!/bin/sh -save_at="$HOME/recorded_screen" +save_at="/mnt/data/recorded_screen" time_date=$(date +'%Y_%m_%d_%H_%M_%S') -# monitor_size="1056x1080" -# monitor_size="1920x1080" -monitor_size="960x1080" +fullscreen=0 frate="25" hide_mouse="-draw_mouse 0" encoding="libx264 -preset ultrafast" -# monitor_size="1920x1080" # encoding="ffvhuff" - +ms=$(xrandr | grep -w connected | awk -F'[ \+]' '{print $4}') +mh=$(echo "$ms" | awk -Fx '{print $1}') +mw=$(echo "$ms" | awk -Fx '{print $2}') +hms="$(( $mh / 2))x$mw" is_running=$(pgrep -f "ffmpeg -f" | wc -l) + +[ -d "$save_at" ] || mkdir "$save_at" +[ $fullscreen -eq 1 ] && monitor_size=$ms || monitor_size=$hms + if [ "$is_running" -eq 0 ]; then - [ -d "$save_at" ] || mkdir "$save_at" - ffmpeg -f x11grab -video_size $monitor_size -framerate $frate $hide_mouse -i $DISPLAY -c:v $encoding $save_at/$time_date.mkv + ffmpeg -f x11grab -video_size $monitor_size -framerate $frate \ + $hide_mouse -i $DISPLAY -c:v $encoding $save_at/$time_date.mkv else pkill ffmpeg fi diff --git a/.scripts/volume_control b/.scripts/volume_control index 26dc003..d993508 100755 --- a/.scripts/volume_control +++ b/.scripts/volume_control @@ -5,7 +5,7 @@ inc_vol(){ case $(uname) in - Linux) pactl set-sink-volume 0 + 5% ;; + Linux) pactl set-sink-volume 0 +5% ;; OpenBSD) mixerctl outputs.master=$(($left_master + 10)) ;; esac } diff --git a/.vimrc b/.vimrc index 147f2c9..1bc37dd 100644 --- a/.vimrc +++ b/.vimrc @@ -8,6 +8,7 @@ set encoding=utf-8 set fileformat=unix set noswapfile set backspace=indent,eol,start +set viminfo= "============================================================================== " Plugins -- 2.11.4.GIT