diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-29 21:54:51 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-29 21:54:51 +0900 |
| commit | f9f1ce2af8546c0825192a8c89d596c200d7fe2d (patch) | |
| tree | 1cb3a411bcc9ebbb429aba050bf7eb9cab3575cc | |
| parent | cd12c95fbb657a20f256cde65a736ab0ab53e0e6 (diff) | |
modified lf/lfrc, modified x11/xprofile, modified zsh/scripts.zsh, modified bin/dmenuconnections, created bin/extract
| -rw-r--r-- | ar/.config/lf/lfrc | 18 | ||||
| -rw-r--r-- | ar/.config/x11/xprofile | 35 | ||||
| -rw-r--r-- | ar/.config/zsh/scripts.zsh | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/dmenuconnections | 9 | ||||
| -rwxr-xr-x | ar/.local/bin/extract | 41 |
5 files changed, 59 insertions, 46 deletions
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc index 2015704..6899204 100644 --- a/ar/.config/lf/lfrc +++ b/ar/.config/lf/lfrc @@ -194,13 +194,17 @@ cmd extract ${{ *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjf $fx;; *.tar.gz|*.tgz) tar xzf $fx ;; *.tar.xz|*.txz) tar xf $fx ;; - *.bz2) bunzip2 $fx ;; - *.rar) unrar e $fx ;; - *.gz) gunzip $fx ;; - *.tar) tar xf $fx ;; - *.zip) unzip $fx ;; - *.Z) uncompress $fx ;; - *.7z) 7z x $fx ;; + *.bz2) bunzip2 $fx ;; + *.lzma) unlzma $fx ;; + *.rar) unrar e $fx ;; + *.gz) gunzip $fx ;; + *.tar) tar xf $fx ;; + *.xz) unxz $fx ;; + *.zip|*.jar|*.war) unzip $fx ;; + *.Z) uncompress $fx ;; + *.7z) 7z x $fx ;; + *.exe) cabextract $fx ;; + *.ace) unace x $fx ;; esac } }} diff --git a/ar/.config/x11/xprofile b/ar/.config/x11/xprofile index 400d8c3..73119d0 100644 --- a/ar/.config/x11/xprofile +++ b/ar/.config/x11/xprofile @@ -1,37 +1,6 @@ #!/bin/sh -default="--mode 1920x1080 --rotate normal --scale 1.0x1.0 --dpi 96" - -for connected in $(xrandr -q | grep -w "connected" | cut -d ' ' -f 1); do - case $connected in - eDP*) edp="$connected" ;; - HDMI*) hdmi="$connected" ;; - DP*) dp="$connected" ;; - *) display="$connected" ;; - esac -done - -# If the lid is closed, turn off the laptop's screen -if grep -q "disabled" /sys/class/drm/card0-eDP-1/enabled || grep -q "closed" /proc/acpi/button/lid/LID/state; then - if [ -n "$hdmi" ] && [ -z "$dp" ] && [ -n "$edp" ]; then - xrandr --output "$edp" --off --output "$hdmi" --primary $default - elif [ -z "$hdmi" ] && [ -n "$dp" ] && [ -n "$edp" ]; then - xrandr --output "$edp" --off --output "$dp" --primary $default - else - xrandr --output "$edp" --off --output "$display" --auto --primary $default - fi -else - # Apply display settings when lid is open - if [ -n "$hdmi" ] && [ -z "$dp" ] && [ -n "$edp" ]; then - xrandr --output "$edp" --pos 1920x0 $default --output "$hdmi" --primary --pos 0x0 $default - elif [ -z "$hdmi" ] && [ -n "$dp" ] && [ -n "$edp" ]; then - xrandr --output "$edp" --pos 1920x0 $default --output "$dp" --primary --pos 0x0 $default - elif [ -z "$hdmi" ] && [ -z "$dp" ] && [ -n "$edp" ]; then - xrandr --output "$edp" --primary $default - else - xrandr --output "$display" --primary --auto - fi -fi +xrandr --auto --dpi 96 # adjust the number based on your resolution and size of the screen setbg & # set the background with the `setbg` script # fcitx5 & # set the input method, but it will be separate with fcitx5-remote @@ -40,7 +9,7 @@ setbg & # set the background with the `setbg` script # xrdb "${XDG_CONFIG_HOME:-${HOME}/.config}/x11/xresources" & # xrdbpid=$! -autostart="mpd xcompmgr dunst unclutter pipewire remapd" +autostart="mpd xcompmgr dunst unclutter pipewire blueman-applet remapd" for program in $autostart; do pidof -sx "$program" || "$program" & diff --git a/ar/.config/zsh/scripts.zsh b/ar/.config/zsh/scripts.zsh index 07e9c87..7f9600e 100644 --- a/ar/.config/zsh/scripts.zsh +++ b/ar/.config/zsh/scripts.zsh @@ -425,7 +425,7 @@ function xev_aligned_key_event() { # kill process alias fpkill=fzf_kill_process function fzf_kill_process() { - ps aux | + ps aux | grep -e "^$(whoami)" | fzf --height 40% \ --layout=reverse \ --header-lines=1 \ diff --git a/ar/.local/bin/dmenuconnections b/ar/.local/bin/dmenuconnections index 024e7da..cc39771 100755 --- a/ar/.local/bin/dmenuconnections +++ b/ar/.local/bin/dmenuconnections @@ -3,8 +3,6 @@ # initial configuration # sudo pacman --noconfirm -S bluez-utils pulseaudio-bluetooth pulseaudio-alsa blueman # sudo ln -vsf ${PWD}/etc/bluetooth/main.conf /etc/bluetooth/main.conf -# sudo systemctl start bluetooth.service -# sudo systemctl enable bluetooth.service # Requires: # blueman @@ -13,14 +11,14 @@ # btmenu (https://github.com/cdown/btmenu) [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" -[ -z "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') +[ -z "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "🛜", int($3 * 100 / 70) "%" }') wifi=$(printf "%s %s" "${wifiicon}" "$(cat /sys/class/net/w*/operstate | sed "s/down/❎/;s/up/🌐/")") if [ -n "${wifi}" ]; then - choice=$(printf 'bluetooth\nnetwork' | dmenu -i -p "${wifi}") + choice=$(printf 'bluetooth\nnetwork\nwifi' | dmenu -i -p "${wifi}") else - choice=$(printf 'bluetooth\nnetwork' | dmenu -i -p 'Connect:') + choice=$(printf 'bluetooth\nnetwork\nwifi' | dmenu -i -p 'Connect:') fi case "${choice}" in @@ -33,4 +31,5 @@ bluetooth) esac ;; network) networkmanager_dmenu ;; +wifi) nmcli -c no d wifi list | tail -n +2 | sed 's/ \+/ /;s/Infra [0-9]*/ /g;s/WPA. .*$//;s/Mbit\/s[[:space:]]*[0-9]*/Mbit\/s/g;s/Ad-Hoc [0-9]*//g' | dmenu -l 20 -p Networks ;; esac diff --git a/ar/.local/bin/extract b/ar/.local/bin/extract new file mode 100755 index 0000000..b352a70 --- /dev/null +++ b/ar/.local/bin/extract @@ -0,0 +1,41 @@ +#!/bin/sh + +# Default behavior: Extract archive into new directory +# Behavior with `-c` option: Extract contents into current directory + +while getopts "hc" o; do case "${o}" in + c) extracthere="True" ;; + *) printf 'Options:\n -c: Extract archive into current directory rather than a new one.\n' && exit ;; + esac done + +if [ -z "$extracthere" ]; then + archive="$(readlink -f "$*")" && + directory=${archive%.*} && + mkdir -p "$directory" && + cd "$directory" || exit +else + archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")" +fi + +[ "$archive" = "" ] && printf 'Give archive to extract as argument.\n' && exit + +if [ -f "$archive" ]; then + case "$archive" in + *.tar.bz2 | *.tar.xz | *.tbz2) tar xvjf "$archive" ;; + *.tar.gz | *.tgz) tar xvzf "$archive" ;; + *.lzma) unlzma "$archive" ;; + *.bz2) bunzip2 "$archive" ;; + *.rar) unrar x -ad "$archive" ;; + *.gz) gunzip "$archive" ;; + *.tar) tar xvf "$archive" ;; + *.zip | *.jar | *.war) unzip "$archive" ;; + *.Z) uncompress "$archive" ;; + *.7z) 7z x "$archive" ;; + *.xz) unxz "$archive" ;; + *.exe) cabextract "$archive" ;; + *.ace) unace x "$archive" ;; + *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; + esac +else + printf 'File "%s" not found.\n' "$archive" +fi |
