Skip to content
Snippets Groups Projects
Commit 01272e38 authored by Recolic K's avatar Recolic K
Browse files

optimize scripts

parent 5441e08e
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ gnome-keyring-yubikey-unlock/create_secret_file.sh /path/to/your_secret [Your Gn ...@@ -48,7 +48,7 @@ gnome-keyring-yubikey-unlock/create_secret_file.sh /path/to/your_secret [Your Gn
# input your keyring:password # input your keyring:password
``` ```
As an example, I need to input `默认钥匙环:My_Very_Long_Login_Password`. As an example, I need to input `默认钥匙环:My_Very_Long_Login_Password`. (You may use `seahorse` to determine the name of your keyring)
Then, add the following command to gnome-autostart. You should know how to auto-run a command after starting gnome. Then, add the following command to gnome-autostart. You should know how to auto-run a command after starting gnome.
......
#!/bin/bash #!/bin/bash
# This script should be run after gnome being started. # This script should be run after gnome being started.
_my_path="$0" _self_bin_name="$0"
secret_file="$1" secret_file="$1"
[[ "$secret_file" = '' ]] && echo "Usage: $0 <secret_file>" && exit 1 [[ "$secret_file" = '' ]] && echo "Usage: $0 <secret_file>" && exit 1
...@@ -15,10 +15,11 @@ function where_is_him () { ...@@ -15,10 +15,11 @@ function where_is_him () {
done done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
echo -n "$DIR" echo -n "$DIR"
} }
function where_am_i () { function where_am_i () {
where_is_him "$_my_path" _my_path=`type -p ${_self_bin_name}`
[[ "$_my_path" = "" ]] && where_is_him "$_self_bin_name" || where_is_him "$_my_path"
} }
cd `where_am_i` && cd `where_am_i` &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment