Browse Source

Syncthing devices on user control panel

Bob Mottram 9 years ago
parent
commit
ff2e640bde
1 changed files with 27 additions and 11 deletions
  1. 27
    11
      src/freedombone-controlpanel-user

+ 27
- 11
src/freedombone-controlpanel-user View File

616
     fi
616
     fi
617
 }
617
 }
618
 
618
 
619
+function syncthing_devices {
620
+    SYNCTHING_CONFIG_FILE=~/.syncthingids
621
+    SYNCTHING_ID=$(cat ~/.syncthing-server-id)
622
+    if [ ! -f $SYNCTHING_CONFIG_FILE ]; then
623
+        echo $'# Your syncthing configuration file' > $SYNCTHING_CONFIG_FILE
624
+        echo '#' >> $SYNCTHING_CONFIG_FILE
625
+        echo $"# The ${PROJECT_NAME} syncthing ID is: $SYNCTHING_ID"
626
+        echo '#' >> $SYNCTHING_CONFIG_FILE
627
+        echo '# Paste the IDs of your devices below' >> $SYNCTHING_CONFIG_FILE
628
+        echo '#' >> $SYNCTHING_CONFIG_FILE      
629
+    fi
630
+    editor $SYNCTHING_CONFIG_FILE
631
+}
632
+
619
 function menu_top_level {
633
 function menu_top_level {
620
     while true
634
     while true
621
     do
635
     do
623
         trap "rm -f $data" 0 1 2 5 15
637
         trap "rm -f $data" 0 1 2 5 15
624
         dialog --backtitle $"Freedombone User Control Panel" \
638
         dialog --backtitle $"Freedombone User Control Panel" \
625
                --title $"User Control Panel" \
639
                --title $"User Control Panel" \
626
-               --radiolist $"Choose an operation:" 18 50 11 \
640
+               --radiolist $"Choose an operation:" 19 50 12 \
627
                1 $"Use Email" off \
641
                1 $"Use Email" off \
628
                2 $"Change Email Filtering Rules" off \
642
                2 $"Change Email Filtering Rules" off \
629
                3 $"Use Tox Chat" off \
643
                3 $"Use Tox Chat" off \
630
                4 $"Use XMPP Chat" off \
644
                4 $"Use XMPP Chat" off \
631
                5 $"Use IRC" off \
645
                5 $"Use IRC" off \
632
                6 $"Browse the Web" off \
646
                6 $"Browse the Web" off \
633
-               7 $"Your Encryption Keys" off \
634
-               8 $"Set an outgoing email proxy" off \
635
-               9 $"Administrator controls" off \
636
-               10 $"Exit to the command line" off \
637
-               11 $"Log out" on 2> $data
647
+               7 $"Syncthing devices" off \
648
+               8 $"Your Encryption Keys" off \
649
+               9 $"Set an outgoing email proxy" off \
650
+               10 $"Administrator controls" off \
651
+               11 $"Exit to the command line" off \
652
+               12 $"Log out" on 2> $data
638
         sel=$?
653
         sel=$?
639
         case $sel in
654
         case $sel in
640
             1) exit 1;;
655
             1) exit 1;;
647
             4) torify profanity;;
662
             4) torify profanity;;
648
             5) torify irssi;;
663
             5) torify irssi;;
649
             6) torify elinks;;
664
             6) torify elinks;;
650
-            7) menu_encryption_keys;;
651
-            8) smtp_proxy;;
652
-            9) menu_admin;;
653
-            10) break;;
654
-            11) kill -HUP `pgrep -s 0 -o`;;
665
+            7) syncthing_devices;;
666
+            8) menu_encryption_keys;;
667
+            9) smtp_proxy;;
668
+            10) menu_admin;;
669
+            11) break;;
670
+            12) kill -HUP `pgrep -s 0 -o`;;
655
         esac
671
         esac
656
     done
672
     done
657
 }
673
 }