mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-04-15 14:58:18 +02:00
meta: Remove launch dependency
Now that I know how to use terminal multiplexers, and now that I understand more about how shells and terminals work, the launch dependency is no longer necessary. Additionally, *too many* abbreviations is difficult to use in the long term, no matter how short the commands are. Since I don't need to launch programs from the terminal as often anymore (now that I use rofi and other programs), this change makes sense.
This commit is contained in:
parent
d7a0419c2b
commit
9f27d4e13a
@ -4,28 +4,21 @@ _yay="yay_${_yayver}_x86_64"
|
|||||||
_rofipass="rofi-pass-${_rofipassver}"
|
_rofipass="rofi-pass-${_rofipassver}"
|
||||||
|
|
||||||
pkgname=tari-util
|
pkgname=tari-util
|
||||||
pkgver=0.1.0
|
pkgver=0.2.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Misc utility packages."
|
pkgdesc="Misc utility packages."
|
||||||
arch=('any')
|
arch=('any')
|
||||||
provides=('launch-cmd' 'yay' 'rofi-pass')
|
provides=('yay' 'rofi-pass')
|
||||||
conflicts=('launch-cmd' 'yay' 'rofi-pass')
|
conflicts=('yay' 'rofi-pass')
|
||||||
depends=('xdg-utils' 'rofi' 'pass' 'pwgen' 'xdotool')
|
depends=('xdg-utils' 'rofi' 'pass' 'pwgen' 'xdotool')
|
||||||
source=('launch.c'
|
source=("https://github.com/Jguer/yay/releases/download/v${_yayver}/${_yay}.tar.gz"
|
||||||
"https://github.com/Jguer/yay/releases/download/v${_yayver}/${_yay}.tar.gz"
|
|
||||||
"${_rofipass}.tar.gz::https://codeload.github.com/carnager/rofi-pass/tar.gz/${_rofipassver}")
|
"${_rofipass}.tar.gz::https://codeload.github.com/carnager/rofi-pass/tar.gz/${_rofipassver}")
|
||||||
sha256sums=('0c049434a4a7934a82fb122acfb92159eba665db81cab8af92da2f227f3274bd'
|
sha256sums=('e0f28c6be3c4322901438f324aed1f49ab593a8d4ed92279b1dda51381c51d6b'
|
||||||
'e0f28c6be3c4322901438f324aed1f49ab593a8d4ed92279b1dda51381c51d6b'
|
|
||||||
'82256730aa4ab6f0b3082eaa8410a93c284ca9fc1e0151de92d9dd703d850439')
|
'82256730aa4ab6f0b3082eaa8410a93c284ca9fc1e0151de92d9dd703d850439')
|
||||||
|
|
||||||
build() {
|
|
||||||
make launch
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
_yayout="${srcdir}/${_yay}"
|
_yayout="${srcdir}/${_yay}"
|
||||||
|
|
||||||
install -Dm 755 launch "$pkgdir"/usr/bin/launch
|
|
||||||
install -Dm 755 "$_yayout"/yay "$pkgdir"/usr/bin/yay
|
install -Dm 755 "$_yayout"/yay "$pkgdir"/usr/bin/yay
|
||||||
install -Dm 644 "$_yayout"/yay.8 "$pkgdir"/usr/share/man/man8/yay.8
|
install -Dm 644 "$_yayout"/yay.8 "$pkgdir"/usr/share/man/man8/yay.8
|
||||||
install -Dm 644 "$_yayout"/bash "$pkgdir"/usr/share/bash-completion/completions/yay
|
install -Dm 644 "$_yayout"/bash "$pkgdir"/usr/share/bash-completion/completions/yay
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
/* Copyright 2017 Maxwell Anselm.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// need a command to run
|
|
||||||
if (argc <= 1) return 1;
|
|
||||||
|
|
||||||
// fork to disown the child
|
|
||||||
pid_t child;
|
|
||||||
if (child = fork())
|
|
||||||
{
|
|
||||||
if (child == -1)
|
|
||||||
{
|
|
||||||
perror("fork");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("%ld\n", (long)child);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// silence output
|
|
||||||
if (!freopen("/dev/null", "w", stdout)) fprintf(stdout, "Failed to silence stdout\n");
|
|
||||||
if (!freopen("/dev/null", "w", stderr)) fprintf(stderr, "Failed to silence stderr\n");
|
|
||||||
|
|
||||||
// run the command
|
|
||||||
execvp(argv[1], argv + 1);
|
|
||||||
|
|
||||||
// if execvp returns, it's an error
|
|
||||||
if (freopen("/dev/tty", "w", stderr)) perror(argv[0]);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
@ -65,9 +65,6 @@ if not set -q set_abbr
|
|||||||
abbr c "clear" # Because 5 letters is too much
|
abbr c "clear" # Because 5 letters is too much
|
||||||
abbr e "exit"
|
abbr e "exit"
|
||||||
abbr l "ls -l"
|
abbr l "ls -l"
|
||||||
abbr f "launch feh --auto-zoom" # Easy image viewing with f
|
|
||||||
abbr z "launch zathura" # Easy document browsing with z
|
|
||||||
abbr m "launch mpv" # Easy media playing with m
|
|
||||||
abbr w "wal -o ~/.config/wal/done.sh"
|
abbr w "wal -o ~/.config/wal/done.sh"
|
||||||
abbr T "tree"
|
abbr T "tree"
|
||||||
|
|
||||||
|
@ -56,4 +56,4 @@ echo $BSPWM_TOP_PADDING > $HOME/.cache/polybar/bspwm_top_padding
|
|||||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Start polybar
|
# Start polybar
|
||||||
launch polybar main
|
polybar main &
|
||||||
|
@ -26,7 +26,7 @@ alias r rename
|
|||||||
alias d delete
|
alias d delete
|
||||||
|
|
||||||
# Alias w to wal
|
# Alias w to wal
|
||||||
alias w shell -fs launch wal -o "$HOME/.config/wal/done.sh" -i %f
|
alias w shell -fs wal -o "$HOME/.config/wal/done.sh" -i %f
|
||||||
|
|
||||||
set use_preview_script true
|
set use_preview_script true
|
||||||
set preview_files true
|
set preview_files true
|
||||||
|
Loading…
Reference in New Issue
Block a user