Share your alias AND/OR function

I think it is more sensible not to install flatpaks in the first place :wink: SCNR ā€¦

3 Likes

Thanks for the addition, Iā€™ll do it right away!

1 Like

If you have Flatpak installed does yay not update them?

Maybe itā€™s a relatively new feature? I could swear It doesnā€™t, but Iā€™ll have to try.

No, it doesnā€™t.

The reason i asked is because certain pamac versions have flatpak and yay updates AUR so just wondered not that i use flatpaks or want to. :wink:

pamac supports both snap and flatpak. pamac is much more than an AUR helper at this point. It is really Manjaroā€™s all in one package manager.

Iā€™m just surprised that yay hasnā€™t moved in that direction. I donā€™t use flatpaks or snaps and donā€™t intend to unless i was using a different distro. I donā€™t particularly want to have to use a bunch of different tools to update.

1 Like

This line I like for bash script ::: one folder to run from, anywhere on the system.

# Makes the script more portable #####################################################
######################################################################################
readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
######################################################################################

Interesting, but what is the use case for that script?
Usualy I have my custom scripts dumped inside ~/.local/bin so I want to apply the script on the ā€œcurrentā€ directory and not ~/.local/bin.

Here is, without doubt, the best alias ever: Post your handy utility scripts! - #125 by Kresimir

It has completely changed the way I use terminal.

Example readonly DIR.

############################################################
# Makes the script more portable ###########################
readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
############################################################

# konsole pacman update
readonly PACUP="${DIR}/002-pacman-konsole"

# konsole yay update aur
readonly YUPK="${DIR}/003-yay-konsole"
readonly YUP="sudo pacman -Qu"

# Manuals and tech
# readonly manned="${DIR}/manned"
# readonly wiki="${DIR}/wiki.sh"

# txt files for cat
readonly DBL="${DIR}/dblock"
readonly DN="${DIR}/done"
readonly OK="${DIR}/ok"
readonly Tpack="${DIR}/total-pack-upd"

##### Install pack list / remove pack list #################

# Search and install one package with yay
readonly INS1="${DIR}/search.sh"
# remove single package
readonly RM1="${DIR}/remove.sh"

# Add / Remove package to generate list
readonly INL="${DIR}/004-add-install-list"
readonly RML="${DIR}/005-add-remove-list"

# Install / Remove Pack List
readonly rmlist="${DIR}/007-remove-list.sh"
readonly inlist="${DIR}/008-install-list.sh"

###
# Install / Remove . TXT
readonly Rrmlist="${DIR}/remove-list.txt"
readonly Iinlist="${DIR}/install-list.txt"

etc .....

Maybe I should have said. Makes a script more portable when refer to external files included inside the folder.
With the line you can move the folder with the files where ever you want.

1 Like

Hereā€™s a couple of little goodies, adapted into functions for those interested in an easy way to check on updates without waiting for a notifierā€¦ you could even say itā€™s a ā€œnotify on demandā€! One of them safely produces a COUNT of pending updates (both repo and AUR) - and the other actually lists them.

Update count
# Function to count available updates

upcnt() {
# create vars
NEWPKG=0
NEWAUR=0

# count AUR and pacman updates
NEWAUR=`yay -Qua | wc -l`
NEWPKG=`checkupdates | wc -l`

# output RESULT
if [[ ${NEWPKG} == 0 && ${NEWAUR} == 0 ]]; then
	RESULT="System up-to-date"
else
	RESULT=$NEWPKG" Repo pkgs + "$NEWAUR" AUR pkgs need updating"
fi
echo $RESULT
}
Updates list
# Function to list available updates

upls() {
# create vars
NEWAUR=0

# count AUR updates
NEWAUR=`yay -Qua | wc -l`

# run checkupdatesext to create file in /tmp
checkupdatesext > /tmp/update-list
if [[ ${NEWAUR} > 0 ]]; then
		echo " " >> /tmp/update-list
		echo "AUR Packages" >> /tmp/update-list
		echo "------------" >> /tmp/update-list
		yay -Qua | column -t -N Name,Current,"->",New >> /tmp/update-list
fi

# output RESULT
if [[ -s /tmp/update-list ]]; then
	cat /tmp/update-list
	rm /tmp/update-list
else
	echo "No pending updates..."
fi
}

Just paste either or both of these into your .bashrc (or other appropriate place) and once it has been sourced they are available for your enjoyment.

Note: these are written to be understood and to work - not to be stylish or minimalistic!

What is going on there? Did that get broken in a copy paste to the forum or something?

1 Like

Removed it because it was messy :frowning:

sorry for the interruption :upside_down_face:

Must have been - certainly wouldnā€™t work that way! Fixed, I thinkā€¦
but Iā€™ll go back through it to see if anything else got creativeā€¦ :grin:

1 Like

That is a main reason that this is a simple ā€˜on-demandā€™ sort of thing - no scheduling needed or wanted! There are LOTS of notifiers out there (eos-notifier being one the best) - and even my own conky based scrollers etc - but this is for those who want to know NOW, whether it is how many - OR what - is pendingā€¦

i didnā€™t check it and took it from somewhere of my disk :upside_down_face:

Tunnel chrome connections through ssh
alias sshtun='ssh -N -D 9090 sshhost'
alias chrtun='/usr/bin/google-chrome --user-data-dir="$HOME/proxy-profile" --proxy-server="socks5://localhost:9090"'

Auto connect to wireless debugging on android
alias adbw='adb connect *ip*:$(nmap *ip* -p 37000-44000 | awk "/\/tcp/" | grep open | cut -d/ -f1)'

you can add wireless debugging to the phones quick tiles, so you just tap the tile, then run the alias

1 Like

been using this for a year it keeps every command, with default settings bash history has a limit(50 or 100 commands, not sure)