Skip to content

Commit

Permalink
multiple gui browsers and profiles separately, skipping the help idea…
Browse files Browse the repository at this point in the history
… for the moment
  • Loading branch information
uriel1998 committed Oct 4, 2024
1 parent b81050a commit adf13bc
Show file tree
Hide file tree
Showing 7 changed files with 494 additions and 18 deletions.
9 changes: 8 additions & 1 deletion bookmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ fi
if [ ! -z "$GUI" ];then
posters=$(yad --width=400 --height=400 --center --window-icon=gtk-network --borders 3 --skip-taskbar --title="Choose outputs for $link" --text="${title}" --checklist --list --column=Use:RD --column=metadata:text $( /usr/bin/ls -A "$SCRIPT_DIR/out_enabled" | sed 's/.sh//g' | grep -v ".keep" | sed 's/^/false /' ) | awk -F '|' '{ print $2 }' | sed 's/$/.sh&/p' | awk '!_[$0]++' )
else
posters=$(/usr/bin/ls -A "$SCRIPT_DIR/out_enabled" | sed 's/.sh//g' | grep -v ".keep" | fzf --multi | sed 's/$/.sh&/p' | awk '!_[$0]++' )
header_text=$(echo -e "Title: ${title} \n Link: ${link}")
prompt_text="Choose your outputs!"
posters=$(/usr/bin/ls -A "$SCRIPT_DIR/out_enabled" | sed 's/.sh//g' | grep -v ".keep" | fzf --multi --header="$header_text" --header-lines=0 --prompt="$prompt_text" | sed 's/$/.sh&/p' | awk '!_[$0]++' )
fi

for p in $posters;do
Expand All @@ -98,6 +100,11 @@ for p in $posters;do
done

# TODO: add preview function to each of the modules for fzf --preview giving a quick explanation of what it does
# CHECK FOR THIS by checking for the preview string which will contain the path of the posters!!!!!!!!!!!!! so
# bookmarker_preview=$(ps aux | grep fzf | grep -v "grep" | grep -c ${SCRIPT_DIR}/out_enabled")
# so if that's > 0 then.... yup.
# TODO: modules for each possible browser?
# TODO: Allow calling an editor with multiselect capabilities of fzf?
# TODO: Preview current values (and allow editing of) with fzf selection screen


10 changes: 9 additions & 1 deletion out_avail/add_to_todo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@


function add_to_todo_send {

# todo-cli
binary=$(which todo-txt)
if [ -f ${binary} ];then
outstring=$(printf "%s : %s" "$title" "$link")
outstring=$(echo "$binary a \"$outstring\"")
eval ${outstring}
else
# todoman python package
binary=$(which todo)
if [ -f ${binary} ];then
outstring=$(printf "%s : %s" "$title" "$link")
outstring=$(echo "$binary new \"${outstring}\"")
eval ${outstring}
fi
fi
}
##############################################################################
Expand Down
21 changes: 6 additions & 15 deletions out_avail/facebook.sh → out_avail/chromium.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
#!/bin/bash

##############################################################################
#
# sending script
# (c) Steven Saus 2024
# Licensed under the MIT license
#
# REQUIRES URLENCODE which is in package gridsite-clients on Debian
# REQUIRES sensible-browser to be set up
##############################################################################
function chromium_send {

/usr/bin/chromium/firefox --new-tab "$link"

function facebook_send {
tmp=$(urlencode "${link}")
link="https://www.facebook.com/sharer/sharer.php?u=${tmp}"
outstring=$(echo "sensible-browser ${link} ")
eval ${outstring} > /dev/null
}



##############################################################################
# Are we sourced?
# From http://stackoverflow.com/questions/2683279/ddg#34642589
Expand All @@ -40,6 +31,6 @@ else
if [ ! -z "$2" ];then
title="$2"
fi
facebook_send
gui_browser_send
fi
fi
36 changes: 36 additions & 0 deletions out_avail/firefox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

function firefox_send {

/usr/bin/firefox --new-tab "$link"

}



##############################################################################
# Are we sourced?
# From http://stackoverflow.com/questions/2683279/ddg#34642589
##############################################################################

# Try to execute a `return` statement,
# but do it in a sub-shell and catch the results.
# If this script isn't sourced, that will raise an error.
$(return >/dev/null 2>&1)

# What exit code did that give?
if [ "$?" -eq "0" ];then
echo "[info] Function ready to go."
OUTPUT=0
else
OUTPUT=1
if [ "$#" = 0 ];then
echo -e "Please call this as a function or with \nthe url as the first argument and optional \ndescription as the second."
else
link="${1}"
if [ ! -z "$2" ];then
title="$2"
fi
gui_browser_send
fi
fi
5 changes: 4 additions & 1 deletion out_avail/gui_browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

function gui_browser_send {

/home/steven/apps/firefox/firefox --new-tab "$link"
/home/steven/apps/waterfox/waterfox --new-tab "$link"

}



##############################################################################
# Are we sourced?
# From http://stackoverflow.com/questions/2683279/ddg#34642589
Expand Down
36 changes: 36 additions & 0 deletions out_avail/work_browser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

function work_browser_send {

/home/steven/apps/waterfox/waterfox -P work -no-remote --class workWaterfoxProfile "$link"

}



##############################################################################
# Are we sourced?
# From http://stackoverflow.com/questions/2683279/ddg#34642589
##############################################################################

# Try to execute a `return` statement,
# but do it in a sub-shell and catch the results.
# If this script isn't sourced, that will raise an error.
$(return >/dev/null 2>&1)

# What exit code did that give?
if [ "$?" -eq "0" ];then
echo "[info] Function ready to go."
OUTPUT=0
else
OUTPUT=1
if [ "$#" = 0 ];then
echo -e "Please call this as a function or with \nthe url as the first argument and optional \ndescription as the second."
else
link="${1}"
if [ ! -z "$2" ];then
title="$2"
fi
gui_browser_send
fi
fi
Loading

0 comments on commit adf13bc

Please sign in to comment.