├── README.mkd ├── ig-burn-tools ├── misc │ ├── screenshot-ig-burn-tools-burn-disc.png │ ├── screenshot-ig-burn-tools-configure.png │ ├── screenshot-ig-burn-tools-find.png │ ├── screenshot-ig-burn-tools-snapshot.png │ └── screenshot-ig-burn-tools-verify.png ├── pkg │ ├── IG-Burn-Tools.spacefm-plugin.tar.gz │ └── IG-Burn-Tools.spacefm-plugin.tar.gz.sig └── src │ ├── cstm_258dbec4 │ └── exec.sh │ ├── cstm_406561e6 │ ├── exec.sh │ └── verify.sh │ ├── cstm_697dd9ec │ ├── ChangeLog │ ├── README │ ├── burn.sh │ ├── checksums.sh │ ├── config.sh │ ├── configure.sh │ ├── depends.sh │ ├── exec.sh │ ├── savelog.sh │ ├── status.sh │ └── verify.sh │ ├── cstm_7d3dcf7e │ └── exec.sh │ └── plugin ├── ig-example-app ├── pkg │ ├── Example-Application.spacefm-plugin.tar.gz │ └── Example-Application.spacefm-plugin.tar.gz.sig └── src │ ├── cstm_66ed13fb │ ├── README │ └── exec.sh │ └── plugin ├── ig-paste-into ├── pkg │ ├── IG-Paste-Into.spacefm-plugin.tar.gz │ └── IG-Paste-Into.spacefm-plugin.tar.gz.sig └── src │ ├── cstm_07ce0964 │ ├── README │ └── exec.sh │ └── plugin └── ig-spacetv ├── pkg ├── IG-SpaceTV.spacefm-plugin.tar.gz └── IG-SpaceTV.spacefm-plugin.tar.gz.sig └── src ├── cstm_22f53177 └── exec.sh ├── cstm_24f65950 └── exec.sh ├── cstm_325c1cf6 ├── README ├── exec.sh └── spacetv.sh ├── cstm_44ddc0b1 └── exec.sh ├── cstm_6311c045 └── exec.sh └── plugin /README.mkd: -------------------------------------------------------------------------------- 1 | IgnorantGuru's SpaceFM Plugins Repo 2 | =================================== 3 | 4 | This repo contains plugins developed by IgnorantGuru for use in the [SpaceFM](https://github.com/IgnorantGuru/spacefm/) file manager. 5 | 6 | To see the list and instructions visit [IgnorantGuru's SpaceFM Plugins](https://github.com/IgnorantGuru/spacefm-plugins/wiki). 7 | 8 | To see ***ALL SpaceFM Plugins*** visit the [SpaceFM Plugins Wiki](https://github.com/IgnorantGuru/spacefm/wiki/plugins). 9 | -------------------------------------------------------------------------------- /ig-burn-tools/misc/screenshot-ig-burn-tools-burn-disc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/misc/screenshot-ig-burn-tools-burn-disc.png -------------------------------------------------------------------------------- /ig-burn-tools/misc/screenshot-ig-burn-tools-configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/misc/screenshot-ig-burn-tools-configure.png -------------------------------------------------------------------------------- /ig-burn-tools/misc/screenshot-ig-burn-tools-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/misc/screenshot-ig-burn-tools-find.png -------------------------------------------------------------------------------- /ig-burn-tools/misc/screenshot-ig-burn-tools-snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/misc/screenshot-ig-burn-tools-snapshot.png -------------------------------------------------------------------------------- /ig-burn-tools/misc/screenshot-ig-burn-tools-verify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/misc/screenshot-ig-burn-tools-verify.png -------------------------------------------------------------------------------- /ig-burn-tools/pkg/IG-Burn-Tools.spacefm-plugin.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/pkg/IG-Burn-Tools.spacefm-plugin.tar.gz -------------------------------------------------------------------------------- /ig-burn-tools/pkg/IG-Burn-Tools.spacefm-plugin.tar.gz.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-burn-tools/pkg/IG-Burn-Tools.spacefm-plugin.tar.gz.sig -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_258dbec4/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import # import file manager variables (scroll down for info) 3 | # 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # exec.sh: This script shows the Find In Snapshots command dialog and searches 8 | 9 | 10 | mkdir -p "$fm_cmd_data" 11 | snapshotpathfile="$fm_cmd_data/snapshotpath" 12 | path="`head -n 1 "$snapshotpathfile" 2> /dev/null`" 13 | if [ "$path" = "" ]; then 14 | eval path="~/burndisc-snapshots" 15 | mkdir -p $path 16 | fi 17 | 18 | choosersizefile="$fm_cmd_data/choosersize" 19 | if [ ! -e "$choosersizefile" ]; then 20 | echo "800x600" > "$choosersizefile" 21 | fi 22 | searchtermsfile="$fm_cmd_data/searchtermsopt" 23 | searchregexfile="$fm_cmd_data/searchregexopt" 24 | 25 | eval "`spacefm -g --title "Find In Snapshots" --window-size "@$choosersizefile" \ 26 | --label "Open a snapshot folder to search recursively:" \ 27 | --chooser --dir "$path/." \ 28 | --vbox --compact \ 29 | --hbox --compact \ 30 | --radio "Search Terms:" "@$searchtermsfile" \ 31 | --radio "Regular Expression:" "@$searchregexfile" \ 32 | --close-box \ 33 | --input \ 34 | --label --wrap "(case insensitive - leave blank to find currently selected filenames)" \ 35 | --close-box \ 36 | --button cancel --button ok 2>/dev/null`" 37 | 38 | if [ "$dialog_pressed" != "button2" ]; then 39 | exit 0 40 | fi 41 | 42 | path="$dialog_chooser1_dir" 43 | if [ -d "$path" ]; then 44 | echo "$path" > "$snapshotpathfile" 45 | fi 46 | regex=$dialog_radio2 47 | terms="$dialog_input1" 48 | 49 | unset out 50 | if [ "$terms" = "" ]; then 51 | if [ "${fm_filenames[0]}" = "" ]; then 52 | echo "Select one of more files in the file list to search for." 53 | exit 0 54 | fi 55 | if [ "${fm_filenames[1]}" = "" ]; then 56 | echo "Searching for file '${fm_filename}'..." 57 | else 58 | echo "Searching for ${#fm_filenames[@]} filenames..." 59 | fi 60 | n=$'\n' 61 | for f in "${fm_filenames[@]}"; do 62 | if [ "$terms" = "" ]; then 63 | terms="$f" 64 | else 65 | terms="$terms$n$f" 66 | fi 67 | done 68 | out=`grep -rF "$terms" "$path"` 69 | elif (( regex == 1 )); then 70 | echo ">>> grep -ir '$terms' '$path'" 71 | echo 72 | out=`grep -ir "$terms" "$path"` 73 | else 74 | echo "Searching for AND terms: $terms" 75 | for term in $terms; do 76 | if [ "$out" = "" ]; then 77 | out=`grep -irF "$term" "$path"` 78 | else 79 | out=`echo "$out" | grep -i "$term"` 80 | fi 81 | if [ "$out" = "" ]; then 82 | break 83 | fi 84 | done 85 | fi 86 | 87 | echo 88 | if [ "$out" = "" ]; then 89 | echo "No matches." 90 | else 91 | echo "$out" 92 | fi 93 | 94 | exit 0 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | exit $? 117 | # Example variables available for use: (imported by $fm_import) 118 | # These variables represent the state of the file manager when command is run. 119 | # These variables can also be used in command lines and in the Path Bar. 120 | 121 | # "${fm_files[@]}" selected files ( same as %F ) 122 | # "$fm_file" first selected file ( same as %f ) 123 | # "${fm_files[2]}" third selected file 124 | 125 | # "${fm_filenames[@]}" selected filenames ( same as %N ) 126 | # "$fm_filename" first selected filename ( same as %n ) 127 | 128 | # "$fm_pwd" current directory ( same as %d ) 129 | # "${fm_pwd_tab[4]}" current directory of tab 4 130 | # $fm_panel current panel number (1-4) 131 | # $fm_tab current tab number 132 | 133 | # "${fm_panel3_files[@]}" selected files in panel 3 134 | # "${fm_pwd_panel[3]}" current directory in panel 3 135 | # "${fm_pwd_panel3_tab[2]}" current directory in panel 3 tab 2 136 | # ${fm_tab_panel[3]} current tab number in panel 3 137 | 138 | # "${fm_desktop_files[@]}" selected files on desktop (when run from desktop) 139 | # "$fm_desktop_pwd" desktop directory (eg '/home/user/Desktop') 140 | 141 | # "$fm_device" selected device (eg /dev/sr0) ( same as %v ) 142 | # "$fm_device_udi" device ID 143 | # "$fm_device_mount_point" device mount point if mounted (eg /media/dvd) (%m) 144 | # "$fm_device_label" device volume label ( same as %l ) 145 | # "$fm_device_fstype" device fs_type (eg vfat) 146 | # "$fm_device_size" device volume size in bytes 147 | # "$fm_device_display_name" device display name 148 | # "$fm_device_icon" icon currently shown for this device 149 | # $fm_device_is_mounted device is mounted (0=no or 1=yes) 150 | # $fm_device_is_optical device is an optical drive (0 or 1) 151 | # $fm_device_is_table a partition table (usually a whole device) 152 | # $fm_device_is_floppy device is a floppy drive (0 or 1) 153 | # $fm_device_is_removable device appears to be removable (0 or 1) 154 | # $fm_device_is_audiocd optical device contains an audio CD (0 or 1) 155 | # $fm_device_is_dvd optical device contains a DVD (0 or 1) 156 | # $fm_device_is_blank device contains blank media (0 or 1) 157 | # $fm_device_is_mountable device APPEARS to be mountable (0 or 1) 158 | # $fm_device_nopolicy policy_noauto set (no automount) (0 or 1) 159 | 160 | # "$fm_panel3_device" panel 3 selected device (eg /dev/sdd1) 161 | # "$fm_panel3_device_udi" panel 3 device ID 162 | # ... (all these are the same as above for each panel) 163 | 164 | # "fm_bookmark" selected bookmark directory ( same as %b ) 165 | # "fm_panel3_bookmark" panel 3 selected bookmark directory 166 | 167 | # "fm_task_type" currently SELECTED task type (eg 'run','copy') 168 | # "fm_task_name" selected task name (custom menu item name) 169 | # "fm_task_pwd" selected task working directory ( same as %t ) 170 | # "fm_task_pid" selected task pid ( same as %p ) 171 | # "fm_task_command" selected task command 172 | # "fm_task_id" selected task id 173 | # "fm_task_window" selected task window id 174 | 175 | # "$fm_command" current command 176 | # "$fm_value" menu item value ( same as %a ) 177 | # "$fm_user" original user who ran this command 178 | # "$fm_my_task" current task's id (see 'spacefm -s help') 179 | # "$fm_my_window" current task's window id 180 | # "$fm_cmd_name" menu name of current command 181 | # "$fm_cmd_dir" command files directory (for read only) 182 | # "$fm_cmd_data" command data directory (must create) 183 | # To create: mkdir -p "$fm_cmd_data" 184 | # "$fm_plugin_dir" top plugin directory 185 | # tmp="$(fm_new_tmp)" makes new temp directory (destroy when done) 186 | # To destroy: rm -rf "$tmp" 187 | # fm_edit "FILE" open FILE in user's configured editor 188 | 189 | # $fm_import command to import above variables (this 190 | # variable is exported so you can use it in any 191 | # script run from this script) 192 | 193 | 194 | # Script Example 1: 195 | 196 | # # show MD5 sums of selected files 197 | # md5sum "${fm_files[@]}" 198 | 199 | 200 | # Script Example 2: 201 | 202 | # # Show a confirmation dialog using SpaceFM Dialog: 203 | # # http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#dialog 204 | # # Use QUOTED eval to read variables output by SpaceFM Dialog: 205 | # eval "`spacefm -g --label "Are you sure?" --button yes --button no`" 206 | # if [[ "$dialog_pressed" == "button1" ]]; then 207 | # echo "User pressed Yes - take some action" 208 | # else 209 | # echo "User did NOT press Yes - abort" 210 | # fi 211 | 212 | 213 | # Script Example 3: 214 | 215 | # # Build list of filenames in panel 4: 216 | # i=0 217 | # for f in "${fm_panel4_files[@]}"; do 218 | # panel4_names[$i]="$(basename "$f")" 219 | # (( i++ )) 220 | # done 221 | # echo "${panel4_names[@]}" 222 | 223 | 224 | # Script Example 4: 225 | 226 | # # Copy selected files to panel 2 227 | # # make sure panel 2 is visible ? 228 | # # and files are selected ? 229 | # # and current panel isn't 2 ? 230 | # if [ "${fm_pwd_panel[2]}" != "" ] \ 231 | # && [ "${fm_files[0]}" != "" ] \ 232 | # && [ "$fm_panel" != 2 ]; then 233 | # cp "${fm_files[@]}" "${fm_pwd_panel[2]}" 234 | # else 235 | # echo "Can't copy to panel 2" 236 | # exit 1 # shows error if 'Popup Error' enabled 237 | # fi 238 | 239 | 240 | # Script Example 5: 241 | 242 | # # Keep current time in task manager list Item column 243 | # # See http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#sockets 244 | # while (( 1 )); do 245 | # sleep 0.7 246 | # spacefm -s set-task $fm_my_task item "$(date)" 247 | # done 248 | 249 | 250 | # Bash Scripting Guide: http://www.tldp.org/LDP/abs/html/index.html 251 | 252 | # NOTE: Additional variables or examples may be available in future versions. 253 | # To see the latest list, create a new command script or see: 254 | # http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#exvar 255 | 256 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_406561e6/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # exec.sh: This script shows the Verify Disc command - requires verify.sh 8 | 9 | 10 | mkdir -p "$fm_cmd_data" 11 | burnerfile="$fm_cmd_data/burner" 12 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 13 | if [ "$burner" = "" ]; then 14 | burner="/dev/sr0" 15 | echo "$burner" > "$burnerfile" 16 | fi 17 | verifyfile="$fm_cmd_data/verify" 18 | burn_verify="`head -n 1 "$verifyfile" 2> /dev/null`" 19 | if [ "$burn_verify" = "" ]; then 20 | burn_verify="Verify Checksums" 21 | fi 22 | verify=( "Verify Checksums" "Compare To Image" "Compare To Dir" ) 23 | 24 | verbosefile="$fm_cmd_data/verbose" 25 | 26 | i=0 27 | unset devs 28 | for d in /dev/*; do 29 | if [ "${d:0:8}" != "/dev/vcs" ] \ 30 | && [ "${d:0:8}" != "/dev/tty" ] \ 31 | && [ "${d:0:8}" != "/dev/ram" ] \ 32 | && [ "${d:0:9}" != "/dev/loop" ] \ 33 | && [ "${d:0:11}" != "/dev/hidraw" ]; then 34 | devs[i]="$d" 35 | (( i++ )) 36 | fi 37 | done 38 | 39 | settask() 40 | { 41 | spacefm -s set-task --window $fm_my_window $fm_my_task $1 "$2" 42 | } 43 | 44 | mountburner() 45 | { 46 | is_mounted="`udevil info "$burner" 2> "$viewpipe" | grep "^ is mounted:" | \ 47 | sed 's/.*: *\(.*\)/\1/'`" 48 | x=0 49 | while (( is_mounted != 1 && x < 10 )); do 50 | if (( x == 0 )); then 51 | echo "--- Mounting $burner..." > "$viewpipe" 52 | settask item "Mounting $burner" 53 | else 54 | sleep 2 55 | fi 56 | if (( verbose )); then 57 | echo ">>> udevil --quiet mount $burner" > "$viewpipe" 58 | fi 59 | udevil --quiet mount $burner > "$viewpipe" 2> "$viewpipe" 60 | 61 | is_mounted="`udevil info "$burner" 2> "$viewpipe" | grep "^ is mounted:" | \ 62 | sed 's/.*: *\(.*\)/\1/'`" 63 | (( x++ )) 64 | done 65 | if (( is_mounted != 1 )); then 66 | echo "*** Unable to mount $burner" > "$viewpipe" 67 | return 1 68 | fi 69 | info="`udevil info "$burner" 2> "$viewpipe"`" 70 | point="`echo "$info" | grep "^ mount paths:" | sed 's/.*: *\(.*\)/\1/'`" 71 | point="${point%%, *}" 72 | vollabel="`echo "$info" | grep "^ label:" | sed 's/.*: *\(.*\)/\1/'`" 73 | if [ ! -d "$point" ]; then 74 | return 1 75 | fi 76 | } 77 | 78 | eval "`spacefm -g --title "Verify Disc" \ 79 | --hbox --compact \ 80 | --label "Drive:" \ 81 | --combo --expand "${devs[@]}" -- "@$burnerfile" \ 82 | --close-box \ 83 | --hbox --compact \ 84 | --drop "${verify[@]}" -- "$burn_verify" \ 85 | --check "Verbose" "@$verbosefile" \ 86 | --close-box \ 87 | --button cancel \ 88 | --button "Verify:gtk-yes"`" 89 | 90 | if [ "$dialog_pressed" != "button2" ]; then 91 | exit 92 | fi 93 | 94 | burner="$dialog_combo1" 95 | echo "$burner" > "$burnerfile" 96 | burn_verify="$dialog_drop1" 97 | echo "$burn_verify" > "$verifyfile" 98 | if [ "$dialog_check1" = "1" ]; then 99 | verboseopt="--verbose" 100 | verbose=1 101 | else 102 | verboseopt="" 103 | verbose=0 104 | fi 105 | 106 | case "$burn_verify" in 107 | "Compare To Dir" ) 108 | while true; do 109 | eval "`spacefm -g --title "Choose Compare Directory" \ 110 | --chooser --dir . \ 111 | --button cancel \ 112 | --button ok`" 113 | if [ "$dialog_pressed" != "button2" ]; then 114 | exit 115 | elif [ -d "$dialog_chooser1" ]; then 116 | burn_path="$dialog_chooser1" 117 | break 118 | fi 119 | done 120 | ;; 121 | "Compare To Image" ) 122 | while true; do 123 | eval "`spacefm -g --title "Choose Compare Image" \ 124 | --chooser . \ 125 | --button cancel \ 126 | --button ok`" 127 | if [ "$dialog_pressed" != "button2" ]; then 128 | exit 129 | elif [ -f "$dialog_chooser1" ]; then 130 | createiso_path="$dialog_chooser1" 131 | break 132 | fi 133 | done 134 | ;; 135 | esac 136 | 137 | viewpipe=/dev/stdout 138 | if ! mountburner; then 139 | exit 1 140 | fi 141 | 142 | settask item "Verify Disc" 143 | 144 | bash "$fm_cmd_dir/verify.sh" $verboseopt "$burn_verify" "$burner" \ 145 | "$burn_path" "$createiso_path" "$point" 146 | if [ $? -eq 0 ]; then 147 | echo 148 | echo "All files are equal." 149 | exit 0 150 | fi 151 | exit 1 152 | 153 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_406561e6/verify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # verify.sh: This script verifies disc contents by one of three methods. A 8 | # copy of this script is also used by the Verify Disc command. 9 | 10 | 11 | if [ "$1" = "--verbose" ]; then 12 | verbose=1 13 | shift 14 | else 15 | verbose=0 16 | fi 17 | 18 | burn_verify="$1" 19 | burner="$2" 20 | tree="$3" 21 | iso="$4" 22 | point="$5" 23 | if [ "$tree" != "/" ]; then 24 | # strip trailing slash 25 | tree="${tree%/}" 26 | fi 27 | 28 | if [ ! -p "$respipe" ]; then 29 | respipe=/dev/null 30 | fi 31 | if [ ! -p "$cmdpipe" ]; then 32 | cmdpipe=/dev/null 33 | fi 34 | if [ ! -p "$viewpipe" ]; then 35 | viewpipe=/dev/stdout 36 | fi 37 | 38 | setprogress() 39 | { 40 | (( percent = completed * 100 / deepsize )) 41 | (( completedm = completed / 1024 / 1024 )) 42 | spacefm -s set-task --window $fm_my_window $fm_my_task progress $percent 2>/dev/null & 43 | echo "set progress1 $percent % ( $completedm M / $deepsizem M )" > "$cmdpipe" & 44 | } 45 | 46 | if [ "$burn_verify" = "Verify Checksums" ]; then 47 | cd "$point" 48 | if [ -e "$point/.checksum.md5" ]; then 49 | if (( verbose )); then 50 | echo ">>> md5sum -c --warn \"$point/.checksum.md5\"" > "$viewpipe" 51 | md5sum -c --warn "$point/.checksum.md5" 2> "$viewpipe" > "$viewpipe" 52 | else 53 | md5sum -c --warn "$point/.checksum.md5" 2> "$viewpipe" # output to task dialog 54 | fi 55 | elif [ -e "$point/.checksum.md5.gz" ]; then 56 | if (( verbose )); then 57 | echo ">>> cat \"$point/.checksum.md5.gz\" | gzip -d | md5sum -c --warn" > "$viewpipe" 58 | cat "$point/.checksum.md5.gz" | gzip -d | md5sum -c --warn 2> "$viewpipe" > "$viewpipe" 59 | else 60 | cat "$point/.checksum.md5.gz" | gzip -d | md5sum -c --warn 2> "$viewpipe" # output to task dialog 61 | fi 62 | else 63 | echo "*** Missing $point/.checksum.md5[.gz] - cannot verify checksums" > "$viewpipe" 64 | echo "verifyfail" > "$respipe" 65 | exit 1 66 | fi 67 | if [ $? -eq 0 ]; then 68 | echo "verifyok" > "$respipe" 69 | exit 0 70 | else 71 | echo "verifyfail" > "$respipe" 72 | exit 1 73 | fi 74 | elif [ "$burn_verify" = "Compare To Dir" ]; then 75 | # Compare all files in burn dir (and subfolders) to moint point 76 | # Symlinks are followed 77 | if [ ! -d "$tree" ]; then 78 | echo "*** Missing Burn Dir $tree" > "$viewpipe" 79 | echo "verifyfail" > "$respipe" 80 | exit 1 81 | fi 82 | 83 | # get deep size 84 | deepsize="$(du -csL "$tree" 2>"$viewpipe")" 85 | if [ $? -ne 0 ]; then 86 | echo "errors reading $tree" > "$viewpipe" 87 | echo "verifyfail" > "$respipe" 88 | exit 1 89 | fi 90 | deepsize="$(echo "$deepsize" | tail -n 1)" 91 | deepsize="${deepsize%%[[:blank:]]*}" 92 | (( deepsize = deepsize * 1024 )) 93 | (( deepsizem = deepsize / 1024 )) 94 | completed=0 95 | setprogress 96 | 97 | IFS_OLD="$IFS" 98 | IFS=$'\n' 99 | diffcount=0 100 | filecount=0 101 | prosize=0 102 | treelen=${#tree} 103 | for f1 in `find -L "$tree" -type f`; 104 | do 105 | f2="${f1:$treelen}" 106 | f2="${f2#/}" 107 | f2="$point/$f2" 108 | (( filecount +=1 )) 109 | if [ -e "$f2" ]; then 110 | if (( verbose )); then 111 | echo ">>> cmp -s \"$f1\" \"$f2\"" > "$viewpipe" 112 | fi 113 | cmp -s "$f1" "$f2" 114 | if [ $? -ne 0 ]; then 115 | echo "DIFFERS: $f2" > "$viewpipe" 116 | (( diffcount +=1 )) 117 | fi 118 | else 119 | echo "MISSING: $f2" > "$viewpipe" 120 | (( diffcount +=1 )) 121 | fi 122 | fsize=`stat -Lc %s "$f1"` 123 | (( completed += fsize )) 124 | # don't setprogress too rapidly on small files 125 | (( prosize += fsize )) 126 | if (( prosize > 26214400 )); then 127 | prosize=0 128 | setprogress 129 | fi 130 | done 131 | IFS="$IFS_OLD" 132 | 133 | completed=$deepsize 134 | setprogress 135 | if (( filecount == 0 )); then 136 | echo 'ERROR: No files found.' > "$viewpipe" 137 | echo "verifyfail" > "$respipe" 138 | exit 1 139 | elif (( diffcount == 0 )); then 140 | echo "All $filecount files are equal." > "$viewpipe" 141 | echo "verifyok" > "$respipe" 142 | exit 0 143 | else 144 | echo "WARNING: $diffcount of $filecount files differ." > "$viewpipe" 145 | echo "verifyfail" > "$respipe" 146 | exit 1 147 | fi 148 | elif [ "$burn_verify" = "Compare To Image" ]; then 149 | # Method by OmegaPhil 150 | if [ ! -f "$iso" ]; then 151 | echo "*** Missing Image $iso" > "$viewpipe" 152 | echo "verifyfail" > "$respipe" 153 | exit 1 154 | fi 155 | isosize=`stat -Lc %s "$iso"` 156 | info="`udevil info "$burner" 2> "$viewpipe"`" 157 | blocksize="`echo "$info" | grep -m 1 "^ block size:" | sed 's/.*: *\(.*\)/\1/'`" 158 | if (( blocksize == 0 )); then 159 | blocksize=2048 160 | fi 161 | # Calculating number of blocks from the device to return 162 | (( blocks = isosize / blocksize )) 163 | if (( verbose )); then 164 | vrb="--verbose" 165 | echo ">>> dd if=\"$burner\" count=$blocks bs=$blocksize | cmp $vrb - \"$iso\"" > "$viewpipe" 166 | else 167 | vrb= 168 | fi 169 | dd if="$burner" count=$blocks bs=$blocksize | cmp $vrb - "$iso" 2> "$viewpipe" > "$viewpipe" 170 | if [ $? -eq 0 ]; then 171 | echo "verifyok" > "$respipe" 172 | exit 0 173 | else 174 | echo "verifyfail" > "$respipe" 175 | exit 1 176 | fi 177 | fi 178 | 179 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/ChangeLog: -------------------------------------------------------------------------------- 1 | 0.6 2013-02-15: 2 | added -joliet-long to burn.sh mkisofs_base 3 | added Find In Snapshots Search Terms/Regular Expression options 4 | Find In Snapshots fix no matches msg on grep exit status 5 | 0.5 2012-12-30: 6 | initial release 7 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/README: -------------------------------------------------------------------------------- 1 | README for IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 2 | https://github.com/IgnorantGuru/spacefm-plugins/blob/master/ig-burn-tools/src/cstm_697dd9ec/README 3 | 4 | Updated: v0.6 2013-Feb-15 5 | https://github.com/IgnorantGuru/spacefm-plugins/blob/master/ig-burn-tools/src/cstm_697dd9ec/ChangeLog 6 | 7 | Thanks to Thomas Schmitt and OmegaPhil for help and testing. 8 | 9 | 10 | Browse IgnorantGuru's SpaceFM Plugins: 11 | https://github.com/IgnorantGuru/spacefm-plugins/wiki 12 | 13 | Browse ALL SpaceFM Plugins: 14 | https://github.com/IgnorantGuru/spacefm/wiki/Plugins 15 | 16 | 17 | CONTENTS 18 | 19 | DESCRIPTION 20 | DEPENDENCIES 21 | INSTRUCTIONS 22 | SUPPORT 23 | LICENSE 24 | 25 | 26 | DESCRIPTION 27 | 28 | The IG Burn Tools plugin allows SpaceFM to be used as a simple GUI burning 29 | app. While it can be used as-is, it also allows you to easily 30 | customize burn commands and add additional functionality. You are also 31 | free to release modified versions of this plugin under a new name. 32 | 33 | To create disc content, files, folders, or links are placed in a burn 34 | directory, while the plugin displays the total size of files and 35 | remaining space on disc. Alternatively, an existing filesystem image 36 | can be burned, or a disc can be copied. 37 | 38 | This version of IG Burn Tools burns single session data discs only. It can 39 | optionally save md5 checksums for all files on the disc, so a disc can 40 | later be verified even if the original files are gone. It uses either 41 | mkisofs, xorrisofs, or genisoimage to create a filesystem image as a 42 | separate step, then uses cdrecord, cdrskin, or wodim to burn the 43 | image. It can optionally save a snapshot of disc contents after the 44 | burn. Finally, it can verify the burn by verifying checksums, 45 | comparing the disc to the filesystem image, or comparing disc contents 46 | to directory contents. 47 | 48 | IG Burn Tools adds the following commands to SpaceFM: 49 | 50 | Burn Disc Prepares disc content and burns a directory or image 51 | to disc, or copies a disc. Also adds checksums, 52 | takes a snapshot, and verifies. Includes a 53 | configuration dialog. 54 | 55 | Verify Disc Verifies disc content by checking on-disc checksums, 56 | comparing the disc to an image, or comparing disc 57 | contents to a directory. 58 | 59 | Take Snapshot Saves a text file snapshot of disc contents for later 60 | reference and searching. 61 | 62 | Find In Snapshots Searches through snapshots to find files, search 63 | terms, or a regex expression. 64 | 65 | 66 | DEPENDENCIES 67 | 68 | IG Burn Tools REQUIRES: 69 | 70 | spacefm v0.8.3 or later 71 | cdrecord OR cdrskin OR wodim (OR customize your burn commands) 72 | mkisofs OR xorrisofs OR genisoimage (OR customize your burn commands) 73 | udevil 74 | eject 75 | 76 | NOTE: Use of the genuine cdrtools or cdrskin is recommended over wodim 77 | (cdrkit). See http://cdrecord.berlios.de/private/linux-dist.html 78 | 79 | Plugin Installation Instructions: 80 | http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#plugins-install 81 | 82 | 83 | INSTRUCTIONS 84 | 85 | Select Plugins|IG Burn Tools|Burn Disc to open the Burn Disc dialog (this 86 | command can also be copied to another menu). This dialog is used to 87 | compose disc contents and monitor burn progress. The dialog has the 88 | following elements: 89 | 90 | Burn Dir:|Burn Image:|Copy Disc: 91 | At the top of the dialog, choose the burn function and enter a path 92 | to be burned - either a directory, an image location, or a drive to 93 | copy. When using Burn Dir, typically you will create a temporary 94 | directory to hold your disc contents, then paste links to files and 95 | folders into this directory. While the Burn Disc dialog is open, 96 | SpaceFM's status bars will show the deep size of all selected items. 97 | The deep size calculation follows links and descends into directories 98 | for a total size. Also, the Burn Disc task listed in the task manager 99 | will show the total space used and available for the burn, similar to a 100 | GUI burning app. 101 | 102 | Type: 103 | Select a media or burn type. By default the type will be set based on 104 | the media currently in the drive, but can also be changed. If no media 105 | is in the drive, the type, if recognized, will determine how much free 106 | space is available. A custom type can also be entered in the box, or 107 | added to the list with the Configure button. (All types are handled by 108 | the default burn command the same way, but you can add additional 109 | functionality which uses the Type to conditionally burn in different 110 | ways.) 111 | 112 | Speed: 113 | The speed at which to burn. If set to Max or empty, the default speed 114 | is used (usually the maximum for the media). Otherwise the speed is 115 | passed to cdrecord. The dialog will remember the last speed used for 116 | each Type. 117 | 118 | Label: 119 | The volume label of the disc. This is set by default to the current 120 | label of the disc in the drive, or to the name of the burn directory. 121 | 122 | Checksums 123 | If checked, md5sum will be used to generate checksums for all files on 124 | the disc, and a gzipped checksum file will be burned to the disc, 125 | allowing the disc to be verified after the burn or anytime later. 126 | 127 | Snapshot 128 | When checked, a save dialog will open allowing you to choose a snapshot 129 | filename. A snapshot is a text file containing a directory listing of 130 | the disc, created after the burn. Snapshots allow you to review or 131 | search what files are burned to what discs. 132 | 133 | Save Image 134 | When checked, a save dialog will open allowing you to choose an image 135 | filename. The filesystem image will be saved to this name rather than 136 | deleted when the burn is finished. 137 | 138 | Don't Verify|Verify Checksums|Compare To Image|Compare To Dir 139 | Sets the mode for data verification after burning. Depending on the 140 | burn function, not all methods may be allowed. 141 | 142 | Configure [button] 143 | Opens a Configuration dialog which allows you to change: 144 | 145 | Burner: 146 | The drive used to burn (eg /dev/sr0) 147 | 148 | Large Temp Dir: 149 | If specified, temporary image files will be saved to this directory 150 | rather than to the default SpaceFM tmp directory. Image files may 151 | be as large as the media being burned. 152 | 153 | Notify Command: 154 | When a burn has completed (successfully or with errors), the bash 155 | command line in Notify Command will be run. This can be used to 156 | play a sound, show a dialog, etc. to get attention. Note that the 157 | command is run via eval, which means some special characters may 158 | need to be escaped. 159 | 160 | Verbose Output 161 | Show detailed output in the monitor - useful for debugging burn 162 | commands, etc. 163 | 164 | Types: & Speeds: 165 | Entries in these lists will appear in the drop-down lists of the 166 | dialog. You can add additional types and speeds here. 167 | 168 | Select a file to edit... 169 | Selecting a file in this drop-down list will open it in your 170 | editor. In particular, the default burn programs can be set in 171 | config.sh, and the burn commands can be modified in burn.sh. Note 172 | that you will be unable to save the edited file unless you have 173 | copied the Burn Disc command from Plugins to another menu (plugins 174 | cannot be edited directly by the user). 175 | 176 | Save Log [button] 177 | Saves the contents of the monitor to a file you specify. 178 | 179 | Cancel [button] 180 | Cancels whatever task is in progress, or closes the dialog. 181 | 182 | Burn [button] 183 | Starts the burn process. 184 | 185 | 186 | SUPPORT 187 | 188 | For bugs, requests, or questions with this plugin, please post an issue to 189 | https://github.com/IgnorantGuru/spacefm-plugins/issues 190 | 191 | Support is provided for the IG Burn Tools GUI and internal 192 | functionality, but not for general errors or failures in the burn 193 | programs (eg cdrecord, etc), which you will need to research 194 | independently. 195 | 196 | 197 | LICENSE 198 | 199 | Copyright (C) 2013 IgnorantGuru 200 | 201 | This program is free software: you can redistribute it and/or modify 202 | it under the terms of the GNU General Public License as published by 203 | the Free Software Foundation, either version 2 of the License, or 204 | (at your option) any later version. 205 | 206 | This program is distributed in the hope that it will be useful, 207 | but WITHOUT ANY WARRANTY; without even the implied warranty of 208 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 209 | GNU General Public License for more details. 210 | 211 | You should have received a copy of the GNU General Public License 212 | along with this program. If not, see . 213 | 214 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/burn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 4 | # License: GPL2+ ( See README ) 5 | # 6 | # burn.sh: This script contains the commands to create filesystem images 7 | # and burn them to disc. Adjust your burn commands or options here. 8 | 9 | # NOTE: If you have prefered cdrecord/mkisofs programs, set them in config.sh 10 | 11 | 12 | # The base command to create a filesystem image: 13 | # ( Note that earlier xorrisofs requires options to be separated eg NO -fRrJ ) 14 | mkisofs_base="$mkisofs -f -R -r -J -joliet-long -iso-level 3" 15 | 16 | if [ "$1" = "--verbose" ]; then 17 | verbose=1 18 | shift 19 | else 20 | verbose=0 21 | fi 22 | 23 | checkprog() 24 | { 25 | if [ "$mkisofs" = "" ] || [ "$cdrecord" = "" ]; then 26 | echo "error: mkisofs or cdrecord not set" > "$viewpipe" 27 | return 1 28 | fi 29 | } 30 | 31 | printsize() 32 | { 33 | # print the number of 2K sectors required to burn the dir 34 | if ! checkprog; then 35 | exit 1 36 | fi 37 | tree="$1" 38 | if (( verbose )); then 39 | echo ">>> $mkisofs_base -print-size \"$tree\"" > "$viewpipe" 40 | fi 41 | $mkisofs_base -print-size "$tree" 2>/dev/null 42 | return $? 43 | } 44 | 45 | setstatus() 46 | { 47 | # Parses pacifier lines of cdrecord/cdrskin and updates status 48 | # Thanks to Thomas Schmitt for read method 49 | line= 50 | bslast=0 51 | while true; do 52 | # Progress lines in cdrskin and cdrecord terminate with CR, so need 53 | # to read one character at a time 54 | read -n 1 c 55 | if [ $? -ne 0 ]; then 56 | break 57 | fi 58 | if [ "$c" = $'\r' ] || [ "$c" = "" ]; then 59 | # CR or LF received 60 | if (( verbose )) || \ 61 | [ "$line" != "${line#Writing *time:}" ] || \ 62 | [ "$line" != "${line#Average write speed}" ] || \ 63 | [ "$line" != "${line#Min drive buffer fill was}" ] || \ 64 | [ "$line" != "${line#Fixating}" ] || \ 65 | [ "$line" != "${line#Starting to write}" ] || \ 66 | [ "$line" != "${line#Performing }" ] || \ 67 | [ "$line" != "${line#Blanking }" ] || \ 68 | [ "$line" != "${line/Total bytes/}" ] || \ 69 | [ "$line" != "${line/error/}" ] || \ 70 | [ "$line" != "${line/fifo was /}" ] || \ 71 | [ "$line" != "${line/fifo had /}" ]; then 72 | echo "$line" > "$viewpipe" 73 | fi 74 | #Track 01: 122 of 244 MB written (fifo 100%) [buf 99%] 10.8x. 75 | total="${line%% MB written*}" 76 | total="${total#*: }" 77 | written="${total%% of *}" 78 | total="${total##* of }" 79 | if [ "$written" != "" ] && [ "$total" != "" ]; then 80 | extra="${line##* written }" 81 | if [ "$extra" != "$line" ]; then 82 | (( total = total )) 83 | (( written = written )) 84 | (( percent = written * 100 / total )) 85 | extra="${extra%.}" 86 | percent="$percent % ( $written M / $total M ) $extra" 87 | plen=${#percent} 88 | if (( plen > 0 && plen < 80 )); then 89 | echo "set progress1 $percent" > "$cmdpipe" & 90 | else 91 | echo "set progress1 pulse" > "$cmdpipe" & 92 | fi 93 | fi 94 | fi 95 | line= 96 | bslast=0 97 | elif [ "$c" != $'\x08' ]; then # ignore backspaces 98 | line="$line$c" 99 | bslast=0 100 | elif (( bslast == 0 )); then 101 | # add linefeed on first backspace of a series 102 | if (( verbose )); then 103 | echo "$line" > "$viewpipe" 104 | fi 105 | line= 106 | bslast=1 107 | fi 108 | done 109 | } 110 | 111 | if [ "$1" = "--createiso" ]; then 112 | # create an iso file from directory tree 113 | tree="$2" 114 | iso="$3" 115 | type="$4" 116 | vollabel="$5" 117 | echo "--- Creating image..." > "$viewpipe" 118 | if (( verbose )); then 119 | echo " as $iso" > "$viewpipe" 120 | fi 121 | if ! checkprog; then 122 | echo "isofail" > "$respipe" 123 | exit 1 124 | fi 125 | #rm -f "$iso" 126 | if [ "$vollabel" = "" ]; then 127 | volopt= 128 | else 129 | volopt="-V" 130 | fi 131 | if (( verbose )); then 132 | echo ">>> $mkisofs_base $volopt "$vollabel" -o \"$iso\" \"$tree\"" > "$viewpipe" 133 | $mkisofs_base $volopt "$vollabel" -o "$iso" "$tree" 2> "$viewpipe" > "$viewpipe" 134 | else 135 | $mkisofs_base $volopt "$vollabel" -o "$iso" "$tree" # send output to task dlg 136 | fi 137 | if [ $? -eq 0 ]; then 138 | reply="isook" 139 | else 140 | reply="isofail" 141 | fi 142 | if [ -p "$respipe" ]; then 143 | echo "$reply" > "$respipe" 144 | fi 145 | exit 146 | elif [ "$1" = "--copyiso" ]; then 147 | # copy an iso file from drive 148 | drive="$2" 149 | iso="$3" 150 | type="$4" 151 | vollabel="$5" # ignored 152 | echo "--- Copying image from $drive..." > "$viewpipe" 153 | if (( verbose )); then 154 | echo " as $iso" > "$viewpipe" 155 | fi 156 | if ! checkprog; then 157 | echo "isofail" > "$respipe" 158 | exit 1 159 | fi 160 | #rm -f "$iso" 161 | 162 | if (( verbose )); then 163 | echo ">>> dd if=$drive of=\"$iso\"" > "$viewpipe" 164 | dd if=$drive of="$iso" 2> "$viewpipe" > "$viewpipe" 165 | else 166 | dd if=$drive of="$iso" 2> "$viewpipe" >/dev/null 167 | fi 168 | if [ $? -eq 0 ]; then 169 | reply="isook" 170 | else 171 | reply="isofail" 172 | fi 173 | if [ -p "$respipe" ]; then 174 | echo "$reply" > "$respipe" 175 | fi 176 | exit 177 | elif [ "$1" = "--burniso" ]; then 178 | # burn an iso file 179 | # type is currently ignored, but you can use it to modify the burn 180 | # command based on media type or a custom selected type. 181 | burner="$2" 182 | iso="$3" 183 | type="$4" 184 | if [ "$5" = "" ]; then 185 | speed="" 186 | else 187 | speed="speed=$5" 188 | fi 189 | if [ "$6" = "1" ]; then 190 | blank="blank=fast" 191 | else 192 | blank="" 193 | fi 194 | echo "--- Burning..." > "$viewpipe" 195 | if (( verbose )); then 196 | echo " from image $iso" > "$viewpipe" 197 | fi 198 | if ! checkprog; then 199 | echo "burnfail" > "$respipe" 200 | exit 1 201 | fi 202 | 203 | if (( verbose )); then 204 | echo ">>> $cdrecord -v $speed $blank -fs=8m -dev=$burner -data -dao \"$iso\"" \ 205 | > "$viewpipe" 206 | grace="" 207 | else 208 | grace="gracetime=0" 209 | fi 210 | 211 | # cannot use a named pipe here because read opens/closes the pipe repeatedly 212 | # causing a SIGPIPE signal which terminates cdrecord and cdrskin with exit 213 | # status 141 214 | IFS_OLD="$IFS" 215 | IFS=$'\n' 216 | ( $cdrecord -v $grace $speed $blank -fs=8m -dev=$burner -data -dao "$iso" \ 217 | 2>&1 \ 218 | && echo "burnok" > "$respipe" \ 219 | || echo "burnfail" > "$respipe" ) | setstatus 220 | IFS="$IFS_OLD" 221 | exit 222 | fi 223 | 224 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/checksums.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # checksums.sh: This script creates checksums for files on a disc. 8 | 9 | 10 | setprogress() 11 | { 12 | (( percent = completed * 100 / deepsize )) 13 | (( completedm = completed / 1024 / 1024 )) 14 | spacefm -s set-task --window $fm_my_window $fm_my_task progress $percent 2>/dev/null & 15 | echo "set progress1 $percent % ( $completedm M / $deepsizem M )" > "$cmdpipe" & 16 | } 17 | 18 | if [ "$1" = "--verbose" ]; then 19 | verbose=1 20 | shift 21 | else 22 | verbose=0 23 | fi 24 | tree="$1" 25 | if [ ! -d "$tree" ]; then 26 | echo "checksums: invalid Burn Dir $tree" > "$viewpipe" 27 | echo "checksumsfail" > "$respipe" 28 | exit 1 29 | fi 30 | 31 | # get deep size 32 | deepsize="$(du -csL "$tree" 2>"$viewpipe")" 33 | if [ $? -ne 0 ]; then 34 | echo -e "\nchecksums: errors reading $tree" > "$viewpipe" 35 | echo "checksumsfail" > "$respipe" 36 | exit 1 37 | fi 38 | deepsize="$(echo "$deepsize" | tail -n 1)" 39 | deepsize="${deepsize%%[[:blank:]]*}" 40 | (( deepsize = deepsize * 1024 )) 41 | (( deepsizem = deepsize / 1024 / 1024 )) 42 | completed=0 43 | setprogress 44 | 45 | # read old sums 46 | if [ -e "$tree/.checksum.md5.gz" ]; then 47 | cat "$tree/.checksum.md5.gz" | gzip -d > "$tree/.checksum.md5-old.tmp" 48 | else 49 | rm -f "$tree/.checksum.md5-old.tmp" 50 | fi 51 | oldx=0 52 | unset md5_old md5_old_sum 53 | declare -a md5_old 54 | declare -a md5_old_sum 55 | IFS_OLD="$IFS" 56 | IFS=$'\n' 57 | for f in "$tree/.checksum.md5-old.tmp" "$tree/.checksum.md5.tmp"; do 58 | if [ -s "$f" ]; then 59 | for l in `cat "$f"`; do 60 | lsum="${l%% *}" 61 | lname="${l#* }" 62 | lname="${lname:1}" 63 | if [ "${#lsum}" -eq 32 ] && [ "$lname" != "" ]; then 64 | md5_old[$oldx]="$lname" 65 | md5_old_sum[$oldx]="$lsum" 66 | (( oldx++ )) 67 | fi 68 | done 69 | fi 70 | done 71 | rm -f "$tree/.checksum.md5.tmp" 72 | rm -f "$tree/.checksum.md5-old.tmp" 73 | 74 | # get and parse file list 75 | cd "$tree" 76 | denied=0 77 | prosize=0 78 | flist=`find -L -type f` 79 | if [ "$flist" != "" ]; then 80 | x=0 81 | for f in $flist; do 82 | f="${f#./}" 83 | fsize=`stat -Lc %s "$f"` 84 | if [ ! -r "$f" ]; then 85 | echo "checksums: Permission denied: $tree/$f" 86 | denied=1 87 | break 88 | fi 89 | if [ "$f" != ".checksum.md5.gz" ]; then 90 | # have old md5? 91 | have_it=0 92 | while [ "${md5_old[$x]}" != "" ]; do 93 | if [ "${md5_old[$x]}" = "$f" ]; then 94 | # reuse old md5 95 | if (( verbose )); then 96 | echo "reusing md5sum for $f" > "$viewpipe" 97 | fi 98 | echo "${md5_old_sum[$x]} *$f" >> "$tree/.checksum.md5.tmp" 99 | have_it=1 100 | break 101 | fi 102 | (( x++ )) 103 | done 104 | if (( have_it == 0 )); then 105 | # new md5 106 | if (( verbose )); then 107 | echo ">>> md5sum -b \"$f\"" > "$viewpipe" 108 | fi 109 | md5sum -b "$f" 2> "$viewpipe" >> "$tree/.checksum.md5.tmp" 110 | if [ $? -ne 0 ]; then 111 | echo "checksums: md5sum error" > "$viewpipe" 112 | echo "checksumsfail" > "$respipe" 113 | exit 1 114 | fi 115 | fi 116 | fi 117 | (( completed += fsize )) 118 | # don't setprogress too rapidly on small files 119 | (( prosize += fsize )) 120 | if (( prosize > 52428800 )); then 121 | prosize=0 122 | setprogress 123 | fi 124 | done 125 | fi 126 | IFS="$IFS_OLD" 127 | unset md5_old md5_old_sum 128 | unset flist 129 | rm -f "$tree/.checksum.md5.gz" 130 | if [ -e "$tree/.checksum.md5.tmp" ]; then 131 | cat "$tree/.checksum.md5.tmp" | gzip > "$tree/.checksum.md5.gz" 132 | fi 133 | rm -f "$tree/.checksum.md5.tmp" 134 | 135 | if (( denied == 1 )); then 136 | echo -e "\nchecksums: errors reading $tree" > "$viewpipe" 137 | echo "checksumsfail" > "$respipe" 138 | exit 1 139 | fi 140 | 141 | completed=$deepsize 142 | setprogress 143 | echo "checksumsok" > "$respipe" 144 | 145 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # config.sh: This script sets up the initial configuration and is sourced by 8 | # several scripts. Set preferred burning programs here. 9 | 10 | 11 | # cdrecord, cdrskin or wodim may be specified for default_cdrecord. mkisofs 12 | # or xorrisofs for default_mkisofs 13 | default_cdrecord=cdrecord 14 | default_mkisofs=mkisofs 15 | default_isoinfo=isoinfo 16 | 17 | version=0.5.1 18 | 19 | # initial defaults 20 | default_burner=/dev/sr0 21 | default_types="unknown\nCD-R\nCD+R\nCD-RW\nCD+RW\nDVD-R\nDVD+R\nDVD-RW\nDVD+RW\nDVD-R/DL\nDVD+R/DL\nBD-R\nBD-RE\nBD-R/DL\nBD-RE/DL" 22 | default_speeds="Max\n1x\n2x\n3x\n4x\n6x\n8x\n12x\n16x\n24x\n32x\n48x" 23 | # small temp dir 24 | default_tmpdir="$fm_tmp_dir" 25 | default_blocksize=2048 26 | 27 | # Maximum disc capacities in 2048 byte blocks 28 | cdlimit=359844 29 | dvdlimit=2295104 30 | duallimit=4173824 31 | bdrlimit=12219392 32 | bdrdllimit=24438784 33 | 34 | # establish and read config files 35 | mkdir -p "$fm_cmd_data/config" 36 | 37 | if [ -d "$default_tmpdir" ]; then 38 | tmpdir="$default_tmpdir" 39 | else 40 | tmpdir="/tmp" 41 | fi 42 | largetmpdirfile="$fm_cmd_data/config/largetmpdir" 43 | 44 | alarmcmdfile="$fm_cmd_data/config/alarmcmd" 45 | verbosefile="$fm_cmd_data/config/verbose" 46 | 47 | typelist="$fm_cmd_data/config/typelist" 48 | if [ ! -e "$typelist" ]; then 49 | echo -e "$default_types" > "$typelist" 50 | fi 51 | speedlist="$fm_cmd_data/config/speedlist" 52 | if [ ! -s "$speedlist" ]; then 53 | echo -e "$default_speeds" > "$speedlist" 54 | fi 55 | 56 | burnerfile="$fm_cmd_data/config/burner" 57 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 58 | if [ "$burner" = "" ]; then 59 | burner="$default_burner" 60 | echo "$burner" > "$burnerfile" 61 | fi 62 | 63 | choosersizefile="$fm_cmd_data/config/choosersize" 64 | if [ ! -e "$choosersizefile" ]; then 65 | echo "800x600" > "$choosersizefile" 66 | fi 67 | export choosersizefile 68 | 69 | blocksize=$default_blocksize 70 | if (( blocksize == 0 )); then 71 | blocksize=2048 72 | fi 73 | 74 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import # import file manager variables (scroll down for info) 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # configure.sh: This script shows the Configuration dialog (Configure button). 8 | 9 | 10 | source "$fm_cmd_dir/config.sh" 11 | 12 | winsizefile="$fm_cmd_data/config/winsize-configure" 13 | if [ ! -e "$winsizefile" ]; then 14 | echo "500x500" > "$winsizefile" 15 | fi 16 | 17 | largetmpdir="`head -n 1 "$largetmpdirfile" 2>/dev/null`" 18 | alarm_cmd="`head -n 1 "$alarmcmdfile" 2>/dev/null`" 19 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 20 | 21 | i=0 22 | unset devs 23 | for d in /dev/*; do 24 | if [ "${d:0:8}" != "/dev/vcs" ] \ 25 | && [ "${d:0:8}" != "/dev/tty" ] \ 26 | && [ "${d:0:8}" != "/dev/ram" ] \ 27 | && [ "${d:0:9}" != "/dev/loop" ] \ 28 | && [ "${d:0:11}" != "/dev/hidraw" ]; then 29 | devs[i]="$d" 30 | (( i++ )) 31 | fi 32 | done 33 | 34 | i=1 35 | unset scripts 36 | scripts[0]="Select a file to edit..." 37 | cd "$fm_cmd_dir" 38 | lsout="`/bin/ls -1`" 39 | IFS_OLD="$IFS" 40 | IFS=$'\n' 41 | for f in $lsout; do 42 | scripts[i]="$f" 43 | (( i++ )) 44 | done 45 | IFS="$IFS_OLD" 46 | 47 | verbose_init="$(head -n 1 "$verbosefile" 2>/dev/null)" 48 | 49 | # make a pipe to send commands to the dialog 50 | if [ -d "$smalltmp" ]; then 51 | cnfpipe="$smalltmp/burndisc-cnfpipe-$RANDOM" 52 | elif [ -d "$default_tmpdir" ]; then 53 | cnfpipe="$default_tmpdir/burndisc-cnfpipe-$RANDOM" 54 | else 55 | cnfpipe="/tmp/burndisc-cnfpipe-$RANDOM" 56 | fi 57 | rm -f "$cnfpipe" 58 | mkfifo "$cnfpipe" 59 | 60 | choose='eval "$(spacefm -g --chooser --dir "%input1" --button cancel --button ok)"; if [ "$dialog_pressed" = button2 ] && [ "$dialog_chooser1" != "" ]; then echo "set input1 $dialog_chooser1" > "CNFPIPE"; fi' 61 | choose="${choose/CNFPIPE/$cnfpipe}" 62 | 63 | while (( 1 )); do 64 | eval "`spacefm -g --title "Configure Burn Disc v$version" --window-size "@$winsizefile" \ 65 | --hbox --compact \ 66 | --label "Burner:" \ 67 | --combo --expand "${devs[@]}" -- "@$burnerfile" \ 68 | --close-box \ 69 | --hbox --compact \ 70 | --label "Large Temp Dir:" \ 71 | --input "$largetmpdir" \ 72 | --free-button :gtk-open bash -c "$choose" \ 73 | --close-box \ 74 | --hbox --compact \ 75 | --label "Notify Command:" \ 76 | --input "$alarm_cmd" \ 77 | --close-box \ 78 | --check "_Verbose Output" "@$verbosefile" \ 79 | --hbox \ 80 | --vbox \ 81 | --label "Types:" \ 82 | --editor "$typelist" "$typelist-tmp" \ 83 | --close-box \ 84 | --vbox \ 85 | --label "Speeds:" \ 86 | --editor "$speedlist" "$speedlist-tmp" \ 87 | --close-box \ 88 | --close-box \ 89 | --drop "${scripts[@]}" -- +0 \ 90 | bash -c "$fm_import; if [ -e '$fm_cmd_dir/%drop1' ]; then \ 91 | fm_edit '$fm_cmd_dir/%drop1'; fi" \ 92 | -- select drop1 "Select a file to edit..." \ 93 | --button cancel --button save \ 94 | --command "$cnfpipe" disable button1 $fm_editor_terminal`" 95 | if [ "$dialog_pressed" != "button2" ]; then 96 | rm -f "$typelist-tmp" "$speedlist-tmp" 97 | rm -f "$cnfpipe" 98 | exit 99 | fi 100 | largetmpdir="$dialog_input1" 101 | if [ "$largetmpdir" = "" ] || [ -d "$largetmpdir" ]; then 102 | break 103 | fi 104 | spacefm -g --label "\nInvalid temporary directory $largetmpdir\n\n(Leave blank for default)" \ 105 | --button ok 106 | done 107 | 108 | reconfigure=0 109 | if ! cmp "$typelist-tmp" "$typelist"; then 110 | cp -f "$typelist-tmp" "$typelist" 111 | reconfigure=1 112 | fi 113 | if ! cmp "$speedlist-tmp" "$speedlist"; then 114 | cp -f "$speedlist-tmp" "$speedlist" 115 | reconfigure=1 116 | fi 117 | if [ "$dialog_combo1" != "$burner" ]; then 118 | echo "$dialog_combo1" > "$burnerfile" 119 | reconfigure=1 120 | fi 121 | echo "$largetmpdir" > "$largetmpdirfile" 122 | echo "$dialog_input2" > "$alarmcmdfile" 123 | rm -f "$typelist-tmp" "$speedlist-tmp" 124 | rm -f "$cnfpipe" 125 | if (( reconfigure == 1 )) && [ -p "$respipe" ]; then 126 | echo configure > "$respipe" 127 | fi 128 | if [ "$verbose_init" != "$dialog_check1" ] && \ 129 | [ -p "$respipe" ]; then 130 | echo verbose > "$respipe" 131 | fi 132 | exit 133 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/depends.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 4 | # License: GPL2+ ( See README ) 5 | # 6 | # depends.sh: This source script tests dependencies and exits with status 1 7 | # if unsatisfied. It also discovers what burn and other 8 | # programs are available for use. 9 | 10 | 11 | # TIP: Set your preferred program defaults in config.sh, not here 12 | 13 | if [ "$default_cdrecord" = "" ]; then 14 | default_cdrecord=cdrecord 15 | fi 16 | if [ "$default_mkisofs" = "" ]; then 17 | default_mkisofs=mkisofs 18 | fi 19 | if [ "$default_isoinfo" = "" ]; then 20 | default_isoinfo=isoinfo 21 | fi 22 | cdrecord=`which $default_cdrecord 2>/dev/null` 23 | mkisofs=`which $default_mkisofs 2>/dev/null` 24 | isoinfo=`which $default_isoinfo 2>/dev/null` 25 | # if cdrecord not in PATH look in /opt/schily/bin 26 | if [ "$cdrecord" = "" ] && [ "$default_cdrecord" = "cdrecord" ] && \ 27 | [ -x /opt/schily/bin/cdrecord ]; then 28 | cdrecord=/opt/schily/bin/cdrecord 29 | mkisofs=/opt/schily/bin/mkisofs 30 | fi 31 | if [ -h "$cdrecord" ]; then 32 | realcdrecord=`readlink "$cdrecord"` 33 | else 34 | realcdrecord="$cdrecord" 35 | fi 36 | if [ -h "$cdrecord" ] && [ "$realcdrecord" != "${realcdrecord%wodim}" ] && \ 37 | [ -x /opt/schily/bin/cdrecord ]; then 38 | # avoid link cdrecord -> wodim if /opt/schily version present 39 | cdrecord=/opt/schily/bin/cdrecord 40 | mkisofs=/opt/schily/bin/mkisofs 41 | else 42 | if [ "$cdrecord" = "" ]; then 43 | cdrecord=`which cdrskin 2>/dev/null` 44 | fi 45 | if [ "$cdrecord" = "" ]; then 46 | cdrecord=`which wodim 2>/dev/null` 47 | fi 48 | fi 49 | if [ "$mkisofs" = "" ]; then 50 | mkisofs=`which xorrisofs 2>/dev/null` 51 | fi 52 | if [ "$mkisofs" = "" ]; then 53 | mkisofs=`which genisoimage 2>/dev/null` 54 | fi 55 | udevil=`which udevil 2>/dev/null` 56 | eject=`which eject 2>/dev/null` 57 | unset msg 58 | if [ "$cdrecord" = "" ]; then 59 | msg=" cdrecord (cdrtools) OR cdrskin OR wodim (cdrkit)"$'\n' 60 | fi 61 | if [ "$mkisofs" = "" ]; then 62 | msg="$msg mkisofs (cdrtools) OR xorrisofs (xorriso) OR genisoimage (cdrkit)"$'\n' 63 | fi 64 | if [ "$udevil" = "" ]; then 65 | msg="$msg udevil"$'\n' 66 | fi 67 | if [ "$eject" = "" ]; then 68 | msg="$msg eject"$'\n' 69 | fi 70 | if ! spacefm --version 1>/dev/null 2>/dev/null; then 71 | msg="$msg spacefm >= 0.8.3"$'\n' 72 | fi 73 | if [ "$msg" != "" ]; then 74 | echo "This plugin requires the following missing dependencies:" 75 | echo "$msg" 76 | exit 1 77 | fi 78 | 79 | export mkisofs 80 | export cdrecord 81 | 82 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # exec.sh: This script shows the Burn Disc dialog and conducts the burn. 8 | 9 | 10 | # Are we running from spacefm ? 11 | if [ "$fm_import" = "" ] || [ "$fm_my_window" = "" ] || [ "$fm_my_task" = "" ]; then 12 | echo "This script is designed to be run as a SpaceFM custom command script" 13 | exit 1 14 | fi 15 | 16 | # setup and read config 17 | source "$fm_cmd_dir/config.sh" 18 | 19 | # check dependencies - may exit 20 | source "$fm_cmd_dir/depends.sh" 21 | 22 | # include burn functions 23 | source "$fm_cmd_dir/burn.sh" 24 | 25 | # make temp dir 26 | smalltmp="`mktemp -d --tmpdir="$tmpdir" "burndisc-$(whoami)-XXXXXXXX.tmp"`" 27 | if [ $? -ne 0 ] || [ ! -d "$smalltmp" ]; then 28 | echo 29 | echo "Unable to create temp dir in $tmpdir" 30 | exit 1 31 | fi 32 | chmod go-rwx "$smalltmp" 33 | export smalltmp 34 | 35 | # config and temp files 36 | media_last_type=X 37 | copydiscfile="$fm_cmd_data/config/copydisc" 38 | verifyfile="$fm_cmd_data/config/verify" 39 | monsrc="$smalltmp/burndisc-monsrc" 40 | tmplogfile="$smalltmp/burndisc-logfile.tmp" 41 | export tmplogfile 42 | checksumsfile="$fm_cmd_data/config/checksums" 43 | checksums_init="`head -n 1 "$checksumsfile" 2>/dev/null`" 44 | if [ "$checksums_init" = "" ]; then 45 | checksums_init=1 46 | fi 47 | imagepathfile="$fm_cmd_data/config/imagepath" 48 | tmpiso_path="" 49 | snapshotpathfile="$fm_cmd_data/config/snapshotpath" 50 | saveimagepathfile="$fm_cmd_data/config/saveimagepath" 51 | verbose="`head -n 1 "$verbosefile" 2>/dev/null`" 52 | winsizefile="$fm_cmd_data/config/winsize" 53 | if [ ! -e "$winsizefile" ]; then 54 | echo "800x600" > "$winsizefile" 55 | fi 56 | 57 | # pipes 58 | # make a pipe to show output 59 | viewpipe="$smalltmp/burndisc-viewpipe" 60 | rm -f "$viewpipe" 61 | mkfifo "$viewpipe" 62 | export viewpipe 63 | 64 | # make a pipe to send commands to the dialog 65 | cmdpipe="$smalltmp/burndisc-cmdpipe" 66 | rm -f "$cmdpipe" 67 | mkfifo "$cmdpipe" 68 | export cmdpipe 69 | 70 | # make a pipe to receive responses 71 | respipe="$smalltmp/burndisc-respipe" 72 | rm -f "$respipe" 73 | mkfifo "$respipe" 74 | export respipe 75 | 76 | getsrc() 77 | { 78 | if [ ! -e "$cmdpipe" ]; then 79 | return 1 80 | fi 81 | rm -f "$monsrc" 82 | echo "source $monsrc" > "$cmdpipe" 83 | sleep .05 84 | x=0 85 | while (( x < 6 )) && [ ! -e "$monsrc" ]; do 86 | sleep .1 87 | (( x++ )) 88 | done 89 | if [ ! -e "$monsrc" ]; then 90 | return 91 | fi 92 | source "$monsrc" 93 | rm -f "$monsrc" 94 | if [ "$dialog_input1" = "/" ]; then 95 | burn_path="" 96 | else 97 | burn_path="$dialog_input1" 98 | fi 99 | burn_job="$dialog_drop1_index" 100 | burn_type="$dialog_combo1" 101 | burn_speed="$dialog_combo2" 102 | burn_label="$dialog_input2" 103 | burn_checksums="$dialog_check1" 104 | burn_snapshot="$dialog_check2" 105 | burn_saveimage="$dialog_check3" 106 | burn_verify="$dialog_drop2" 107 | burn_progress="$dialog_progress1" 108 | } 109 | 110 | getdisc() 111 | { 112 | burner="`head -n 1 "$burnerfile"`" 113 | info="`ps -Af | grep -v grep | grep "/burn.sh .* --burniso $burner"`" 114 | if [ ! -b "$burner" ] || [ "$info" != "" ]; then 115 | media_type="" 116 | media_status="" 117 | media_free=0 118 | media_mfree=0 119 | blocksize=$default_blocksize 120 | if (( blocksize == 0 )); then 121 | blocksize=2048 122 | fi 123 | if [ ! -b "$burner" ]; then 124 | echo -e "\n*** Please configure a valid burner drive\n" > "$viewpipe" 125 | else 126 | echo "*** Drive $burner in use?" > "$viewpipe" 127 | fi 128 | else 129 | echo -e "--- Reading changed disc in $burner..." > "$viewpipe" 130 | 131 | # udevil info 132 | if (( verbose )); then 133 | echo ">>> udevil info \"$1\"" > "$viewpipe" 134 | fi 135 | info="`udevil info "$1" 2> "$viewpipe"`" 136 | blocksize="`echo "$info" | grep -m 1 "^ block size:" | sed 's/.*: *\(.*\)/\1/'`" 137 | if (( blocksize == 0 )); then 138 | blocksize=$default_blocksize 139 | else 140 | if (( blocksize != default_blocksize )); then 141 | echo " *** unusual block size $blocksize" > "$viewpipe" 142 | fi 143 | fi 144 | if (( blocksize == 0 )); then 145 | blocksize=2048 146 | fi 147 | if (( verbose )); then 148 | echo "blocksize=$blocksize" > "$viewpipe" 149 | fi 150 | media_label="`echo "$info" | grep -m 1 "^ label:" | sed 's/.*: *\(.*\)/\1/'`" 151 | # trim trailing spaces 152 | len="${#media_label}" 153 | (( len-- )) 154 | while [[ $"${media_label:len:1}" = " " ]]; do 155 | media_label="${media_label:0:len}" 156 | len=${#media_label} 157 | (( len-- )) 158 | done 159 | 160 | # cdrecord info 161 | if (( verbose )); then 162 | echo ">>> $cdrecord dev=\"$1\" -media-info 2> /dev/null" > "$viewpipe" 163 | fi 164 | info="`$cdrecord dev="$1" -media-info 2> /dev/null`" 165 | if (( verbose )); then 166 | echo "$info" > "$viewpipe" 167 | fi 168 | media_type="`echo "$info" | grep -m 1 "^Mounted media type:" | sed 's/Mounted media type: *\([A-Za-z\+\/-]*\) *.*/\1/'`" 169 | media_status="`echo "$info" | grep -m 1 "^disk status:" | sed 's/disk status: *\(.*\)/\1/'`" 170 | media_free="`echo "$info" | grep -m 1 "^Remaining writable size:" | sed 's/Remaining writable size: *\(.*\)/\1/'`" 171 | if [ "$media_status" = "" ]; then 172 | echo -n " *** no disc?" > "$viewpipe" 173 | else 174 | echo -n " $media_status" > "$viewpipe" 175 | if [ "$media_status" != "empty" ] && [ "$media_type" != "" ]; then 176 | # show size of disc if it were blank 177 | getmediafree "$media_type" 178 | blocksize=2048 179 | elif [ "$media_status" = "empty" ] && [ "$media_free" = "" ]; then 180 | # No "Remaining writable size" so try to get free sectors 181 | media_free="`echo "$info" | grep -m 1 " *1 *1 *Blank *0 *[0-9]* " | sed 's/ *1 *1 *Blank *0 *\([0-9]*\) .*/\1/'`" 182 | fi 183 | fi 184 | if [ "$media_type" != "${media_type#BD}" ] && \ 185 | [ "$media_type" = "${media_type%DL}" ] && \ 186 | (( media_free > bdrlimit + 100000 )); then 187 | # help detection of DL 188 | media_type="$media_type/DL" 189 | fi 190 | if [ "$media_type" = "" ]; then 191 | if [ "$media_status" != "" ]; then 192 | echo -n " - no disc?" > "$viewpipe" 193 | fi 194 | else 195 | echo -n " $media_type" > "$viewpipe" 196 | fi 197 | (( media_free = media_free * blocksize )) 198 | (( media_mfree = media_free / 1024 / 1024 )) 199 | if [ "$media_status" = "" ] && (( media_free == 0 )); then 200 | echo > "$viewpipe" 201 | else 202 | echo " ( $media_mfree M free )" > "$viewpipe" 203 | fi 204 | fi 205 | if [ "$media_type" != "$media_last_type" ]; then 206 | if [ "$media_type" = "" ]; then 207 | echo "set combo1 unknown" > "$cmdpipe" 208 | else 209 | echo "set combo1 $media_type" > "$cmdpipe" 210 | fi 211 | media_last_type="$media_type" 212 | fi 213 | getdisc_time=`date +%s` 214 | } 215 | 216 | settask() 217 | { 218 | spacefm -s set-task --window $fm_my_window $fm_my_task $1 "$2" 219 | } 220 | 221 | showmsg() # $1 = msg $2 = title $3 = icon 222 | { 223 | if [ "$2" != "" ]; then 224 | title="$2" 225 | else 226 | title="Burn Disc" 227 | fi 228 | if [ "$3" != "" ]; then 229 | icon="$3" 230 | else 231 | icon="error" 232 | fi 233 | spacefm -g --title "$title" --window-icon $icon \ 234 | --label "\n$1" --button ok 2> /dev/null > /dev/null & 235 | } 236 | 237 | killgroup() 238 | { 239 | pid="$1" 240 | if (( pid == 0 )); then 241 | return; 242 | fi 243 | if (( verbose )); then 244 | echo ">>> pkill -P $pid" > "$viewpipe" 245 | pkill -P $pid 2>&1 > "$viewpipe" 246 | echo ">>> kill $pid" > "$viewpipe" 247 | kill $pid 2>&1 > "$viewpipe" 248 | else 249 | pkill -P $pid 2>/dev/null 250 | kill $pid 2>/dev/null 251 | fi 252 | } 253 | 254 | getmediafree() 255 | { 256 | case "$1" in 257 | CD-R | CD+R | CD-RW | CD+RW ) 258 | media_free=$cdlimit 259 | ;; 260 | DVD-R | DVD+R | DVD-RW | DVD+RW ) 261 | media_free=$dvdlimit 262 | ;; 263 | DVD-R/DL | DVD+R/DL ) 264 | media_free=$duallimit 265 | ;; 266 | BD-R | BD-RE ) 267 | media_free=$bdrlimit 268 | ;; 269 | BD-R/DL | BD-RE/DL ) 270 | media_free=$bdrdllimit 271 | ;; 272 | * ) 273 | media_free=0 274 | ;; 275 | esac 276 | } 277 | 278 | dispsize() 279 | { 280 | if [ "$media_type" = "" ]; then 281 | getmediafree "$burn_type" 282 | (( media_free = media_free * 2048 )) 283 | (( media_mfree = media_free / 1024 / 1024 )) 284 | fi 285 | if (( media_free )); then 286 | (( percent = bytes * 100 / media_free )) 287 | else 288 | percent=100 289 | fi 290 | (( mbytes = bytes / 1024 / 1024 )) 291 | dispsize="$mbytes M" 292 | msg="$percent % ( $dispsize / $media_mfree M )" 293 | if [ "$msg_last" != "$msg" ]; then 294 | if [ "$media_type" = "" ]; then 295 | type="$burn_type" 296 | else 297 | type="disc" 298 | fi 299 | if (( bytes > media_free )); then 300 | (( exceed = ( bytes - media_free ) / 1024 / 1024 )) 301 | msg2="exceeds $type by $exceed M" 302 | remain="-$exceed M" 303 | else 304 | (( exceed = ( media_free - bytes ) / 1024 / 1024 )) 305 | msg2="$exceed M remaining on $type" 306 | remain="$exceed M" 307 | fi 308 | if (( burn_job == 0 )) && [ "$showsize_first" = "" ]; then 309 | echo -e "\nIn SpaceFM, add content to the Burn Dir using Copy and Edit|Paste Link, or drag and drop while holding Ctrl+Shift.\n" > "$viewpipe" 310 | showsize_first=x 311 | fi 312 | echo "set progress1 $msg" > "$cmdpipe" 313 | echo "$msg $msg2" > "$viewpipe" 314 | settask total "$dispsize / $media_mfree M" 315 | settask progress "$percent" 316 | settask curremain "$remain" 317 | settask avgremain "$remain" 318 | settask curspeed 319 | settask avgspeed 320 | msg_last="$msg" 321 | fi 322 | } 323 | 324 | showcopysize() 325 | { 326 | if [ "$burn_path" != "$burn_last_path" ]; then 327 | burn_last_path="$burn_path" 328 | msg_last="" 329 | settask from "$burn_path" 330 | if [ -b "$burn_path" ]; then 331 | echo "--- Copy Disc source changed to $burn_path" > "$viewpipe" 332 | image_bytes=`udevil info "$burn_path" | grep -m 1 "^ size:" | sed 's/.*: *\(.*\)/\1/'` 333 | settask item "Copy Disc $burn_path" 334 | echo "$burn_path" > "$copydiscfile" 335 | else 336 | image_bytes=0 337 | echo "*** Invalid Copy Disc $burn_path" > "$viewpipe" 338 | settask item "(invalid - $burn_path)" 339 | fi 340 | fi 341 | (( bytes = image_bytes )) 342 | if [ "$burn_path" != "$burner" ]; then 343 | dispsize 344 | else 345 | (( mbytes = bytes / 1024 / 1024 )) 346 | dispsize="$mbytes M" 347 | msg="Copy Disc: $dispsize" 348 | if [ "$msg_last" != "$msg" ]; then 349 | echo "set progress1 100" > "$cmdpipe" 350 | echo "set progress1 $msg" > "$cmdpipe" 351 | echo "$msg" > "$viewpipe" 352 | settask total "$dispsize" 353 | settask progress 100 354 | settask curremain "" 355 | settask avgremain "" 356 | msg_last="$msg" 357 | fi 358 | fi 359 | } 360 | 361 | showimagesize() 362 | { 363 | if [ "$burn_path" != "$burn_last_path" ]; then 364 | burn_last_path="$burn_path" 365 | msg_last="" 366 | settask from 367 | if [ -f "$burn_path" ]; then 368 | echo "--- Burn Image changed to $burn_path" > "$viewpipe" 369 | image_bytes=`stat -c %s "$burn_path"` 370 | settask item "Burn Image $burn_path" 371 | echo "$(dirname "$burn_path")" > "$imagepathfile" 372 | if [ "$isoinfo" = "" ]; then 373 | echo -e "\n*** Please install isoinfo for more detailed info\n" > "$viewpipe" 374 | else 375 | msg=`$isoinfo -d -i "$burn_path" 2>&1` 376 | err=$? 377 | if (( verbose )) || [ $err -ne 0 ]; then 378 | echo "================================================" > "$viewpipe" 379 | echo "$msg" > "$viewpipe" 380 | if [ $err -ne 0 ]; then 381 | echo -e "\n*** WARNING invalid image contents ?" > "$viewpipe" 382 | fi 383 | echo "================================================" > "$viewpipe" 384 | fi 385 | fi 386 | else 387 | image_bytes=0 388 | echo "*** Invalid Burn Image $burn_path" > "$viewpipe" 389 | settask item "(invalid - $burn_path)" 390 | fi 391 | fi 392 | (( bytes = image_bytes )) 393 | dispsize 394 | } 395 | 396 | showdirsize() 397 | { 398 | if [ -d "$burn_path" ]; then 399 | bytes=`du -sbL "$burn_path" 2>/dev/null` 400 | if [ $? -ne 0 ]; then 401 | msg=`du -sbL "$burn_path" 2>&1 | grep ":"` 402 | if [ "$msg" != "$du_msg_last" ] || \ 403 | [ "$burn_path" != "$burn_last_path" ]; then 404 | du_msg_last="$msg" 405 | else 406 | msg="" 407 | fi 408 | else 409 | msg="" 410 | fi 411 | bytes="${bytes%%[[:blank:]]*}" 412 | (( mbytes = bytes / 1024 / 1024 )) 413 | if [ "$burn_path" != "$burn_last_path" ]; then 414 | echo "--- Burn Dir changed to $burn_path" > "$viewpipe" 415 | settask from "$burn_path" 416 | settask item "Burn Dir - Adding Content" 417 | burn_last_path="$burn_path" 418 | msg_last="" 419 | fi 420 | if [ "$msg" != "" ]; then 421 | echo "$msg" > "$viewpipe" 422 | fi 423 | else 424 | bytes=0 425 | if [ "$burn_path" != "$burn_last_path" ]; then 426 | echo -e "*** Invalid Burn Dir $burn_path" > "$viewpipe" 427 | settask from "(invalid - $burn_path)" 428 | settask item "Burn Dir - invalid" 429 | burn_last_path="$burn_path" 430 | msg_last="" 431 | fi 432 | fi 433 | dispsize 434 | } 435 | 436 | savespeed() 437 | { 438 | # save selected speed of burn type 439 | if [ "$1" = "" ]; then 440 | return; 441 | fi 442 | safetype="$1" 443 | safetype="${safetype//\//-}" 444 | speedfile="$fm_cmd_data/config/speed-$safetype" 445 | if [ "$burn_speed" = "" ] || [ "$burn_speed" = "Max" ]; then 446 | rm -f "$speedfile" 447 | else 448 | echo "$burn_speed" > "$speedfile" 449 | fi 450 | } 451 | 452 | setspeed() 453 | { 454 | # restore selected speed of burn type 455 | safetype="$burn_type" 456 | safetype="${safetype//\//-}" 457 | speedfile="$fm_cmd_data/config/speed-$safetype" 458 | speed="$(head -n 1 "$speedfile" 2> /dev/null)" 459 | if [ "$speed" = "" ]; then 460 | speed="Max" 461 | fi 462 | if [ "$burn_speed" != "$speed" ]; then 463 | echo "set combo2 $speed" > "$cmdpipe" 464 | echo "--- Speed changed to $speed" > "$viewpipe" 465 | fi 466 | } 467 | 468 | runalarm() 469 | { 470 | alarm_cmd="`head -n 1 "$alarmcmdfile" 2>/dev/null`" 471 | if [ "$alarm_cmd" != "" ]; then 472 | if (( verbose )); then 473 | echo ">>> $alarm_cmd &" > "$viewpipe" 474 | fi 475 | eval $alarm_cmd & 476 | fi 477 | } 478 | 479 | setstate() 480 | { 481 | if [ "$1" != "" ]; then 482 | state="$1" 483 | fi 484 | if [ $state = BUILD ]; then 485 | en_save=1 486 | if [ $burn_job -eq 0 ]; then 487 | en_dir=1 488 | burn_last_path= 489 | else 490 | en_dir=0 491 | if [ $burn_job -eq 1 ]; then 492 | en_save=0 493 | else 494 | burn_last_path= 495 | fi 496 | fi 497 | msg_last= 498 | echo "enable vbox1 1" > "$cmdpipe" 499 | echo "enable button2 1" > "$cmdpipe" 500 | echo "enable button5 1" > "$cmdpipe" 501 | echo "enable label3 $en_dir" > "$cmdpipe" 502 | echo "enable input2 $en_dir" > "$cmdpipe" 503 | echo "enable check1 $en_dir" > "$cmdpipe" 504 | echo "enable check3 $en_save" > "$cmdpipe" 505 | spacefm -s remove-event evt_pnl_sel "$selhandler" 2>/dev/null 506 | spacefm -s replace-event evt_pnl_sel "$selhandler" 507 | spacefm -s set --window $fm_my_window statusbar_text \ 508 | "Select files/folders/links to show their deep size" 509 | else 510 | echo "enable vbox1 0" > "$cmdpipe" 511 | echo "enable button2 0" > "$cmdpipe" 512 | echo "enable button5 0" > "$cmdpipe" 513 | spacefm -s remove-event evt_pnl_sel "$selhandler" 2>/dev/null 514 | ( for p in {1..4}; do for t in {1..20}; do spacefm -s set --window \ 515 | "$fm_my_window" --panel $p --tab $t statusbar_text 2>/dev/null; \ 516 | done; done ) & 517 | fi 518 | } 519 | 520 | burnready() 521 | { 522 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 523 | if [ ! -b "$burner" ]; then 524 | echo "*** Invalid burner drive $burner - please configure a valid burner" > "$viewpipe" 525 | return 1 526 | fi 527 | info="`ps -Af | grep -v grep | grep "/burn.sh .* --burniso $burner"`" 528 | if [ "$info" != "" ]; then 529 | echo "*** Burner drive $burner appears to be in use (burn.sh is running)" > "$viewpipe" 530 | return 1 531 | fi 532 | 533 | unmountburner 534 | echo -e "\n--- Estimating filesystem size..." > "$viewpipe" 535 | echo "set progress1 0" > "$cmdpipe" & 536 | settask item "Preparing to burn" 537 | settask total 538 | settask progress 0 539 | settask progress "" 540 | settask curremain 541 | settask avgremain 542 | settask curspeed 543 | settask avgspeed 544 | if (( burn_job == 0 )); then 545 | # Burn Dir 546 | echo "$burn_verify" > "$verifyfile" 547 | echo "$burn_checksums" > "$checksumsfile" 548 | if [ ! -d "$burn_path" ]; then 549 | echo "*** Invalid Burn Dir" > "$viewpipe" 550 | return 1 551 | fi 552 | estimate="$(printsize "$burn_path")" 553 | if [ $? -ne 0 ]; then 554 | echo "*** Error running $mkisofs for filesystem size" > "$viewpipe" 555 | return 1 556 | fi 557 | (( estimate = estimate * 2048 )) 558 | create_iso_est=$estimate 559 | elif (( burn_job == 1 )); then 560 | # Burn Image 561 | if [ ! -s "$burn_path" ]; then 562 | echo "*** Invalid Burn Image" > "$viewpipe" 563 | return 1 564 | fi 565 | estimate=`stat -c %s "$burn_path"` 566 | else # (( burn_job == 2 )) 567 | # Copy Disc 568 | if [ ! -b "$burn_path" ]; then 569 | echo "*** Invalid Copy Disc source - $burn_path is not a block device" > "$viewpipe" 570 | return 1 571 | fi 572 | info="`udevil info "$burn_path"`" 573 | estimate="`echo "$info" | grep -m 1 "^ size:" | sed 's/.*: *\(.*\)/\1/'`" 574 | create_iso_est=$estimate 575 | has_media="`echo "$info" | grep "^ has media:" | sed 's/.*: *\(.*\)/\1/'`" 576 | is_blank="`echo "$info" | grep "^ blank:" | sed 's/.*: *\(.*\)/\1/'`" 577 | if (( estimate * has_media == 0 )) || (( is_blank == 1 )); then 578 | eval "`spacefm -g --window-icon gtk-dialog-warning --title "Invalid Copy Disc Media" \ 579 | --label "\nThe Copy Disc source $burn_path does not seem to contain valid non-empty media to read. Do you want to attempt to copy this disc anyway?" \ 580 | --button Continue:gtk-yes \ 581 | --button cancel`" 582 | if [ "$dialog_pressed" != "button1" ]; then 583 | echo "*** Burn cancelled" > "$viewpipe" 584 | return 1 585 | fi 586 | fi 587 | fi 588 | echo -e "--- Checking media..." > "$viewpipe" 589 | if (( burn_job == 2 )); then 590 | return 0 591 | fi 592 | info="`udevil info "$burner" 2> "$viewpipe"`" 593 | blocksize="`echo "$info" | grep -m 1 "^ block size:" | sed 's/.*: *\(.*\)/\1/'`" 594 | if (( blocksize == 0 )); then 595 | blocksize=$default_blocksize 596 | fi 597 | if (( blocksize == 0 )); then 598 | blocksize=2048 599 | fi 600 | info="`$cdrecord dev="$burner" -media-info 2> /dev/null`" 601 | err=$? 602 | media_type_est="`echo "$info" | grep -m 1 "^Mounted media type:" | sed 's/Mounted media type: *\([A-Za-z\+\/-]*\) *.*/\1/'`" 603 | media_status_est="`echo "$info" | grep -m 1 "^disk status:" | sed 's/disk status: *\(.*\)/\1/'`" 604 | media_free_est="`echo "$info" | grep -m 1 "^Remaining writable size:" | sed 's/Remaining writable size: *\(.*\)/\1/'`" 605 | if [ "$media_status_est" = "empty" ] && [ "$media_free_est" = "" ]; then 606 | # No "Remaining writable size" so try to get free sectors 607 | media_free_est="`echo "$info" | grep -m 1 " *1 *1 *Blank *0 *[0-9]* " | sed 's/ *1 *1 *Blank *0 *\([0-9]*\) .*/\1/'`" 608 | fi 609 | if [ "$media_type_est" != "${media_type_est#BD}" ] && \ 610 | [ "$media_type_est" = "${media_type_est%DL}" ] && \ 611 | (( media_free_est > bdrlimit + 100000 )); then 612 | # help detection of DL 613 | media_type_est="$media_type_est/DL" 614 | fi 615 | (( media_free_est = media_free_est * blocksize )) 616 | if [ $err -ne 0 ] || [ "$media_status_est" = "" ]; then 617 | # no media info 618 | eval "`spacefm -g --window-icon gtk-dialog-warning --title "Media Info Error" \ 619 | --label "\nUnable to get info about the media in $burner using $cdrecord. Do you want to attempt this burn anyway?" \ 620 | --button Continue:gtk-yes \ 621 | --button cancel`" 622 | if [ "$dialog_pressed" != "button1" ]; then 623 | echo "*** Burn cancelled" > "$viewpipe" 624 | return 1 625 | fi 626 | else 627 | if [ "$media_status_est" != "empty" ]; then 628 | # media not blank 629 | if [ "$media_type_est" = "${media_type_est/RW/}" ] && \ 630 | [ "$media_type_est" == "${media_type_est/RE/}" ]; then 631 | msg=", and the media doesn't look rewritable" 632 | else 633 | msg="" 634 | fi 635 | eval "`spacefm -g --window-icon gtk-dialog-warning --title "Media Not Blank" \ 636 | --window-size 600 \ 637 | --label "~\nThe $media_type_est media in $burner is not blank$msg.\n\nThis plugin does not burn multisession discs.\n\nDo you want to attempt to overwrite this disc?" \ 638 | --button Over_write:gtk-yes \ 639 | --button cancel`" 640 | if [ "$dialog_pressed" != "button1" ]; then 641 | echo "*** Burn cancelled" > "$viewpipe" 642 | return 1 643 | fi 644 | # normal size 645 | case "$media_type_est" in 646 | CD-R | CD+R | CD-RW | CD+RW ) 647 | media_free_est=$cdlimit 648 | ;; 649 | DVD-R | DVD+R | DVD-RW | DVD+RW ) 650 | media_free_est=$dvdlimit 651 | ;; 652 | DVD-R/DL | DVD+R/DL ) 653 | media_free_est=$duallimit 654 | ;; 655 | BD-R | BD-RE ) 656 | media_free_est=$bdrlimit 657 | ;; 658 | BD-R/DL | BD-RE/DL ) 659 | media_free_est=$bdrdllimit 660 | ;; 661 | * ) 662 | media_free_est=-1 663 | ;; 664 | esac 665 | (( media_free_est = media_free_est * 2048 )) 666 | fi 667 | if (( media_free_est < estimate )) && (( media_free_est != -1 )); then 668 | if (( burn_job == 0 )); then 669 | 670 | (( diff = ( estimate - media_free_est ) / 1024 / 1024 + 1 )) 671 | msg="With filesystem overhead included, you need to remove approximately $diff M from the Burn Dir.\n\nOr to attempt this burn as is, click Continue." 672 | else 673 | msg="Do you want to attempt this burn anyway?" 674 | fi 675 | eval "`spacefm -g --window-icon gtk-dialog-warning --title "Insufficient Space" \ 676 | --window-size 600 \ 677 | --label "~\nThe $media_type_est media in $burner has insufficient space.\n\n$msg" \ 678 | --button Continue:gtk-yes \ 679 | --button cancel`" 680 | if [ "$dialog_pressed" != "button1" ]; then 681 | echo "*** Burn cancelled" > "$viewpipe" 682 | return 1 683 | fi 684 | fi 685 | fi 686 | } 687 | 688 | mountburner() 689 | { 690 | is_mounted="`udevil info "$burner" 2> "$viewpipe" | grep "^ is mounted:" | \ 691 | sed 's/.*: *\(.*\)/\1/'`" 692 | x=0 693 | while (( is_mounted != 1 && x < 10 )); do 694 | if (( x == 0 )); then 695 | echo "--- Mounting $burner..." > "$viewpipe" 696 | settask item "Mounting $burner" 697 | settask total 698 | settask progress 0 699 | settask progress "" 700 | settask curremain 701 | settask avgremain 702 | else 703 | sleep 2 704 | fi 705 | if (( verbose )); then 706 | echo ">>> udevil --quiet mount $burner" > "$viewpipe" 707 | fi 708 | udevil --quiet mount $burner > "$viewpipe" 2> "$viewpipe" 709 | 710 | is_mounted="`udevil info "$burner" 2> "$viewpipe" | grep "^ is mounted:" | \ 711 | sed 's/.*: *\(.*\)/\1/'`" 712 | (( x++ )) 713 | done 714 | if (( is_mounted != 1 )); then 715 | echo "*** Unable to mount $burner" > "$viewpipe" 716 | return 1 717 | fi 718 | info="`udevil info "$burner" 2> "$viewpipe"`" 719 | point="`echo "$info" | grep "^ mount paths:" | sed 's/.*: *\(.*\)/\1/'`" 720 | point="${point%%, *}" 721 | vollabel="`echo "$info" | grep "^ label:" | sed 's/.*: *\(.*\)/\1/'`" 722 | if [ ! -d "$point" ]; then 723 | echo "*** Unable to determine mount point" > "$viewpipe" 724 | return 1 725 | fi 726 | } 727 | 728 | reloadtray() 729 | { 730 | echo "--- Reloading $burner..." > "$viewpipe" 731 | settask item "Reloading tray" 732 | settask total 733 | settask progress 0 734 | settask progress "" 735 | settask curremain 736 | settask avgremain 737 | if (( verbose )); then 738 | echo ">>> eject -r $burner" > "$viewpipe" 739 | fi 740 | eject -r $burner 741 | sleep 2 742 | if (( verbose )); then 743 | echo ">>> eject -t $burner" > "$viewpipe" 744 | fi 745 | eject -t $burner 746 | sleep 2 747 | } 748 | 749 | unmountburner() 750 | { 751 | is_mounted="`udevil info "$burner" 2> "$viewpipe" | grep "^ is mounted:" | \ 752 | sed 's/.*: *\(.*\)/\1/'`" 753 | if (( is_mounted )); then 754 | echo "--- Unmounting $burner..." > "$viewpipe" 755 | settask item "Unmounting $burner"; 756 | settask total 757 | settask progress 0 758 | settask progress "" 759 | settask curremain 760 | settask avgremain 761 | if (( verbose )); then 762 | echo ">>> udevil --quiet umount \"$burner\"" > "$viewpipe" 763 | fi 764 | udevil --quiet umount "$burner" > "$viewpipe" 2> "$viewpipe" 765 | fi 766 | } 767 | 768 | startiso() 769 | { 770 | if (( burn_saveimage )) && [ "$burn_saveimage_path" != "" ]; then 771 | createiso_path="$burn_saveimage_path" 772 | else 773 | burn_saveimage=0 774 | largetmpdir="`head -n 1 "$largetmpdirfile" 2>/dev/null`" 775 | if [ ! -d "$largetmpdir" ]; then 776 | largetmpdir="$smalltmp" 777 | fi 778 | # reuse tmpiso_path unless largetmpdir changed 779 | len="${#largetmpdir}" 780 | if [ "${tmpiso_path:0:len}/" != "$largetmpdir/" ]; then 781 | if [ "$tmpiso_path" != "" ]; then 782 | if (( verbose )); then 783 | echo ">>> rm -f \"$tmpiso_path\" &" > "$viewpipe" 784 | fi 785 | rm -f "$tmpiso_path" & 786 | fi 787 | tmpiso_path= 788 | while [ "$tmpiso_path" = "" ] || [ -e "$tmpiso_path" ]; do 789 | fm_randhex4 790 | tmpiso_path="$largetmpdir/burndisc-$fm_randhex.iso" 791 | done 792 | fi 793 | createiso_path="$tmpiso_path" 794 | fi 795 | if (( verbose )); then 796 | verboseopt="--verbose" 797 | else 798 | verboseopt="" 799 | fi 800 | settask item "Creating image" 801 | settask to "$burner" 802 | settask from "$burn_path" 803 | settask progress 0 804 | settask progress "" 805 | settask curremain 806 | settask avgremain 807 | echo "set progress1 0" > "$cmdpipe" & 808 | if [ $burn_job -eq 0 ]; then 809 | isojob="--createiso" 810 | else 811 | isojob="--copyiso" 812 | fi 813 | # reuse prior iso? 814 | size=`stat -c %s "$createiso_path" 2>/dev/null` 815 | if [ -e "$createiso_path" ] && (( size == create_iso_est )); then 816 | eval "`spacefm -g --title "Reuse Image ?" \ 817 | --label "\nAn image with this filesystem size was already created. Reuse this image?\n\n$createiso_path" \ 818 | --button "_Create New" --button "_Reuse"`" 819 | if [ "$dialog_pressed" != "button1" ]; then 820 | echo "--- Reusing prior image $createiso_path" > "$viewpipe" 821 | createiso_pid=-100 822 | ( sleep 1; echo "isook" > "$respipe" ) & 823 | return 824 | fi 825 | fi 826 | # start create/replace iso 827 | bash "$fm_cmd_dir/burn.sh" $verboseopt $isojob \ 828 | "$burn_path" "$createiso_path" "$burn_type" "$burn_label" & 829 | createiso_pid=$! 830 | } 831 | 832 | startburn() 833 | { 834 | echo "set progress1 " > "$cmdpipe" 835 | settask item "Burn Starting" 836 | settask total 837 | settask progress 0 838 | settask progress "" 839 | settask curremain 840 | settask avgremain 841 | if (( burn_job == 2 )); then 842 | # Copy Disc 843 | # if src and dest drive are same, get user to change disc 844 | if [ "$burner" = "$burn_path" ]; then 845 | if (( verbose )); then 846 | echo ">>> eject -r $burner &" > "$viewpipe" 847 | fi 848 | echo "--- Please insert a blank or rewritable disc in $burner..." > "$viewpipe" 849 | eject -r $burner & 850 | runalarm 851 | while true; do 852 | eval "`spacefm -g --title "Insert Media" \ 853 | --label "\nPlease insert a blank or rewritable disc in $burner." \ 854 | --button cancel --button ok`" 855 | if [ "$dialog_pressed" != "button2" ]; then 856 | echo "*** Burn canceled" > "$viewpipe" 857 | setstate BUILD 858 | burn_pid=0 859 | return 860 | fi 861 | has_media="`udevil info "$burner" | grep "^ has media:" | sed 's/.*: *\(.*\)/\1/'`" 862 | if (( has_media == 1 )); then 863 | break 864 | fi 865 | done 866 | fi 867 | burn_job=1 868 | burn_path="$createiso_path" 869 | if ! burnready ; then 870 | setstate BUILD 871 | burn_pid=0 872 | return 873 | fi 874 | fi 875 | if [ ! -e "$createiso_path" ]; then 876 | echo "*** Burn error - iso file is missing" > "$viewpipe" 877 | setstate BUILD 878 | burn_pid=0 879 | return 880 | fi 881 | settask from "$burn_path" 882 | if (( verbose )); then 883 | verboseopt="--verbose" 884 | else 885 | verboseopt="" 886 | fi 887 | if [ "$media_type" = "CD-RW" ] || [ "$media_type" = "CD+RW" ]; then 888 | blank="1" 889 | else 890 | blank="" 891 | fi 892 | if [ "$burn_speed" != "" ] && [ "$burn_speed" != "Max" ]; then 893 | speed="${burn_speed%x}" 894 | else 895 | speed="" 896 | fi 897 | burntime=`date +%s` 898 | bash "$fm_cmd_dir/burn.sh" $verboseopt --burniso "$burner" \ 899 | "$createiso_path" "$burn_type" "$speed" "$blank" & 900 | burn_pid=$! 901 | } 902 | 903 | startsnapshot() 904 | { 905 | echo "--- Writing Snapshot..." > "$viewpipe" 906 | echo "set progress1 " > "$cmdpipe" 907 | settask item "Writing Snapshot" 908 | settask total 909 | settask progress 0 910 | settask progress "" 911 | settask curremain 912 | settask avgremain 913 | settask curspeed 914 | settask avgspeed 915 | old_path="$(pwd)" 916 | cd "$point" 917 | if [ $? -ne 0 ] || (( burn_snapshot != 1 )) || [ "$burn_snapshot_path" = "" ] || \ 918 | [ ! -d "$point" ]; then 919 | echo "*** Failed to write snapshot" > "$viewpipe" 920 | return 1 921 | fi 922 | 923 | if [ -e ".checksum.md5.gz" ]; then 924 | media_date=`stat -c %y ".checksum.md5.gz"` 925 | media_date="${media_date%% *}" 926 | else 927 | media_date="$(date "+%Y-%m-%d")" 928 | fi 929 | echo "SNAPSHOT: $vollabel" > "$burn_snapshot_path" 930 | echo " $burn_type $media_date" >> "$burn_snapshot_path" 931 | echo >> "$burn_snapshot_path" 932 | /bin/ls -1RshpAv >> "$burn_snapshot_path" 2> "$viewpipe" 933 | if (( verbose )); then 934 | echo "---------------------------------------" > "$viewpipe" 935 | echo "SNAPSHOT: $vollabel" > "$viewpipe" 936 | echo " $burn_type $media_date" > "$viewpipe" 937 | echo > "$viewpipe" 938 | /bin/ls -1RshpAv | head -n 20 > "$viewpipe" 939 | echo "..." > "$viewpipe" 940 | echo "---------------------------------------" > "$viewpipe" 941 | fi 942 | cd "$old_path" 943 | } 944 | 945 | startverify() 946 | { 947 | echo "--- $burn_verify..." > "$viewpipe" 948 | echo "set progress1 " > "$cmdpipe" 949 | settask item "$burn_verify" 950 | settask total 951 | settask progress 0 952 | settask progress "" 953 | settask curremain 954 | settask avgremain 955 | settask curspeed 956 | settask avgspeed 957 | if (( verbose )); then 958 | verboseopt="--verbose" 959 | else 960 | verboseopt="" 961 | fi 962 | bash "$fm_cmd_dir/verify.sh" $verboseopt "$burn_verify" "$burner" \ 963 | "$burn_path" "$createiso_path" "$point" & 964 | verify_pid=$! 965 | } 966 | 967 | 968 | # events 969 | spacefm -s add-event evt_device "echo %f > '$respipe'" 970 | selhandler="if [ '%w' != '$fm_my_window' ]; then exit 1; fi; source '$fm_cmd_dir/status.sh' %w %p %t &" 971 | 972 | # default burn path and job 973 | jobs=( "Burn Dir:" "Burn Image:" "Copy Disc:" ) 974 | init_path="$fm_file" 975 | if [ -f "$init_path" ]; then 976 | mtype="`file -L --mime-type "$init_path"`" 977 | mtype="${mtype##*: }" 978 | for ext in .iso .ISO .raw .RAW .img .IMG; do 979 | ext="${init_path/%$ext/.XXX}" 980 | done 981 | if [ "$ext" != "$init_path" ] || [ "$mtype" = "application/x-cd-image" ] || \ 982 | [ "$mtype" = "application/x-iso9660-image" ]; then 983 | init_job=1 984 | else 985 | init_path="" 986 | fi 987 | elif [ -b "$init_path" ]; then 988 | init_job=2 989 | else 990 | init_job=0 991 | if [ ! -d "$init_path" ]; then 992 | init_path="" 993 | fi 994 | fi 995 | if [ "$init_path" = "" ]; then 996 | init_job=0 997 | init_path="$(pwd)" 998 | fi 999 | verify=( "Don't Verify" "Verify Checksums" "Compare To Image" "Compare To Dir" ) 1000 | burn_verify="`head -n 1 "$verifyfile" 2> /dev/null`" 1001 | if [ "$burn_verify" = "" ]; then 1002 | burn_verify="Verify Checksums" 1003 | fi 1004 | if (( init_job != 0 )) && [ "$burn_verify" != "Don't Verify" ]; then 1005 | burn_verify="Compare To Image" 1006 | fi 1007 | 1008 | # show dialog 1009 | spacefm -g --title "Burn Disc" --window-size "@$winsizefile" \ 1010 | --vbox --compact \ 1011 | --hbox --compact \ 1012 | --drop "${jobs[@]}" -- +$init_job \ 1013 | bash -c "echo job > '$respipe'" \ 1014 | --input "$init_path" press freebutton1 \ 1015 | --free-button :gtk-open bash -c "echo browse > '$respipe'" \ 1016 | --close-box \ 1017 | --hbox --compact \ 1018 | --label "Type:" \ 1019 | --combo "@$typelist" "unknown" bash -c "echo type > '$respipe'" \ 1020 | --label "Speed:" \ 1021 | --combo "@$speedlist" +0 noop \ 1022 | --label "Label:" \ 1023 | --input "" noop \ 1024 | --close-box \ 1025 | --hbox --compact \ 1026 | --check "Checksums" $checksums_init \ 1027 | bash -c "echo checksums > '$respipe'" \ 1028 | --check "Snapshot" 0 bash -c "echo snapshot > '$respipe'" \ 1029 | --check "Save Image" 0 bash -c "echo saveimage > '$respipe'" \ 1030 | --drop "${verify[@]}" -- "$burn_verify" \ 1031 | bash -c "echo verify > '$respipe'" \ 1032 | --close-box \ 1033 | --close-box \ 1034 | --hsep \ 1035 | --progress "" \ 1036 | --viewer --scroll "$viewpipe" "$tmplogfile" \ 1037 | --button _Help:gtk-help bash -c "echo help > '$respipe'" \ 1038 | --button C_onfigure:gtk-preferences bash "$fm_cmd_dir/configure.sh" \ 1039 | --button "_Save Log:gtk-save" bash "$fm_cmd_dir/savelog.sh" \ 1040 | --button cancel bash -c "echo cancel > '$respipe'" \ 1041 | --button _Burn:gtk-cdrom bash -c "echo burn > '$respipe'" \ 1042 | --window-close press button4 \ 1043 | --command "$cmdpipe" focus input1 > /dev/null & 1044 | 1045 | dlgpid=$! 1046 | 1047 | if (( verbose )); then 1048 | echo "cdrecord=$cdrecord" > "$viewpipe" 1049 | echo "mkisofs=$mkisofs" > "$viewpipe" 1050 | fi 1051 | 1052 | # start 1053 | # This loop makes the dialog a state machine, changing its state through 1054 | # different parts of the burn process. 1055 | state=BUILD 1056 | trap "echo SIGTERM ignored" SIGTERM 1057 | trap "echo SIGQUIT ignored" SIGQUIT 1058 | trap "echo SIGINT ignored" SIGINT 1059 | trap "echo SIGHUP ignored" SIGHUP 1060 | ( sleep .75; settask item "Burn Dir - Adding Content"; \ 1061 | settask to "$burner"; \ 1062 | settask from ""; \ 1063 | settask progress 0; 1064 | settask popup_handler "echo focus > '$cmdpipe'" ) & 1065 | burn_job=$init_job 1066 | setstate 1067 | getdisc "$burner" 1068 | if [ "$media_label" = "" ]; then 1069 | if [ $burn_job -eq 0 ]; then 1070 | label="`basename "$init_path"`" 1071 | echo "set input2 $label" > "$cmdpipe" 1072 | fi 1073 | else 1074 | echo "set input2 $media_label" > "$cmdpipe" 1075 | fi 1076 | while [ -p "$respipe" ] && [ -p "$cmdpipe" ] && ps -p $dlgpid 2>&1 >/dev/null; do 1077 | read -t .7 <> "$respipe" 1078 | if [ $? -eq 0 ]; then 1079 | #if (( verbose )); then 1080 | # echo "REPLY=$REPLY" > "$viewpipe" 1081 | #fi 1082 | case "$REPLY" in 1083 | help ) 1084 | fm_edit "$fm_cmd_dir/README" & 1085 | ;; 1086 | checksums ) 1087 | if [ $state = BUILD ]; then 1088 | getsrc 1089 | if (( burn_checksums == 0 )); then 1090 | echo -e '\n*** NOTE: Adding checksums takes a few extra minutes, but allows you to later verify a disc even after the original files are gone. To enable this feature select Checksums.\n' > "$viewpipe" 1091 | if [ "$burn_verify" = "Verify Checksums" ]; then 1092 | echo "select drop2 Compare To Image" > "$cmdpipe" 1093 | fi 1094 | else 1095 | if [ "$burn_verify" != "Don't Verify" ]; then 1096 | echo "select drop2 Verify Checksums" > "$cmdpipe" 1097 | fi 1098 | fi 1099 | fi 1100 | ;; 1101 | verify ) 1102 | if [ $state = BUILD ]; then 1103 | getsrc 1104 | if (( burn_job != 0 )); then 1105 | if [ "$burn_verify" = "Verify Checksums" ] || \ 1106 | [ "$burn_verify" = "Compare To Dir" ]; then 1107 | echo "select drop2 Compare To Image" > "$cmdpipe" 1108 | fi 1109 | elif (( burn_checksums == 0 )) && \ 1110 | [ "$burn_verify" = "Verify Checksums" ]; then 1111 | echo "set check1 1" > "$cmdpipe" 1112 | #echo "select drop2 Compare To Image" > "$cmdpipe" 1113 | fi 1114 | fi 1115 | ;; 1116 | snapshot | saveimage ) 1117 | if [ $state = BUILD ]; then 1118 | getsrc 1119 | if [ "$REPLY" = "snapshot" ]; then 1120 | if (( burn_snapshot != 1 )); then 1121 | continue 1122 | fi 1123 | title="Save Snapshot As" 1124 | path="`head -n 1 "$snapshotpathfile" 2> /dev/null`" 1125 | if [ "$path" = "" ]; then 1126 | eval path="~/burndisc-snapshots" 1127 | mkdir -p $path 1128 | fi 1129 | if [ "$burn_snapshot_path" != "" ]; then 1130 | path="$burn_snapshot_path" 1131 | elif [ "$burn_label" != "" ] && (( burn_job == 0 )); then 1132 | path="$path/$burn_label" 1133 | else 1134 | path="$path/snapshot" ########### bugfix only 1135 | fi 1136 | check=check2 1137 | savefile="$snapshotpathfile" 1138 | else 1139 | if (( burn_saveimage != 1 )); then 1140 | continue 1141 | fi 1142 | title="Save Image As" 1143 | path="`head -n 1 "$saveimagepathfile" 2> /dev/null`" 1144 | if [ "$path" = "" ]; then 1145 | path="$(pwd)" 1146 | fi 1147 | if [ "$burn_saveimage_path" != "" ]; then 1148 | path="$burn_saveimage_path" 1149 | elif [ "$burn_label" != "" ] && (( burn_job == 0 )); then 1150 | path="$path/$burn_label.iso" 1151 | else 1152 | path="$path/image.iso" 1153 | fi 1154 | check=check3 1155 | savefile="$saveimagepathfile" 1156 | fi 1157 | while (( 1 )); do 1158 | eval "`spacefm -g --window-size "@$choosersizefile" \ 1159 | --title "$title" \ 1160 | --chooser --save "$path" \ 1161 | --button cancel \ 1162 | --button ok`" 1163 | if [ "$dialog_pressed" = "button2" ] && \ 1164 | [ "$dialog_chooser1" != "" ]; then 1165 | path="$dialog_chooser1" 1166 | if [ -e "$path" ]; then 1167 | eval "`spacefm -g --title "File Exists" \ 1168 | --label "\nFile '$path' already exists.\n\nOverwrite?" \ 1169 | --button yes \ 1170 | --button no`" 1171 | if [ "$dialog_pressed" = "button1" ]; then 1172 | break 1173 | fi 1174 | else 1175 | break 1176 | fi 1177 | else 1178 | echo "set $check 0" > "$cmdpipe" 1179 | path="" 1180 | break 1181 | fi 1182 | done 1183 | if [ "$path" != "" ]; then 1184 | echo "$(dirname "$path")" > "$savefile" 1185 | fi 1186 | if [ "$REPLY" = "snapshot" ]; then 1187 | burn_snapshot_path="$path" 1188 | else 1189 | burn_saveimage_path="$path" 1190 | fi 1191 | fi 1192 | ;; 1193 | job | browse ) 1194 | if [ $state = BUILD ]; then 1195 | if (( burn_job == 0 )); then 1196 | if [ "$burn_verify" != "" ]; then 1197 | echo "$burn_verify" > "$verifyfile" 1198 | fi 1199 | fi 1200 | getsrc 1201 | if [ "$REPLY" = job ]; then 1202 | setstate 1203 | burn_path_last="" 1204 | msg_last="" 1205 | fi 1206 | if (( burn_job == 0 )); then 1207 | diropt="--dir" 1208 | path="$burn_path" 1209 | title="Choose Directory To Burn" 1210 | verify="`head -n 1 "$verifyfile" 2> /dev/null`" 1211 | if [ "$verify" = "" ]; then 1212 | verify="Verify Checksums" 1213 | fi 1214 | echo "select drop2 $verify" > "$cmdpipe" 1215 | elif (( burn_job == 1 )); then 1216 | diropt="" 1217 | path="`head -n 1 "$imagepathfile" 2> /dev/null`" 1218 | if [ "$path" = "" ]; then 1219 | path="$burn_path" 1220 | fi 1221 | title="Choose Image To Burn" 1222 | if [ "$burn_verify" != "Don't Verify" ]; then 1223 | echo "select drop2 Compare To Image" > "$cmdpipe" 1224 | fi 1225 | elif (( burn_job == 2 )); then 1226 | path=`head -n 1 "$copydiscfile" 2> /dev/null` 1227 | if [ "$path" = "" ]; then 1228 | path="$burner" 1229 | fi 1230 | echo "set input1 $path" > "$cmdpipe" 1231 | if [ "$burn_verify" != "Don't Verify" ]; then 1232 | echo "select drop2 Compare To Image" > "$cmdpipe" 1233 | fi 1234 | continue 1235 | #diropt="" 1236 | #if [ "${burn_path:0:5}" = "/dev/" ]; then 1237 | # path="$burn_path" 1238 | #else 1239 | # path="/dev" 1240 | #fi 1241 | #title="Choose Drive To Copy" 1242 | fi 1243 | if [ "${path:0:5}" = "/dev/" ]; then 1244 | path=`pwd` 1245 | fi 1246 | spacefm -g --window-size "@$choosersizefile" \ 1247 | --title "$title" \ 1248 | --chooser $diropt "$path" \ 1249 | --button cancel \ 1250 | --button ok \ 1251 | bash -c "[[ -p '$cmdpipe' ]] && \ 1252 | echo \"set input1 %chooser1\" \ 1253 | > '$cmdpipe'" -- close \ 1254 | > /dev/null & 1255 | fi 1256 | ;; 1257 | burn ) 1258 | if [ $state = BUILD ]; then 1259 | state=PREBURN 1260 | getsrc 1261 | savespeed "$burn_type" 1262 | setstate 1263 | if ! burnready; then 1264 | setstate BUILD 1265 | elif (( burn_job == 0 && burn_checksums == 1 )); then 1266 | echo "--- Generating checksums..." > "$viewpipe" 1267 | echo "set progress1 0" > "$cmdpipe" & 1268 | settask item "Burn Dir - Adding Checksums"; \ 1269 | settask to "$burner"; \ 1270 | settask from "$burn_path"; \ 1271 | settask progress 0; 1272 | settask progress "" 1273 | settask curremain 1274 | settask avgremain 1275 | if (( verbose )); then 1276 | verbopt="--verbose" 1277 | else 1278 | verbopt="" 1279 | fi 1280 | bash "$fm_cmd_dir/checksums.sh" $verbopt "$burn_path" & 1281 | checksums_pid=$! 1282 | elif (( burn_job == 0 )); then 1283 | startiso 1284 | elif (( burn_job == 1 )); then 1285 | createiso_path="$burn_path" 1286 | setstate BURN 1287 | echo "set progress1 0" > "$cmdpipe" & 1288 | startburn 1289 | elif (( burn_job == 2 )); then 1290 | startiso 1291 | else 1292 | setstate BUILD 1293 | fi 1294 | fi 1295 | ;; 1296 | checksumsfail ) 1297 | if [ $state = PREBURN ]; then 1298 | checksums_pid=0 1299 | echo "*** Burn cancelled" > "$viewpipe" 1300 | runalarm 1301 | showmsg "Checksum generation failed." 1302 | setstate BUILD 1303 | fi 1304 | ;; 1305 | checksumsok ) 1306 | if [ $state = PREBURN ]; then 1307 | checksums_pid=0 1308 | if (( burn_job == 0 )); then 1309 | echo "set progress1 0" > "$cmdpipe" & 1310 | startiso 1311 | else 1312 | echo "DONE OK" > "$viewpipe" 1313 | setstate BUILD 1314 | fi 1315 | fi 1316 | ;; 1317 | isofail ) 1318 | if [ $state = PREBURN ]; then 1319 | createiso_pid=0 1320 | echo "*** Burn cancelled" > "$viewpipe" 1321 | runalarm 1322 | showmsg "Image creation failed." 1323 | setstate BUILD 1324 | fi 1325 | ;; 1326 | isook ) 1327 | if [ $state = PREBURN ] && (( createiso_pid )); then 1328 | createiso_pid=0 1329 | setstate BURN 1330 | echo "set progress1 0" > "$cmdpipe" & 1331 | startburn 1332 | fi 1333 | ;; 1334 | burnfail ) 1335 | if [ $state = BURN ]; then 1336 | burn_pid=0 1337 | echo "*** BURN FAILED !" > "$viewpipe" 1338 | showmsg "Burn failed." 1339 | now=`date +%s` 1340 | if (( now - burntime > 5 )); then 1341 | runalarm 1342 | fi 1343 | setstate BUILD 1344 | fi 1345 | ;; 1346 | burnok ) 1347 | if [ $state = BURN ]; then 1348 | burn_pid=0 1349 | echo "--- BURN OK" > "$viewpipe" 1350 | echo "set progress1 0" > "$cmdpipe" 1351 | echo "set progress1" > "$cmdpipe" 1352 | settask total 1353 | settask progress 0 1354 | settask progress "" 1355 | settask curremain 1356 | settask avgremain 1357 | reloadtray 1358 | if (( burn_snapshot )) || [ "$burn_verify" != "Don't Verify" ]; then 1359 | if ! mountburner; then 1360 | showmsg "Verification failed - unable to mount." 1361 | runalarm 1362 | setstate BUILD 1363 | else 1364 | setstate POSTBURN 1365 | if (( burn_snapshot )); then 1366 | startsnapshot 1367 | fi 1368 | if [ "$burn_verify" != "Don't Verify" ]; then 1369 | startverify 1370 | else 1371 | runalarm 1372 | setstate BUILD 1373 | fi 1374 | fi 1375 | else 1376 | setstate BUILD 1377 | fi 1378 | fi 1379 | ;; 1380 | stopburn ) 1381 | if [ $state = BURN ] && (( burn_pid )); then 1382 | killgroup $burn_pid 1383 | burn_pid=0 1384 | echo "*** Burn cancelled" > "$viewpipe" 1385 | setstate BUILD 1386 | fi 1387 | ;; 1388 | verifyfail ) 1389 | if [ $state = POSTBURN ] && (( verify_pid )); then 1390 | verify_pid=0 1391 | echo "*** VERIFY FAILED" > "$viewpipe" 1392 | showmsg "Verification failed." 1393 | runalarm 1394 | setstate BUILD 1395 | fi 1396 | ;; 1397 | verifyok ) 1398 | if [ $state = POSTBURN ] && (( verify_pid )); then 1399 | verify_pid=0 1400 | echo "--- VERIFY OK" > "$viewpipe" 1401 | runalarm 1402 | setstate BUILD 1403 | fi 1404 | ;; 1405 | configure ) 1406 | if [ $state = BUILD ]; then 1407 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 1408 | media_last_type=X 1409 | getdisc "$burner" 1410 | msg_last="" 1411 | fi 1412 | ;; 1413 | verbose ) 1414 | verbose="`head -n 1 "$verbosefile" 2>/dev/null`" 1415 | ;; 1416 | cancel ) 1417 | if [ $state = BUILD ]; then 1418 | echo close > "$cmdpipe" 1419 | break 1420 | elif [ $state = PREBURN ]; then 1421 | setstate BUILD 1422 | msg_last="" 1423 | echo "*** Burn cancelled" > "$viewpipe" 1424 | killgroup $checksums_pid 1425 | checksums_pid=0 1426 | if (( createiso_pid )); then 1427 | killgroup $createiso_pid 1428 | createiso_pid=0 1429 | #if [ "$createiso_path" != "" ]; then 1430 | # if (( verbose )); then 1431 | # echo ">>> rm -f \"$createiso_path\" &" > "$viewpipe" 1432 | # fi 1433 | # rm -f "$createiso_path" & 1434 | #fi 1435 | fi 1436 | elif [ $state = BURN ]; then 1437 | spacefm -g --title "Cancel Burn?" --window-icon gtk-dialog-warning \ 1438 | --label "\nA burn appears to be in progress. If you stop the burn the disc may be incomplete." \ 1439 | --button "_Stop Burn:gtk-cancel" \ 1440 | bash -c "echo stopburn > '$respipe'" \ 1441 | -- close \ 1442 | --button _Continue:gtk-yes \ 1443 | > /dev/null & 1444 | elif [ $state = POSTBURN ]; then 1445 | setstate BUILD 1446 | msg_last="" 1447 | echo "*** Verify cancelled" > "$viewpipe" 1448 | killgroup $verify_pid 1449 | verify_pid=0 1450 | fi 1451 | ;; 1452 | * ) 1453 | if [ $state = BUILD ]; then 1454 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 1455 | if [ "${REPLY:0:5}" = "/dev/" ] && [ "$REPLY" = "$burner" ]; then 1456 | # don't getdisc too frequently - on some systems cdrecord -media-info 1457 | # triggers another udev changed event 1458 | now=`date +%s` 1459 | if (( now - getdisc_time > 7 )); then 1460 | sleep 1 1461 | getdisc "$burner" 1462 | msg_last="" 1463 | if (( burn_job == 2 )); then 1464 | burn_last_path="" 1465 | fi 1466 | fi 1467 | fi 1468 | fi 1469 | ;; 1470 | esac 1471 | fi 1472 | if [ $state = BUILD ]; then 1473 | getsrc 1474 | if [ "$burn_type" != "$burn_last_type" ]; then 1475 | # Type changed 1476 | echo "--- Type changed to $burn_type" > "$viewpipe" 1477 | savespeed "$burn_last_type" 1478 | setspeed 1479 | burn_last_type="$burn_type" 1480 | msg_last="" 1481 | fi 1482 | if (( burn_job == 0 )); then 1483 | showdirsize 1484 | elif (( burn_job == 1 )); then 1485 | showimagesize 1486 | elif (( burn_job == 2 )); then 1487 | showcopysize 1488 | fi 1489 | elif [ $state = PREBURN ]; then 1490 | if (( createiso_pid )); then 1491 | if [ -e "$createiso_path" ]; then 1492 | size=`stat -c %s "$createiso_path"` 1493 | else 1494 | size=0 1495 | fi 1496 | (( percent = size * 100 / create_iso_est )) 1497 | if (( percent == 0 )); then 1498 | echo "set progress1 pulse" > "$cmdpipe" 1499 | else 1500 | echo "set progress1 $percent" > "$cmdpipe" 1501 | fi 1502 | fi 1503 | elif [ $state = BURN ]; then 1504 | if (( tick++ > 2 )); then # don't update every time 1505 | tick=0 1506 | getsrc 1507 | #50 % ( 122 M / 244 M ) (fifo 100%) [buf 99%] 10.8x" 1508 | percent="${burn_progress%% %*}" 1509 | if [ "$percent" != "" ] && (( percent != 0 )); then 1510 | (( percent = percent )) 1511 | total="${burn_progress##*( }" 1512 | total="${total%% )*}" 1513 | speed="${burn_progress##*] }" 1514 | while [ "${speed:0:1}" = " " ]; do 1515 | speed="${speed:1}" 1516 | done 1517 | extra="${burn_progress##* ) }" 1518 | extra="${extra%%]*}]" 1519 | settask item "Burning $extra" 1520 | settask progress "$percent" 1521 | settask curspeed "$speed" 1522 | settask total "$total" 1523 | fi 1524 | fi 1525 | elif [ $state = POSTBURN ] && (( verify_pid )) && \ 1526 | [ "$burn_verify" != "Compare To Dir" ]; then 1527 | echo "set progress1 pulse" > "$cmdpipe" 1528 | fi 1529 | done 1530 | 1531 | 1532 | # cleanup 1533 | settask popup_handler 1534 | spacefm -s remove-event evt_device "echo %f > '$respipe'" 1535 | spacefm -s remove-event evt_pnl_sel "$selhandler" 2>/dev/null 1536 | ( for p in {1..4}; do for t in {1..20}; do spacefm -s set --window \ 1537 | "$fm_my_window" --panel $p --tab $t statusbar_text 2>/dev/null; \ 1538 | done; done ) & 1539 | settask item "Burn Disc - Removing tmp files" 1540 | rm -f "$cmdpipe" 1541 | rm -f "$viewpipe" 1542 | rm -f "$respipe" 1543 | rm -f "$savelogfile" 1544 | rm -rf "$smalltmp" 1545 | if [ "$tmpiso_path" != "" ]; then 1546 | rm -f "$tmpiso_path" & 1547 | fi 1548 | 1549 | exit 1550 | 1551 | 1552 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/savelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # savelog.sh: This script shows the Save Log dialog (from Save Log button). 8 | 9 | 10 | winsize="$fm_cmd_data/config/winsize-savelog" 11 | 12 | savelogfile="$fm_cmd_data/config/savelog" 13 | savelog="`head -n 1 "$savelogfile" 2>/dev/null`" 14 | 15 | # get save path 16 | while (( 1 )); do 17 | eval "`spacefm -g --title "Save Burn Disc Log" --window-size "@$choosersizefile" \ 18 | --chooser --save "$savelog" \ 19 | --button cancel --button save`" 20 | 21 | if [ "$dialog_pressed" != "button2" ]; then 22 | exit 23 | fi 24 | savelog="$dialog_chooser1" 25 | if [ "$dialog_chooser1" = "" ]; then 26 | continue 27 | fi 28 | if [ -e "$savelog" ]; then 29 | eval "`spacefm -g --title "File Exists" \ 30 | --label "\nFile '$savelog' already exists.\n\nOverwrite?" \ 31 | --button yes \ 32 | --button no`" 33 | if [ "$dialog_pressed" = "button1" ]; then 34 | break 35 | fi 36 | else 37 | break 38 | fi 39 | done 40 | 41 | # save log 42 | err=0 43 | if [ -p "$cmdpipe" ]; then 44 | rm -f "$tmplogfile" 45 | echo "source /dev/null" > "$cmdpipe" 46 | sleep .5 47 | x=0 48 | while (( x < 6 )) && [ ! -e "$tmplogfile" ]; do 49 | sleep .5 50 | (( x++ )) 51 | done 52 | if [ -e "$tmplogfile" ]; then 53 | msg=`cp -f "$tmplogfile" "$savelog" 2>&1` 54 | err=$? 55 | rm -f "$tmplogfile" 56 | else 57 | err=1 58 | fi 59 | else 60 | err=1 61 | fi 62 | 63 | if [ $err -ne 0 ]; then 64 | spacefm -g --window-icon error --title "Save Log Error" \ 65 | --label --wrap "\nAn error occured saving log file $savelog\n\n$msg" \ 66 | --button ok > /dev/null & 67 | else 68 | echo "$savelog" > "$savelogfile" 69 | fi 70 | 71 | exit 72 | 73 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 4 | # License: GPL2+ ( See README ) 5 | # 6 | # status.sh: This script sets the spacefm status bar to show deep size once. 7 | 8 | cd "$(spacefm -s get current_dir)" 9 | eval sel="$(spacefm -s get --window $1 --panel $2 --tab $3 selected_filenames)" 10 | if [ "${sel[0]}" != "" ]; then 11 | ( sleep .4; spacefm -s set --window $1 --panel $2 --tab $3 statusbar_text \ 12 | "Calculating..." 2>/dev/null ) & 13 | calcpid=$! 14 | deepsize="$(du -csL "${sel[@]}" 2>/dev/null)" 15 | if [ $? -ne 0 ]; then 16 | err_msg=" ! access errors !" 17 | fi 18 | deepsize="$(echo "$deepsize" | tail -n 1)" 19 | deepsize="${deepsize%%[[:blank:]]*}" 20 | (( deepsize = deepsize / 1024 )) 21 | (( deepsizeg = ( deepsize + 51 ) / 102 )) 22 | if (( deepsizeg < 10 )); then 23 | deepsizeg="0$deepsizeg" 24 | fi 25 | len="${#deepsizeg}" 26 | (( len-- )) 27 | deepsizeg="${deepsizeg:0:len}.${deepsizeg:len}" 28 | if [ "${sel[1]}" = "" ]; then 29 | if [ -h "${sel[0]}" ]; then 30 | link="$(readlink "${sel[0]}")" 31 | if [ -e "$link" ]; then 32 | lmsg="Link → $link" 33 | else 34 | lmsg="!Link → $link (missing)" 35 | fi 36 | else 37 | lmsg="${sel[0]}" 38 | fi 39 | else 40 | lmsg="${#sel[@]} sel" 41 | fi 42 | msg="Selected Deep Size: $deepsize M ( $deepsizeg G )$err_msg $lmsg" 43 | kill $calcpid 2>/dev/null 44 | else 45 | msg="Select files/folders/links to show their deep size" 46 | fi 47 | spacefm -s set --window $1 --panel $2 --tab $3 statusbar_text "$msg" 2>/dev/null & 48 | 49 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_697dd9ec/verify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | 4 | # IG Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # verify.sh: This script verifies disc contents by one of three methods. A 8 | # copy of this script is also used by the Verify Disc command. 9 | 10 | 11 | if [ "$1" = "--verbose" ]; then 12 | verbose=1 13 | shift 14 | else 15 | verbose=0 16 | fi 17 | 18 | burn_verify="$1" 19 | burner="$2" 20 | tree="$3" 21 | iso="$4" 22 | point="$5" 23 | if [ "$tree" != "/" ]; then 24 | # strip trailing slash 25 | tree="${tree%/}" 26 | fi 27 | 28 | if [ ! -p "$respipe" ]; then 29 | respipe=/dev/null 30 | fi 31 | if [ ! -p "$cmdpipe" ]; then 32 | cmdpipe=/dev/null 33 | fi 34 | if [ ! -p "$viewpipe" ]; then 35 | viewpipe=/dev/stdout 36 | fi 37 | 38 | setprogress() 39 | { 40 | (( percent = completed * 100 / deepsize )) 41 | (( completedm = completed / 1024 / 1024 )) 42 | spacefm -s set-task --window $fm_my_window $fm_my_task progress $percent 2>/dev/null & 43 | echo "set progress1 $percent % ( $completedm M / $deepsizem M )" > "$cmdpipe" & 44 | } 45 | 46 | if [ "$burn_verify" = "Verify Checksums" ]; then 47 | cd "$point" 48 | if [ -e "$point/.checksum.md5" ]; then 49 | if (( verbose )); then 50 | echo ">>> md5sum -c --warn \"$point/.checksum.md5\"" > "$viewpipe" 51 | md5sum -c --warn "$point/.checksum.md5" 2> "$viewpipe" > "$viewpipe" 52 | else 53 | md5sum -c --warn "$point/.checksum.md5" 2> "$viewpipe" # output to task dialog 54 | fi 55 | elif [ -e "$point/.checksum.md5.gz" ]; then 56 | if (( verbose )); then 57 | echo ">>> cat \"$point/.checksum.md5.gz\" | gzip -d | md5sum -c --warn" > "$viewpipe" 58 | cat "$point/.checksum.md5.gz" | gzip -d | md5sum -c --warn 2> "$viewpipe" > "$viewpipe" 59 | else 60 | cat "$point/.checksum.md5.gz" | gzip -d | md5sum -c --warn 2> "$viewpipe" # output to task dialog 61 | fi 62 | else 63 | echo "*** Missing $point/.checksum.md5[.gz] - cannot verify checksums" > "$viewpipe" 64 | echo "verifyfail" > "$respipe" 65 | exit 1 66 | fi 67 | if [ $? -eq 0 ]; then 68 | echo "verifyok" > "$respipe" 69 | exit 0 70 | else 71 | echo "verifyfail" > "$respipe" 72 | exit 1 73 | fi 74 | elif [ "$burn_verify" = "Compare To Dir" ]; then 75 | # Compare all files in burn dir (and subfolders) to moint point 76 | # Symlinks are followed 77 | if [ ! -d "$tree" ]; then 78 | echo "*** Missing Burn Dir $tree" > "$viewpipe" 79 | echo "verifyfail" > "$respipe" 80 | exit 1 81 | fi 82 | 83 | # get deep size 84 | deepsize="$(du -csL "$tree" 2>"$viewpipe")" 85 | if [ $? -ne 0 ]; then 86 | echo "errors reading $tree" > "$viewpipe" 87 | echo "verifyfail" > "$respipe" 88 | exit 1 89 | fi 90 | deepsize="$(echo "$deepsize" | tail -n 1)" 91 | deepsize="${deepsize%%[[:blank:]]*}" 92 | (( deepsize = deepsize * 1024 )) 93 | (( deepsizem = deepsize / 1024 )) 94 | completed=0 95 | setprogress 96 | 97 | IFS_OLD="$IFS" 98 | IFS=$'\n' 99 | diffcount=0 100 | filecount=0 101 | prosize=0 102 | treelen=${#tree} 103 | for f1 in `find -L "$tree" -type f`; 104 | do 105 | f2="${f1:$treelen}" 106 | f2="${f2#/}" 107 | f2="$point/$f2" 108 | (( filecount +=1 )) 109 | if [ -e "$f2" ]; then 110 | if (( verbose )); then 111 | echo ">>> cmp -s \"$f1\" \"$f2\"" > "$viewpipe" 112 | fi 113 | cmp -s "$f1" "$f2" 114 | if [ $? -ne 0 ]; then 115 | echo "DIFFERS: $f2" > "$viewpipe" 116 | (( diffcount +=1 )) 117 | fi 118 | else 119 | echo "MISSING: $f2" > "$viewpipe" 120 | (( diffcount +=1 )) 121 | fi 122 | fsize=`stat -Lc %s "$f1"` 123 | (( completed += fsize )) 124 | # don't setprogress too rapidly on small files 125 | (( prosize += fsize )) 126 | if (( prosize > 26214400 )); then 127 | prosize=0 128 | setprogress 129 | fi 130 | done 131 | IFS="$IFS_OLD" 132 | 133 | completed=$deepsize 134 | setprogress 135 | if (( filecount == 0 )); then 136 | echo 'ERROR: No files found.' > "$viewpipe" 137 | echo "verifyfail" > "$respipe" 138 | exit 1 139 | elif (( diffcount == 0 )); then 140 | echo "All $filecount files are equal." > "$viewpipe" 141 | echo "verifyok" > "$respipe" 142 | exit 0 143 | else 144 | echo "WARNING: $diffcount of $filecount files differ." > "$viewpipe" 145 | echo "verifyfail" > "$respipe" 146 | exit 1 147 | fi 148 | elif [ "$burn_verify" = "Compare To Image" ]; then 149 | # Method by OmegaPhil 150 | if [ ! -f "$iso" ]; then 151 | echo "*** Missing Image $iso" > "$viewpipe" 152 | echo "verifyfail" > "$respipe" 153 | exit 1 154 | fi 155 | isosize=`stat -Lc %s "$iso"` 156 | info="`udevil info "$burner" 2> "$viewpipe"`" 157 | blocksize="`echo "$info" | grep -m 1 "^ block size:" | sed 's/.*: *\(.*\)/\1/'`" 158 | if (( blocksize == 0 )); then 159 | blocksize=2048 160 | fi 161 | # Calculating number of blocks from the device to return 162 | (( blocks = isosize / blocksize )) 163 | if (( verbose )); then 164 | vrb="--verbose" 165 | echo ">>> dd if=\"$burner\" count=$blocks bs=$blocksize | cmp $vrb - \"$iso\"" > "$viewpipe" 166 | else 167 | vrb= 168 | fi 169 | dd if="$burner" count=$blocks bs=$blocksize | cmp $vrb - "$iso" 2> "$viewpipe" > "$viewpipe" 170 | if [ $? -eq 0 ]; then 171 | echo "verifyok" > "$respipe" 172 | exit 0 173 | else 174 | echo "verifyfail" > "$respipe" 175 | exit 1 176 | fi 177 | fi 178 | 179 | -------------------------------------------------------------------------------- /ig-burn-tools/src/cstm_7d3dcf7e/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import # import file manager variables (scroll down for info) 3 | # 4 | # Burn Tools ( a SpaceFM Plugin ) by IgnorantGuru 5 | # License: GPL2+ ( See README ) 6 | # 7 | # exec.sh: This script shows the Task Snapshot command dialog. 8 | 9 | 10 | mkdir -p "$fm_cmd_data" 11 | burnerfile="$fm_cmd_data/burner" 12 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 13 | if [ "$burner" = "" ]; then 14 | burner="/dev/sr0" 15 | echo "$burner" > "$burnerfile" 16 | fi 17 | is_mounted="`udevil info "$burner" 2> /dev/null | grep "^ is mounted:" | \ 18 | sed 's/.*: *\(.*\)/\1/'`" 19 | if (( is_mounted != 1 )); then 20 | udevil --quiet mount $burner >/dev/null 2> /dev/null 21 | is_mounted="`udevil info "$burner" 2> /dev/null | grep "^ is mounted:" | \ 22 | sed 's/.*: *\(.*\)/\1/'`" 23 | fi 24 | if (( is_mounted == 1 )); then 25 | media_label="`udevil info "$burner" | grep -m 1 "^ label:" | sed 's/.*: *\(.*\)/\1/'`" 26 | else 27 | media_label= 28 | fi 29 | 30 | i=0 31 | unset devs 32 | for d in /dev/*; do 33 | if [ "${d:0:8}" != "/dev/vcs" ] \ 34 | && [ "${d:0:8}" != "/dev/tty" ] \ 35 | && [ "${d:0:8}" != "/dev/ram" ] \ 36 | && [ "${d:0:9}" != "/dev/loop" ] \ 37 | && [ "${d:0:11}" != "/dev/hidraw" ]; then 38 | devs[i]="$d" 39 | (( i++ )) 40 | fi 41 | done 42 | 43 | snapshotpathfile="$fm_cmd_data/snapshotpath" 44 | path="`head -n 1 "$snapshotpathfile" 2> /dev/null`" 45 | if [ "$path" = "" ]; then 46 | eval path="~/burndisc-snapshots" 47 | mkdir -p $path 48 | fi 49 | if [ "$media_label" != "" ]; then 50 | path="$path/$media_label" 51 | fi 52 | 53 | choosersizefile="$fm_cmd_data/choosersize" 54 | if [ ! -e "$choosersizefile" ]; then 55 | echo "800x600" > "$choosersizefile" 56 | fi 57 | 58 | while (( 1 )); do 59 | eval "`spacefm -g --window-size "@$choosersizefile" \ 60 | --title "Save Snapshot As" \ 61 | --chooser --save "$path" \ 62 | --hbox --compact \ 63 | --label "Take snapshot of disc in drive:" \ 64 | --combo "${devs[@]}" -- "@$burnerfile" \ 65 | --close-box \ 66 | --button cancel \ 67 | --button ok`" 68 | if [ "$dialog_pressed" = "button2" ]; then 69 | path="$dialog_chooser1" 70 | if [ ! -b "$dialog_combo1" ]; then 71 | spacefm -g --title "Invalid Drive" \ 72 | --label "\nDrive '$dialog_combo1' is not a block device" \ 73 | --button ok 2> /dev/null > /dev/null 74 | elif [ "$path" = "" ]; then 75 | continue 76 | elif [ -e "$path" ]; then 77 | eval "`spacefm -g --title "File Exists" \ 78 | --label "\nFile '$path' already exists.\n\nOverwrite?" \ 79 | --button yes \ 80 | --button no`" 81 | if [ "$dialog_pressed" = "button1" ]; then 82 | break 83 | fi 84 | else 85 | break 86 | fi 87 | else 88 | exit 0 89 | fi 90 | done 91 | 92 | burner="`head -n 1 "$burnerfile" 2>/dev/null`" 93 | if [ "$burner" = "" ]; then 94 | burner="/dev/sr0" 95 | fi 96 | 97 | is_mounted="`udevil info "$burner" 2> /dev/null | grep "^ is mounted:" | \ 98 | sed 's/.*: *\(.*\)/\1/'`" 99 | if (( is_mounted != 1 )); then 100 | udevil --quiet mount $burner >/dev/null 2> /dev/null 101 | is_mounted="`udevil info "$burner" 2> /dev/null | grep "^ is mounted:" | \ 102 | sed 's/.*: *\(.*\)/\1/'`" 103 | fi 104 | point="`udevil info "$burner" 2>/dev/null | grep "^ mount paths:" | sed 's/.*: *\(.*\)/\1/'`" 105 | point="${point%%, *}" 106 | old_path="$(pwd)" 107 | if (( is_mounted != 1 )) || [ ! -d "$point" ] || ! cd "$point" ; then 108 | spacefm -g --title "Unable To Mount" --window-icon error \ 109 | --label "\nUnable to mount or access $burner" \ 110 | --button ok 2> /dev/null > /dev/null 111 | exit 0 112 | fi 113 | 114 | if [ -e ".checksum.md5.gz" ]; then 115 | media_date=`stat -c %y ".checksum.md5.gz"` 116 | media_date="${media_date%% *}" 117 | else 118 | media_date="$(date "+%Y-%m-%d")" 119 | fi 120 | vollabel="`udevil info "$burner" | grep -m 1 "^ label:" | sed 's/.*: *\(.*\)/\1/'`" 121 | 122 | echo "SNAPSHOT: $vollabel" > "$path" 123 | echo " $media_date" >> "$path" 124 | echo >> "$path" 125 | /bin/ls -1RshpAv >> "$path" 126 | 127 | cd "$old_path" 128 | 129 | fm_edit "$path" 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | exit $? 145 | # Example variables available for use: (imported by $fm_import) 146 | # These variables represent the state of the file manager when command is run. 147 | # These variables can also be used in command lines and in the Path Bar. 148 | 149 | # "${fm_files[@]}" selected files ( same as %F ) 150 | # "$fm_file" first selected file ( same as %f ) 151 | # "${fm_files[2]}" third selected file 152 | 153 | # "${fm_filenames[@]}" selected filenames ( same as %N ) 154 | # "$fm_filename" first selected filename ( same as %n ) 155 | 156 | # "$fm_pwd" current directory ( same as %d ) 157 | # "${fm_pwd_tab[4]}" current directory of tab 4 158 | # $fm_panel current panel number (1-4) 159 | # $fm_tab current tab number 160 | 161 | # "${fm_panel3_files[@]}" selected files in panel 3 162 | # "${fm_pwd_panel[3]}" current directory in panel 3 163 | # "${fm_pwd_panel3_tab[2]}" current directory in panel 3 tab 2 164 | # ${fm_tab_panel[3]} current tab number in panel 3 165 | 166 | # "${fm_desktop_files[@]}" selected files on desktop (when run from desktop) 167 | # "$fm_desktop_pwd" desktop directory (eg '/home/user/Desktop') 168 | 169 | # "$fm_device" selected device (eg /dev/sr0) ( same as %v ) 170 | # "$fm_device_udi" device ID 171 | # "$fm_device_mount_point" device mount point if mounted (eg /media/dvd) (%m) 172 | # "$fm_device_label" device volume label ( same as %l ) 173 | # "$fm_device_fstype" device fs_type (eg vfat) 174 | # "$fm_device_size" device volume size in bytes 175 | # "$fm_device_display_name" device display name 176 | # "$fm_device_icon" icon currently shown for this device 177 | # $fm_device_is_mounted device is mounted (0=no or 1=yes) 178 | # $fm_device_is_optical device is an optical drive (0 or 1) 179 | # $fm_device_is_table a partition table (usually a whole device) 180 | # $fm_device_is_floppy device is a floppy drive (0 or 1) 181 | # $fm_device_is_removable device appears to be removable (0 or 1) 182 | # $fm_device_is_audiocd optical device contains an audio CD (0 or 1) 183 | # $fm_device_is_dvd optical device contains a DVD (0 or 1) 184 | # $fm_device_is_blank device contains blank media (0 or 1) 185 | # $fm_device_is_mountable device APPEARS to be mountable (0 or 1) 186 | # $fm_device_nopolicy policy_noauto set (no automount) (0 or 1) 187 | 188 | # "$fm_panel3_device" panel 3 selected device (eg /dev/sdd1) 189 | # "$fm_panel3_device_udi" panel 3 device ID 190 | # ... (all these are the same as above for each panel) 191 | 192 | # "fm_bookmark" selected bookmark directory ( same as %b ) 193 | # "fm_panel3_bookmark" panel 3 selected bookmark directory 194 | 195 | # "fm_task_type" currently SELECTED task type (eg 'run','copy') 196 | # "fm_task_name" selected task name (custom menu item name) 197 | # "fm_task_pwd" selected task working directory ( same as %t ) 198 | # "fm_task_pid" selected task pid ( same as %p ) 199 | # "fm_task_command" selected task command 200 | # "fm_task_id" selected task id 201 | # "fm_task_window" selected task window id 202 | 203 | # "$fm_command" current command 204 | # "$fm_value" menu item value ( same as %a ) 205 | # "$fm_user" original user who ran this command 206 | # "$fm_my_task" current task's id (see 'spacefm -s help') 207 | # "$fm_my_window" current task's window id 208 | # "$fm_cmd_name" menu name of current command 209 | # "$fm_cmd_dir" command files directory (for read only) 210 | # "$fm_cmd_data" command data directory (must create) 211 | # To create: mkdir -p "$fm_cmd_data" 212 | # "$fm_plugin_dir" top plugin directory 213 | # tmp="$(fm_new_tmp)" makes new temp directory (destroy when done) 214 | # To destroy: rm -rf "$tmp" 215 | # fm_edit "FILE" open FILE in user's configured editor 216 | 217 | # $fm_import command to import above variables (this 218 | # variable is exported so you can use it in any 219 | # script run from this script) 220 | 221 | 222 | # Script Example 1: 223 | 224 | # # show MD5 sums of selected files 225 | # md5sum "${fm_files[@]}" 226 | 227 | 228 | # Script Example 2: 229 | 230 | # # Show a confirmation dialog using SpaceFM Dialog: 231 | # # http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#dialog 232 | # # Use QUOTED eval to read variables output by SpaceFM Dialog: 233 | # eval "`spacefm -g --label "Are you sure?" --button yes --button no`" 234 | # if [[ "$dialog_pressed" == "button1" ]]; then 235 | # echo "User pressed Yes - take some action" 236 | # else 237 | # echo "User did NOT press Yes - abort" 238 | # fi 239 | 240 | 241 | # Script Example 3: 242 | 243 | # # Build list of filenames in panel 4: 244 | # i=0 245 | # for f in "${fm_panel4_files[@]}"; do 246 | # panel4_names[$i]="$(basename "$f")" 247 | # (( i++ )) 248 | # done 249 | # echo "${panel4_names[@]}" 250 | 251 | 252 | # Script Example 4: 253 | 254 | # # Copy selected files to panel 2 255 | # # make sure panel 2 is visible ? 256 | # # and files are selected ? 257 | # # and current panel isn't 2 ? 258 | # if [ "${fm_pwd_panel[2]}" != "" ] \ 259 | # && [ "${fm_files[0]}" != "" ] \ 260 | # && [ "$fm_panel" != 2 ]; then 261 | # cp "${fm_files[@]}" "${fm_pwd_panel[2]}" 262 | # else 263 | # echo "Can't copy to panel 2" 264 | # exit 1 # shows error if 'Popup Error' enabled 265 | # fi 266 | 267 | 268 | # Script Example 5: 269 | 270 | # # Keep current time in task manager list Item column 271 | # # See http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#sockets 272 | # while (( 1 )); do 273 | # sleep 0.7 274 | # spacefm -s set-task $fm_my_task item "$(date)" 275 | # done 276 | 277 | 278 | # Bash Scripting Guide: http://www.tldp.org/LDP/abs/html/index.html 279 | 280 | # NOTE: Additional variables or examples may be available in future versions. 281 | # To see the latest list, create a new command script or see: 282 | # http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#exvar 283 | 284 | -------------------------------------------------------------------------------- /ig-burn-tools/src/plugin: -------------------------------------------------------------------------------- 1 | # SpaceFM Plugin File 2 | 3 | # THIS FILE IS NOT DESIGNED TO BE EDITED 4 | 5 | [Plugin] 6 | config_version-s=16 7 | cstm_209aa997-x=0 8 | cstm_209aa997-label=IG Burn Tools 9 | cstm_209aa997-child=cstm_697dd9ec 10 | cstm_209aa997-style=17 11 | cstm_209aa997-task=1 12 | cstm_209aa997-task_err=1 13 | cstm_209aa997-task_out=1 14 | cstm_209aa997-keep=1 15 | cstm_697dd9ec-x=1 16 | cstm_697dd9ec-key=98 17 | cstm_697dd9ec-keymod=4 18 | cstm_697dd9ec-label=Burn Disc 19 | cstm_697dd9ec-next=cstm_406561e6 20 | cstm_697dd9ec-parent=cstm_209aa997 21 | cstm_697dd9ec-task=1 22 | cstm_697dd9ec-task_err=1 23 | cstm_697dd9ec-keep=1 24 | cstm_406561e6-x=1 25 | cstm_406561e6-label=Verify Disc 26 | cstm_406561e6-next=cstm_7d3dcf7e 27 | cstm_406561e6-prev=cstm_697dd9ec 28 | cstm_406561e6-task=1 29 | cstm_406561e6-task_err=1 30 | cstm_406561e6-task_out=1 31 | cstm_406561e6-keep=1 32 | cstm_7d3dcf7e-x=1 33 | cstm_7d3dcf7e-key=-1 34 | cstm_7d3dcf7e-label=Take Snapshot 35 | cstm_7d3dcf7e-next=cstm_258dbec4 36 | cstm_7d3dcf7e-prev=cstm_406561e6 37 | cstm_7d3dcf7e-task=1 38 | cstm_7d3dcf7e-task_err=1 39 | cstm_7d3dcf7e-task_out=1 40 | cstm_7d3dcf7e-keep=1 41 | cstm_258dbec4-x=1 42 | cstm_258dbec4-key=107 43 | cstm_258dbec4-keymod=4 44 | cstm_258dbec4-label=Find In Snapshots 45 | cstm_258dbec4-prev=cstm_7d3dcf7e 46 | cstm_258dbec4-task=1 47 | cstm_258dbec4-task_err=1 48 | cstm_258dbec4-task_out=1 49 | cstm_258dbec4-keep=1 50 | cstm_258dbec4-scroll=1 51 | 52 | -------------------------------------------------------------------------------- /ig-example-app/pkg/Example-Application.spacefm-plugin.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-example-app/pkg/Example-Application.spacefm-plugin.tar.gz -------------------------------------------------------------------------------- /ig-example-app/pkg/Example-Application.spacefm-plugin.tar.gz.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-example-app/pkg/Example-Application.spacefm-plugin.tar.gz.sig -------------------------------------------------------------------------------- /ig-example-app/src/cstm_66ed13fb/README: -------------------------------------------------------------------------------- 1 | README 2 | ------ 3 | 4 | Example Application doesn't do anything useful, but the script demonstrates one method of controlling SpaceFM Dialog from a script, effectively making a small application. The widgets shown in the Example Application, and their functions, are arbitrary and unimportant, and may be replaced with whatever widgets your application requires. The method of communication/control between the script's main loop and the running dialog is the primary purpose of this example. 5 | 6 | In simpler examples, SpaceFM Dialog may be used to show a dialog, and interacting with the dialog may execute some simple commands, as shown in multiple examples in the user's manual. When the dialog is closed, the script may then perform a function based on what the user had entered in the dialog. 7 | 8 | However, in an application, we want the dialog window to stay open and perform more extensive actions as the user interacts with it, not just when the dialog is closed. This is more like writing an application in Python or C, where a window is shown, then a main loop is run which handles events in the window and runs code blocks to respond. In Example Application, such a main loop is setup in bash, with events and dialog commands communicated via pipes. 9 | 10 | To create a dialog which behaves like an application, allowing the user to interact with functions while the dialog is open, this script creates a command pipe which is used to send commands to the dialog, an action pipe which is used to send dialog events to the running script, and other pipes or watched files to control the dialog from the script. 11 | 12 | The Example Application script creates data files to store dialog contents and settings, shows the dialog, then runs a main loop to wait for actions from the dialog (and/or from other processes) and to perform periodic updates. When an action occurs, it responds by modifying the dialog. 13 | 14 | This script can be run as a SpaceFM custom command script or independently. If run independently, a "--config-dir DIR" or "-c DIR" option may be specified on the script's command line to control where data files are stored. Use of SpaceFM 0.9.3 or greater is recommended. 15 | 16 | 17 | Copyright and License Information: 18 | 19 | Copyright (C) 2016 IgnorantGuru 20 | 21 | License: Creative Commons Attribution 4.0 International (CC BY 4.0) 22 | https://creativecommons.org/licenses/by/4.0/ 23 | 24 | You are free to: 25 | Share - copy and redistribute the material in any medium or format 26 | Adapt - remix, transform, and build upon the material for any purpose, 27 | even commercially. 28 | 29 | -------------------------------------------------------------------------------- /ig-example-app/src/cstm_66ed13fb/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SpaceFM Dialog Example Application - see README 3 | # Copyright (C) 2016 IgnorantGuru 4 | # 5 | # License: Creative Commons Attribution 4.0 International (CC BY 4.0) 6 | # https://creativecommons.org/licenses/by/4.0/ 7 | # 8 | # You are free to: 9 | # Share - copy and redistribute the material in any medium or format 10 | # Adapt - remix, transform, and build upon the material for any purpose 11 | 12 | ###################################################################### 13 | # Accept --config-dir|-c DIR on command line 14 | $fm_import # use this in case this script run as SpaceFM custom command 15 | # If you run multiple instances of this application script, each should use a 16 | # different config dir. 17 | if [ "$1" = "--config-dir" ] || [ "$1" = "-c" ]; then 18 | # config dir specified on command line 19 | fm_cmd_data="$2" 20 | shift 2 21 | fi 22 | if [ "$fm_cmd_data" = "" ]; then 23 | # not run from within SpaceFM and no config dir specified - use home dir 24 | fm_cmd_data=~/.spacefm-app-example 25 | fi 26 | 27 | ###################################################################### 28 | # A convenience function to set data file defaults 29 | set_default() # $1=file $2=default value 30 | { 31 | val="`head -n 1 "$1" 2>/dev/null`" 32 | if [ "$val" = "" ]; then 33 | echo "$2" > "$1" 34 | fi 35 | } 36 | 37 | ###################################################################### 38 | # Set Dialog Data Files 39 | mkdir -p "$fm_cmd_data" 40 | winsize_file="$fm_cmd_data/winsize" 41 | set_default "$winsize_file" "700x550" # Default dialog size 42 | input1_file="$fm_cmd_data/input1" 43 | drop1_def_file="$fm_cmd_data/drop1_def" 44 | source_file="$fm_cmd_data/source" 45 | rm -f "$source_file" 46 | 47 | ###################################################################### 48 | # Create Pipes 49 | # cmd_pipe is used to send commands to the running dialog 50 | cmd_pipe="$fm_cmd_data/cmd-pipe" 51 | # action_pipe is used to process dialog actions in the main loop 52 | action_pipe="$fm_cmd_data/action-pipe" 53 | # viewer_pipe is used to send messages to the log in the dialog 54 | viewer_pipe="$fm_cmd_data/viewer-pipe" 55 | rm -f "$viewer_pipe" "$cmd_pipe" "$action_pipe" 56 | mkfifo "$viewer_pipe" 57 | mkfifo "$cmd_pipe" 58 | mkfifo "$action_pipe" 59 | 60 | ###################################################################### 61 | # Prepare Dialog Data 62 | choice_list=( "Choice A" "Choice B" "Choice C" ) 63 | # Set default drop list to Choice B 64 | set_default "$drop1_def_file" "${choice_list[1]}" 65 | 66 | 67 | ###################################################################### 68 | # Show Dialog 69 | spacefm -g --title "Example Application" \ 70 | --window-size "@$winsize_file" \ 71 | --window-icon gtk-yes \ 72 | --hbox --compact \ 73 | --label "Choices:" \ 74 | --drop "${choice_list[@]}" -- "@$drop1_def_file" \ 75 | bash -c "echo chose > '$action_pipe'" \ 76 | --close-box \ 77 | --label "Enter text:" \ 78 | --input --compact "@$input1_file" press button1 \ 79 | --label "Log:" \ 80 | --viewer --scroll "$viewer_pipe" \ 81 | --button apply bash -c "echo apply > '$action_pipe'" \ 82 | --button close source /dev/null -- \ 83 | bash -c "echo cancel > '$action_pipe'" -- close \ 84 | --window-close source /dev/null -- \ 85 | bash -c "echo cancel > '$action_pipe'" -- close \ 86 | --command "$cmd_pipe" > /dev/null & 87 | # Get the running dialog's process ID 88 | spid=$! 89 | 90 | ###################################################################### 91 | # Main Loop 92 | # This loop responds to actions in the dialog, and also periodically 93 | # runs blip code which updates the dialog. 94 | delay=5 # seconds 95 | while [ -p "$action_pipe" ] && [ -p "$cmd_pipe" ] && ps -p $spid 2>&1 >/dev/null; do 96 | # wait for action in pipe using timeout to run periodic blip code 97 | read -t $delay <> "$action_pipe" 98 | if [ $? -eq 0 ]; then 99 | action="$REPLY" 100 | else 101 | action="" 102 | fi 103 | 104 | # Get dialog values 105 | if [ "$action" != "" ] && [ "$action" != "cancel" ]; then 106 | # There is a non-cancel action, so tell dialog to create a source 107 | # file so we can get current dialog values 108 | echo "source $source_file" > "$cmd_pipe" & 109 | sleep 0.1 # allow time for file creation 110 | if [ -e "$source_file" ]; then 111 | # Read the source file to update dialog values (eg $dialog_input1) 112 | source "$source_file" 113 | rm -f "$source_file" 114 | fi 115 | fi 116 | 117 | # process action 118 | case "$action" in 119 | apply ) 120 | # User pressed Apply button 121 | # Log a message to the dialog's viewer 122 | echo "Applied $dialog_input1" > "$viewer_pipe" & 123 | # Don't fall through to Blip code 124 | continue 125 | ;; 126 | chose ) 127 | # The user made drop list choice 128 | # Tell dialog to set window title to choice 129 | echo "set title $dialog_drop1" > "$cmd_pipe" & 130 | # Log a message to the dialog's viewer 131 | echo -e "\nChose $dialog_drop1 at $(date)\n" > "$viewer_pipe" & 132 | # Fall through to Blip code 133 | ;; 134 | cancel ) 135 | # The dialog was closed by user action, break main loop 136 | break 137 | ;; 138 | esac 139 | 140 | # Blip - Code placed here will run every $delay (5) seconds: 141 | echo "Blip..." > "$viewer_pipe" & 142 | done 143 | 144 | ###################################################################### 145 | # Cleanup 146 | sleep 0.2 # allow dialog process to exit 147 | if ps -p $spid 2>&1 >/dev/null; then 148 | if [ -p "$cmd_pipe" ]; then 149 | # close dialog 150 | echo "close" > "$cmd_pipe" & 151 | sleep 1 152 | fi 153 | # make sure dialog is gone 154 | kill $spid 2> /dev/null 155 | fi 156 | rm -f "$viewer_pipe" "$cmd_pipe" "$action_pipe" "$source_file" 157 | 158 | exit 159 | -------------------------------------------------------------------------------- /ig-example-app/src/plugin: -------------------------------------------------------------------------------- 1 | # SpaceFM Plugin File 2 | 3 | # THIS FILE IS NOT DESIGNED TO BE EDITED 4 | 5 | [Plugin] 6 | config_version-s=37 7 | cstm_66ed13fb-x=1 8 | cstm_66ed13fb-y= 9 | cstm_66ed13fb-label=Example Application 10 | cstm_66ed13fb-task_err=1 11 | cstm_66ed13fb-task_out=1 12 | cstm_66ed13fb-keep=1 13 | 14 | -------------------------------------------------------------------------------- /ig-paste-into/pkg/IG-Paste-Into.spacefm-plugin.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-paste-into/pkg/IG-Paste-Into.spacefm-plugin.tar.gz -------------------------------------------------------------------------------- /ig-paste-into/pkg/IG-Paste-Into.spacefm-plugin.tar.gz.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-paste-into/pkg/IG-Paste-Into.spacefm-plugin.tar.gz.sig -------------------------------------------------------------------------------- /ig-paste-into/src/cstm_07ce0964/README: -------------------------------------------------------------------------------- 1 | README for IG Paste Into ( a SpaceFM Plugin ) by IgnorantGuru 2 | 3 | https://github.com/IgnorantGuru/spacefm-plugins/wiki#wiki-ig-paste-into 4 | 5 | 6 | CONTENTS 7 | 8 | DESCRIPTION 9 | DEPENDENCIES 10 | INSTRUCTIONS 11 | SUPPORT 12 | LICENSE 13 | 14 | 15 | DESCRIPTION 16 | 17 | Paste Into pastes clipboard files into a single selected folder, or else 18 | into the current folder. It is intended to replace or supplement 19 | SpaceFM's built-in Paste command. 20 | 21 | 22 | DEPENDENCIES 23 | 24 | spacefm >= 0.8.7 25 | 26 | 27 | INSTRUCTIONS 28 | 29 | First, copy or cut one or more files or folders to the clipboard with 30 | the standard Copy or Cut commands. 31 | 32 | Then select (highlight) a single folder to paste into, and select the 33 | Paste Into command. Or, if a single folder is not selected, files will 34 | be pasted into the current folder. 35 | 36 | If the clipboard contains text instead of files, Paste Into will paste the 37 | clipboard text in the pathbar. 38 | 39 | 40 | SUPPORT 41 | 42 | For bugs or questions with this plugin, please post an issue to 43 | https://github.com/IgnorantGuru/spacefm-plugins/issues 44 | 45 | 46 | LICENSE 47 | 48 | Copyright (C) 2013 IgnorantGuru 49 | 50 | This program is free software: you can redistribute it and/or modify 51 | it under the terms of the GNU General Public License as published by 52 | the Free Software Foundation, either version 2 of the License, or 53 | (at your option) any later version. 54 | 55 | This program is distributed in the hope that it will be useful, 56 | but WITHOUT ANY WARRANTY; without even the implied warranty of 57 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 58 | GNU General Public License for more details. 59 | 60 | You should have received a copy of the GNU General Public License 61 | along with this program. If not, see . 62 | 63 | -------------------------------------------------------------------------------- /ig-paste-into/src/cstm_07ce0964/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import # import file manager variables (scroll down for info) 3 | # 4 | # IG Paste Into ( a SpaceFM Plugin ) by IgnorantGuru v1.1 5 | # License: GPL2+ ( See README ) 6 | # Requires: spacefm >= 0.8.7 7 | # 8 | # This script will paste clipboard files into a single selected folder, or into 9 | # the current folder. 10 | 11 | # Get clipboard 12 | task_type=copy 13 | eval clip="$(spacefm -s get clipboard_copy_files)" 14 | if [ "${clip[0]}" = "" ]; then 15 | eval clip="$(spacefm -s get clipboard_cut_files)" 16 | if [ "${clip[0]}" = "" ]; then 17 | # no files on clipboard 18 | clip_text="`spacefm -s get clipboard_text`" 19 | if [ "$clip_text" != "" ]; then 20 | # paste text to pathbar 21 | spacefm -s set focused_pane pathbar 22 | spacefm -s set pathbar_text "$clip_text" 23 | fi 24 | exit 0 25 | fi 26 | task_type=move 27 | fi 28 | 29 | # Check target 30 | if [ "${fm_files[0]}" = "" ] || [ ! -d "${fm_files[0]}" ] || \ 31 | [ "${fm_files[1]}" != "" ]; then 32 | # No valid single target selected - paste into current folder 33 | task_target="$fm_pwd" 34 | else 35 | # Paste into single selected folder 36 | task_target="${fm_files[0]}" 37 | fi 38 | 39 | # Run task 40 | spacefm -s run-task $task_type "${clip[@]}" "$task_target" & 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | exit $? 55 | # Example variables available for use: (imported by $fm_import) 56 | # These variables represent the state of the file manager when command is run. 57 | # These variables can also be used in command lines and in the Path Bar. 58 | 59 | # "${fm_files[@]}" selected files ( same as %F ) 60 | # "$fm_file" first selected file ( same as %f ) 61 | # "${fm_files[2]}" third selected file 62 | 63 | # "${fm_filenames[@]}" selected filenames ( same as %N ) 64 | # "$fm_filename" first selected filename ( same as %n ) 65 | 66 | # "$fm_pwd" current directory ( same as %d ) 67 | # "${fm_pwd_tab[4]}" current directory of tab 4 68 | # $fm_panel current panel number (1-4) 69 | # $fm_tab current tab number 70 | 71 | # "${fm_panel3_files[@]}" selected files in panel 3 72 | # "${fm_pwd_panel[3]}" current directory in panel 3 73 | # "${fm_pwd_panel3_tab[2]}" current directory in panel 3 tab 2 74 | # ${fm_tab_panel[3]} current tab number in panel 3 75 | 76 | # "${fm_desktop_files[@]}" selected files on desktop (when run from desktop) 77 | # "$fm_desktop_pwd" desktop directory (eg '/home/user/Desktop') 78 | 79 | # "$fm_device" selected device (eg /dev/sr0) ( same as %v ) 80 | # "$fm_device_udi" device ID 81 | # "$fm_device_mount_point" device mount point if mounted (eg /media/dvd) (%m) 82 | # "$fm_device_label" device volume label ( same as %l ) 83 | # "$fm_device_fstype" device fs_type (eg vfat) 84 | # "$fm_device_size" device volume size in bytes 85 | # "$fm_device_display_name" device display name 86 | # "$fm_device_icon" icon currently shown for this device 87 | # $fm_device_is_mounted device is mounted (0=no or 1=yes) 88 | # $fm_device_is_optical device is an optical drive (0 or 1) 89 | # $fm_device_is_table a partition table (usually a whole device) 90 | # $fm_device_is_floppy device is a floppy drive (0 or 1) 91 | # $fm_device_is_removable device appears to be removable (0 or 1) 92 | # $fm_device_is_audiocd optical device contains an audio CD (0 or 1) 93 | # $fm_device_is_dvd optical device contains a DVD (0 or 1) 94 | # $fm_device_is_blank device contains blank media (0 or 1) 95 | # $fm_device_is_mountable device APPEARS to be mountable (0 or 1) 96 | # $fm_device_nopolicy policy_noauto set (no automount) (0 or 1) 97 | 98 | # "$fm_panel3_device" panel 3 selected device (eg /dev/sdd1) 99 | # "$fm_panel3_device_udi" panel 3 device ID 100 | # ... (all these are the same as above for each panel) 101 | 102 | # "fm_bookmark" selected bookmark directory ( same as %b ) 103 | # "fm_panel3_bookmark" panel 3 selected bookmark directory 104 | 105 | # "fm_task_type" currently SELECTED task type (eg 'run','copy') 106 | # "fm_task_name" selected task name (custom menu item name) 107 | # "fm_task_pwd" selected task working directory ( same as %t ) 108 | # "fm_task_pid" selected task pid ( same as %p ) 109 | # "fm_task_command" selected task command 110 | # "fm_task_id" selected task id 111 | # "fm_task_window" selected task window id 112 | 113 | # "$fm_command" current command 114 | # "$fm_value" menu item value ( same as %a ) 115 | # "$fm_user" original user who ran this command 116 | # "$fm_my_task" current task's id (see 'spacefm -s help') 117 | # "$fm_my_window" current task's window id 118 | # "$fm_cmd_name" menu name of current command 119 | # "$fm_cmd_dir" command files directory (for read only) 120 | # "$fm_cmd_data" command data directory (must create) 121 | # To create: mkdir -p "$fm_cmd_data" 122 | # "$fm_plugin_dir" top plugin directory 123 | # tmp="$(fm_new_tmp)" makes new temp directory (destroy when done) 124 | # To destroy: rm -rf "$tmp" 125 | # fm_edit "FILE" open FILE in user's configured editor 126 | 127 | # $fm_import command to import above variables (this 128 | # variable is exported so you can use it in any 129 | # script run from this script) 130 | 131 | 132 | # Script Example 1: 133 | 134 | # # show MD5 sums of selected files 135 | # md5sum "${fm_files[@]}" 136 | 137 | 138 | # Script Example 2: 139 | 140 | # # Show a confirmation dialog using SpaceFM Dialog: 141 | # # http://ignorantguru.github.io/spacefm/spacefm-manual-en.html#dialog 142 | # # Use QUOTED eval to read variables output by SpaceFM Dialog: 143 | # eval "`spacefm -g --label "Are you sure?" --button yes --button no`" 144 | # if [[ "$dialog_pressed" == "button1" ]]; then 145 | # echo "User pressed Yes - take some action" 146 | # else 147 | # echo "User did NOT press Yes - abort" 148 | # fi 149 | 150 | 151 | # Script Example 3: 152 | 153 | # # Build list of filenames in panel 4: 154 | # i=0 155 | # for f in "${fm_panel4_files[@]}"; do 156 | # panel4_names[$i]="$(basename "$f")" 157 | # (( i++ )) 158 | # done 159 | # echo "${panel4_names[@]}" 160 | 161 | 162 | # Script Example 4: 163 | 164 | # # Copy selected files to panel 2 165 | # # make sure panel 2 is visible ? 166 | # # and files are selected ? 167 | # # and current panel isn't 2 ? 168 | # if [ "${fm_pwd_panel[2]}" != "" ] \ 169 | # && [ "${fm_files[0]}" != "" ] \ 170 | # && [ "$fm_panel" != 2 ]; then 171 | # cp "${fm_files[@]}" "${fm_pwd_panel[2]}" 172 | # else 173 | # echo "Can't copy to panel 2" 174 | # exit 1 # shows error if 'Popup Error' enabled 175 | # fi 176 | 177 | 178 | # Script Example 5: 179 | 180 | # # Keep current time in task manager list Item column 181 | # # See http://ignorantguru.github.io/spacefm/spacefm-manual-en.html#sockets 182 | # while (( 1 )); do 183 | # sleep 0.7 184 | # spacefm -s set-task $fm_my_task item "$(date)" 185 | # done 186 | 187 | 188 | # Bash Scripting Guide: http://www.tldp.org/LDP/abs/html/index.html 189 | 190 | # NOTE: Additional variables or examples may be available in future versions. 191 | # To see the latest list, create a new command script or see: 192 | # http://ignorantguru.github.io/spacefm/spacefm-manual-en.html#exvar 193 | 194 | -------------------------------------------------------------------------------- /ig-paste-into/src/plugin: -------------------------------------------------------------------------------- 1 | # SpaceFM Plugin File 2 | 3 | # THIS FILE IS NOT DESIGNED TO BE EDITED 4 | 5 | [Plugin] 6 | config_version-s=23 7 | cstm_07ce0964-x=1 8 | cstm_07ce0964-y= 9 | cstm_07ce0964-key=-1 10 | cstm_07ce0964-label=P_aste Into 11 | cstm_07ce0964-icon=gtk-paste 12 | cstm_07ce0964-cxt=1%%%%%1%%%%%9%%%%%0%%%%%true 13 | cstm_07ce0964-task_err=1 14 | cstm_07ce0964-task_out=1 15 | cstm_07ce0964-keep=1 16 | 17 | -------------------------------------------------------------------------------- /ig-spacetv/pkg/IG-SpaceTV.spacefm-plugin.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-spacetv/pkg/IG-SpaceTV.spacefm-plugin.tar.gz -------------------------------------------------------------------------------- /ig-spacetv/pkg/IG-SpaceTV.spacefm-plugin.tar.gz.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm-plugins/143c0c9fc07954b7dc5212f3fba42ae609df65b4/ig-spacetv/pkg/IG-SpaceTV.spacefm-plugin.tar.gz.sig -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_22f53177/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 5 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 6 | # 7 | # SpaceTV Resume Prior 8 | 9 | if [ ! -e ~/.mpv/spacetv/resume-last ]; then 10 | echo "No resume files found" 11 | spacefm -g --window-icon error --title "SpaceTV" \ 12 | --label "\n No resume files found." \ 13 | --timeout 3 --button ok &> /dev/null & 14 | exit 15 | fi 16 | 17 | ~/.mpv/spacetv/resume-last --resumepre & 18 | 19 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_24f65950/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 5 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 6 | # 7 | # SpaceTV Play Video w/ Options 8 | 9 | # initial defaults only - edit current options in ~/.mpv/spacetv/.options 10 | mpv_options="--save-position-on-quit --fullscreen" 11 | help_url='https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/options.rst' 12 | 13 | # reject root 14 | if [ "$(whoami)" = "root" ]; then 15 | echo "This command is disabled for the root user." 16 | spacefm -g --window-icon error --title "SpaceTV" \ 17 | --label "\nThis command is disabled for the root user." \ 18 | --button ok &> /dev/null & 19 | exit 1 20 | fi 21 | 22 | # create ~/.mpv/spacetv 23 | links=~/.mpv/spacetv/watch_later_files 24 | mkdir -p $links 25 | 26 | # store window size 27 | mkdir -p "$fm_cmd_data" 28 | winsizefile="$fm_cmd_data/winsize" 29 | if [ ! -e "$winsizefile" ]; then 30 | echo "600x250" > "$winsizefile" 31 | fi 32 | 33 | # get saved options 34 | mkdir -p ~/.mpv/spacetv/watch_later_files 35 | optsfile=~/.mpv/spacetv/.woptions 36 | options="`head -n 1 $optsfile 2>/dev/null`" 37 | if [ "$options" = "" ]; then 38 | options="$mpv_options" 39 | echo "$options" > $optsfile 40 | fi 41 | scratchfile=~/.mpv/spacetv/.wscratch 42 | 43 | # show dialog 44 | eval "`spacefm -g --title "Play Video With Options" --window-size "@$winsizefile" \ 45 | --window-icon mpv \ 46 | --label "\nmpv options for this video:" \ 47 | --input-large @$optsfile press button2 \ 48 | --label "Press Help to open the mpv options manual in your browser." \ 49 | --label "\nScratchpad: (write notes and unused options here)" \ 50 | --editor $scratchfile $scratchfile \ 51 | --button help spacefm -s run-task web "$help_url" \ 52 | --button cancel --button "_Play:gtk-media-play"`" 53 | if [ "$dialog_pressed" = "button3" ]; then 54 | # play video 55 | ~/.mpv/spacetv/resume-last --options "$dialog_inputlarge1" "${fm_files[@]}" & 56 | else 57 | # restore optsfile - done because spacefm had a bug 0.9.3 and prior 58 | echo "$options" > $optsfile 59 | fi 60 | 61 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_325c1cf6/README: -------------------------------------------------------------------------------- 1 | README for IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 2 | 3 | Updated: v0.5 2014-Jan-19 4 | https://github.com/IgnorantGuru/spacefm-plugins/blob/master/ig-spacetv/ 5 | 6 | 7 | Browse IgnorantGuru's SpaceFM Plugins: 8 | https://github.com/IgnorantGuru/spacefm-plugins/wiki 9 | 10 | Browse ALL SpaceFM Plugins: 11 | https://github.com/IgnorantGuru/spacefm/wiki/Plugins 12 | 13 | 14 | CONTENTS 15 | 16 | DESCRIPTION 17 | INSTALLATION 18 | INSTRUCTIONS 19 | SUPPORT 20 | LICENSE 21 | 22 | 23 | DESCRIPTION 24 | 25 | The IG SpaceTV plugin is ideal for an HTPC setup or any media PC. 26 | 27 | SpaceTV adds resumable video playback to SpaceFM via the mpv video player. 28 | mpv is an actively developed and feature-rich fork of the mplayer/mplayer2 29 | video players. See http://mpv.io 30 | 31 | SpaceTV allows you to play videos in fullscreen without a video player 32 | window, resuming videos from their last position and restoring mpv volume 33 | and other settings. It can also resume the last played video or prior 34 | videos. mpv options may be set globally and on a per video basis. 35 | 36 | SpaceTV adds the following commands to SpaceFM: 37 | 38 | Play Video Plays the selected video(s) in mpv and saves a resume 39 | point. Press Q to quit mpv. 40 | 41 | Play Video w/ Options 42 | Prompts for options to play the selected video(s). 43 | 44 | Resume Last Resumes playing the last unfinished video. 45 | 46 | Resume Prior Shifts the last played video down and resumes the prior 47 | video. Use repeatedly to move backward through videos. 48 | 49 | Browse Unfinished 50 | Opens the folder containing links to unfinished videos. 51 | 52 | Options Opens a dialog allowing you to set mpv options for 53 | playback. 54 | 55 | 56 | INSTALLATION 57 | 58 | IG SpaceTV REQUIRES: 59 | 60 | spacefm v0.9.0 or later 61 | mpv 62 | mpv recommends: ffmpeg (or libav) 63 | See https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav 64 | 65 | General Plugin Installation Instructions: 66 | http://ignorantguru.github.com/spacefm/spacefm-manual-en.html#plugins-install 67 | 68 | To have SpaceTV play all video files by default, first select (highlight) 69 | a video file in the file list. Next right-click on the 70 | Play Video menu item and select Properties. In the Properties dialog 71 | select the Context tab, and set "If enabled, use as opener for:" to 72 | 'files'. If you don't want it to play all video files, you can adjust the 73 | context rules to limit what is played. 74 | 75 | It's also recommended that you create the file ~/.mpv/input.conf, and add 76 | the following lines: 77 | 78 | HOME seek 0 absolute 79 | END seek +14400 80 | 81 | With this file in place, you can press the Home key in mpv to go to the 82 | beginning of a video, or press End to quit without saving a resume point. 83 | 84 | For best results, set key shortcuts for the Resume Last (Win+R) and 85 | Resume Prior (Win+Shift+R) menu items. (Right-click on the menu item 86 | and select Key Shortcut to set a key.) Or, you can set system-wide key 87 | shortcuts to run the following commands (so they will work outside of 88 | SpaceFM): 89 | 90 | # Resume Last 91 | ~/.mpv/spacetv/resume-last 92 | 93 | # Resume Prior 94 | ~/.mpv/spacetv/resume-last --resumepre 95 | 96 | Note that SpaceTV stores data in a 'spacetv' subfolder of mpv's config 97 | folder: ~/.mpv 98 | 99 | You must use the Play Video command once before the other commands can 100 | be used (except Options). 101 | 102 | For greater customization, feel free to edit the spacetv.sh script. When 103 | Play Video is first run, a link to the spacetv.sh script is created: 104 | ~/.mpv/spacetv/resume-last. The link is used by the Resume Last and 105 | Resume Prior commands or may be executed directly. Or to open this 106 | script in SpaceFM, right-click on the Play Video menu item and select 107 | Properties. Click the Options tab and select Open In Browser: Command 108 | Dir. Close the dialog and open the spacetv.sh script. 109 | 110 | The spacetv.sh script may also be used independently of SpaceFM to play 111 | videos, or resume the last or prior videos. See spacetv.sh --help. 112 | This script only requires mpv, not SpaceFM. 113 | 114 | 115 | INSTRUCTIONS 116 | 117 | Play Video will play selected video(s) in mpv and save resume points if 118 | the video does not play to the end. When the same video is played again, 119 | it will resume where it left off, and the mpv volume and other settings 120 | will be restored to those used the last time this file was played. Note 121 | that some resume functions only work if a single file is played at a time. 122 | mpv does not have a GUI, although there is a popup control panel. For 123 | many useful key shortcuts see 124 | https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/mpv.rst 125 | 126 | If you want to play a video using specific options, use Play Video w/ 127 | Options. This dialog also contains a scratchpad where notes or unused 128 | options can be stored. (You must use the Play Video command at least 129 | once after installation before the Play Video w/ Options command can be 130 | used.) Press the Help button to open the mpv options manual. 131 | 132 | Resume Last will resume the last incomplete video. It works by finding 133 | the most recently modified link in ~/.mpv/spacetv/watch_later_files/ 134 | 135 | Resume Prior finds the last incomplete video and sets its timestamp to 136 | an old date. Then it find the next most recent file and plays it. The 137 | effect is that using Resume Prior multiple times will keep stepping 138 | backward through resumeable videos. (Once you reach the beginning of the 139 | list, the order will be effectively random.) 140 | 141 | Browse Unfinished opens ~/.mpv/spacetv/watch_later_files/ in a tab of 142 | SpaceFM so you can view and play videos that have resume points. You can 143 | also set a bookmark to this folder. (Using a link to this folder may not 144 | work correctly, but this folder itself may be replaced by a link.) 145 | 146 | Options allows you to set options to be used when Play Video, Resume Last, 147 | or Resume Prior is used. The Options dialog also contains a scratchpad 148 | where notes or unused options can be stored. 149 | 150 | 151 | SUPPORT 152 | 153 | For bugs, requests, or questions with this plugin, please post an issue to 154 | https://github.com/IgnorantGuru/spacefm-plugins/issues 155 | 156 | Support is provided for the IG SpaceTV GUI and internal 157 | functionality, but not for general errors or failures in the mpv player, 158 | which you will need to research independently. 159 | 160 | 161 | LICENSE 162 | 163 | Copyright (C) 2014 IgnorantGuru 164 | 165 | This program is free software: you can redistribute it and/or modify 166 | it under the terms of the GNU General Public License as published by 167 | the Free Software Foundation, either version 2 of the License, or 168 | (at your option) any later version. 169 | 170 | This program is distributed in the hope that it will be useful, 171 | but WITHOUT ANY WARRANTY; without even the implied warranty of 172 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 173 | GNU General Public License for more details. 174 | 175 | You should have received a copy of the GNU General Public License 176 | along with this program. If not, see . 177 | 178 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_325c1cf6/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 5 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 6 | # 7 | # SpaceTV Play Video 8 | 9 | # reject root 10 | if [ "$(whoami)" = "root" ]; then 11 | echo "This command is disabled for the root user." 12 | spacefm -g --window-icon error --title "SpaceTV" \ 13 | --label "\nThis command is disabled for the root user." \ 14 | --button ok &> /dev/null & 15 | exit 1 16 | fi 17 | 18 | if [ "$(which mpv)" = "" ]; then 19 | echo "The SpaceTV plugin requires mpv to be installed." 20 | spacefm -g --window-icon error --title "SpaceTV" \ 21 | --label "\nThe SpaceTV plugin requires mpv to be installed." \ 22 | --button ok &> /dev/null & 23 | exit 1 24 | fi 25 | 26 | # create ~/.mpv/spacetv 27 | links=~/.mpv/spacetv/watch_later_files 28 | mkdir -p $links 29 | 30 | # link the spacetv.sh for use by the Resume Last and Prior commands 31 | # and by system-wide shortcuts 32 | if [ "$(readlink ~/.mpv/spacetv/resume-last 2>/dev/null)" != \ 33 | "$fm_cmd_dir/spacetv.sh" ]; then 34 | ln -sf "$fm_cmd_dir/spacetv.sh" ~/.mpv/spacetv/resume-last 35 | fi 36 | 37 | # play video 38 | "$fm_cmd_dir/spacetv.sh" "${fm_files[@]}" & 39 | 40 | 41 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_325c1cf6/spacetv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 4 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 5 | # 6 | # SpaceTV script to play or resume video 7 | # 8 | # This spacetv.sh script may also be used independently of SpaceFM to play 9 | # videos, or resume the last (--resumelast) or prior (--resumepre) videos. 10 | # To pass it mpv options, use --options OPTIONS as the first argument. 11 | # This script only requires mpv, not SpaceFM. 12 | 13 | # initial defaults only - edit current options in ~/.mpv/spacetv/.options 14 | mpv_options="--save-position-on-quit --fullscreen" 15 | 16 | if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then 17 | cat << EOF 18 | SpaceTV 0.5 Copyright (C) 2014 IgnorantGuru GPL2+ 19 | Plays videos in mpv with resume. 20 | Usage: spacetv.sh [--options OPTIONS] FILE ... 21 | Usage: spacetv.sh --resumelast 22 | Usage: spacetv.sh --resumepre 23 | 24 | Options must precede files on the command line. OPTIONS are mpv options. 25 | Global options are saved in ~/.mpv/spacetv/.options 26 | 27 | https://github.com/IgnorantGuru/spacefm-plugins/blob/master/ig-spacetv/ 28 | 29 | EOF 30 | exit 31 | fi 32 | 33 | # reject root 34 | if [ "$(whoami)" = "root" ]; then 35 | echo "This command is disabled for the root user." 36 | spacefm -g --window-icon error --title "SpaceTV" \ 37 | --label "\nThis command is disabled for the root user." \ 38 | --button ok &> /dev/null & 39 | exit 1 40 | fi 41 | 42 | # create ~/.mpv/spacetv 43 | links=~/.mpv/spacetv/watch_later_files 44 | mkdir -p $links 45 | 46 | # get saved options 47 | optsfile=~/.mpv/spacetv/.options 48 | options="`head -n 1 $optsfile 2>/dev/null`" 49 | if [ "$options" = "" ]; then 50 | options="$mpv_options" 51 | echo "$options" > $optsfile 52 | fi 53 | 54 | # get custom options 55 | if [ "$1" = "--options" ]; then 56 | options="$2" 57 | shift 2 58 | fi 59 | 60 | # get resume options 61 | if [ "$1" = "--resumepre" ]; then 62 | resumepre=1 63 | resume=1 64 | shift 65 | elif [ "$1" = "--resumelast" ] || [ "$1" = "" ]; then 66 | resume=1 67 | shift 68 | fi 69 | 70 | if (( resume == 1 )); then 71 | # find last played incomplete file 72 | cd "$links" 73 | lastresume=`/bin/ls -1t 2> /dev/null | head -n 1` 74 | 75 | if (( resumepre == 1 )) && [ "$lastresume" != "" ]; then 76 | touch -h --date="2000-01-01 00:00" "$links/$lastresume" 77 | lastresume=`/bin/ls -1t 2> /dev/null | head -n 1` 78 | fi 79 | 80 | if [ "$lastresume" = "" ]; then 81 | echo "No resume files found" 82 | spacefm -g --window-icon error --title "SpaceTV" \ 83 | --label "\n No resume files found." \ 84 | --timeout 3 --button ok &> /dev/null & 85 | exit 86 | fi 87 | resumefile="$(readlink "$links/$lastresume")" 88 | while [ "$1" != "" ]; do 89 | shift 90 | done 91 | else 92 | resumefile="" 93 | if [ "$2" = "" ] && [ -h "$1" ] && [ "$(dirname "$1")" = "$links" ]; then 94 | # opening resume file link - resolve 95 | resumefile="$(readlink "$1")" 96 | shift 97 | fi 98 | fi 99 | 100 | if [ "$resumefile" = "" ] && [ "$1" = "" ]; then 101 | exit 102 | fi 103 | 104 | # play video 105 | 106 | # get video filename 107 | if [ "$resumefile" != "" ]; then 108 | base="$(basename "$resumefile")" 109 | else 110 | base="$(basename "$1")" 111 | fi 112 | 113 | # add any conditional options based on file extension, etc here: 114 | extra_options="" 115 | 116 | # play video in mpv 117 | echo "spacetv: mpv $options $extra_options --quiet" "$resumefile" "$@" 118 | out="`mpv $options $extra_options --quiet "$resumefile" "$@"`" 119 | if [ "$out" = "" ]; then 120 | exit 121 | fi 122 | echo "$out" 123 | 124 | # save last played incomplete file? 125 | if [ "$resumefile" != "" ] || [ "$2" = "" ]; then 126 | # only one file played 127 | if [ "$out" = "${out/Exiting... (End of file)/}" ]; then 128 | # end not reached - save as last played incomplete file 129 | if [ "$1" != "" ]; then 130 | resumefile="$1" 131 | fi 132 | ln -sf "$resumefile" $links/"$base" 133 | else 134 | # end reached - remove link 135 | rm -f $links/"$base" 136 | fi 137 | fi 138 | 139 | # delete resume files older than 60 days - enable if desired 140 | #find -L ~/.mpv/watch_later -maxdepth 1 -type f -mtime +60 -execdir rm {} \; 141 | 142 | # delete resume links older than 60 days 143 | find -H $links -maxdepth 1 -type f -mtime +60 -execdir rm {} \; 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_44ddc0b1/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 5 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 6 | # 7 | # SpaceTV Options 8 | 9 | # initial defaults only - edit current options in ~/.mpv/spacetv/.options 10 | mpv_options="--save-position-on-quit --fullscreen" 11 | help_url='https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/options.rst' 12 | 13 | # reject root 14 | if [ "$(whoami)" = "root" ]; then 15 | echo "This command is disabled for the root user." 16 | spacefm -g --window-icon error --title "SpaceTV" \ 17 | --label "\nThis command is disabled for the root user." \ 18 | --button ok &> /dev/null & 19 | exit 1 20 | fi 21 | 22 | # store window size 23 | mkdir -p "$fm_cmd_data" 24 | winsizefile="$fm_cmd_data/winsize" 25 | if [ ! -e "$winsizefile" ]; then 26 | echo "600x500" > "$winsizefile" 27 | fi 28 | 29 | # get saved options 30 | mkdir -p ~/.mpv/spacetv/watch_later_files 31 | optsfile=~/.mpv/spacetv/.options 32 | options="`head -n 1 $optsfile 2>/dev/null`" 33 | if [ "$options" = "" ]; then 34 | options="$mpv_options" 35 | echo "$options" > $optsfile 36 | fi 37 | scratchfile=~/.mpv/spacetv/.scratch 38 | 39 | eval "`spacefm -g --title "SpaceTV Options" --window-size "@$winsizefile" \ 40 | --window-icon gtk-preferences \ 41 | --label "\nmpv options:" \ 42 | --input-large @$optsfile press button2 \ 43 | --label "Press Help to open the mpv options manual in your browser. If you don't include --save-position-on-quit, then you must quit mpv with Shift+Q in order to save a resume point." \ 44 | --label "\nScratchpad: (write notes and unused options here)" \ 45 | --editor $scratchfile $scratchfile \ 46 | --button help spacefm -s run-task web "$help_url" \ 47 | --button cancel --button save`" 48 | if [ "$dialog_pressed" = "button3" ]; then 49 | echo "$dialog_inputlarge1" > $optsfile 50 | else 51 | # restore optsfile - done because spacefm had a bug 0.9.3 and prior 52 | echo "$options" > $optsfile 53 | fi 54 | exit 55 | -------------------------------------------------------------------------------- /ig-spacetv/src/cstm_6311c045/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $fm_import 3 | # 4 | # IG SpaceTV ( a SpaceFM Plugin ) by IgnorantGuru 5 | # Copyright (C) 2014 IgnorantGuru License: GPL2+ 6 | # 7 | # SpaceTV Resume Last 8 | 9 | if [ ! -e ~/.mpv/spacetv/resume-last ]; then 10 | echo "No resume files found" 11 | spacefm -g --window-icon error --title "SpaceTV" \ 12 | --label "\n No resume files found." \ 13 | --timeout 3 --button ok &> /dev/null & 14 | exit 15 | fi 16 | 17 | ~/.mpv/spacetv/resume-last --resumelast & 18 | 19 | -------------------------------------------------------------------------------- /ig-spacetv/src/plugin: -------------------------------------------------------------------------------- 1 | # SpaceFM Plugin File 2 | 3 | # THIS FILE IS NOT DESIGNED TO BE EDITED 4 | 5 | [Plugin] 6 | config_version-s=23 7 | cstm_5724e904-x=0 8 | cstm_5724e904-label=SpaceTV 9 | cstm_5724e904-icon=mpv 10 | cstm_5724e904-child=cstm_325c1cf6 11 | cstm_5724e904-style=17 12 | cstm_5724e904-task=1 13 | cstm_5724e904-task_err=1 14 | cstm_5724e904-task_out=1 15 | cstm_5724e904-keep=1 16 | cstm_325c1cf6-x=1 17 | cstm_325c1cf6-y= 18 | cstm_325c1cf6-label=Play Video 19 | cstm_325c1cf6-icon=mpv 20 | cstm_325c1cf6-next=cstm_24f65950 21 | cstm_325c1cf6-cxt=1%%%%%0%%%%%0%%%%%4%%%%%video/ 22 | cstm_325c1cf6-parent=cstm_5724e904 23 | cstm_325c1cf6-task_err=1 24 | cstm_325c1cf6-task_out=1 25 | cstm_325c1cf6-keep=1 26 | cstm_24f65950-x=1 27 | cstm_24f65950-y= 28 | cstm_24f65950-label=Play Video w/ Options 29 | cstm_24f65950-icon=mpv 30 | cstm_24f65950-next=cstm_6311c045 31 | cstm_24f65950-cxt=1%%%%%0%%%%%0%%%%%4%%%%%video/ 32 | cstm_24f65950-prev=cstm_325c1cf6 33 | cstm_24f65950-task_err=1 34 | cstm_24f65950-task_out=1 35 | cstm_24f65950-keep=1 36 | cstm_6311c045-x=1 37 | cstm_6311c045-y= 38 | cstm_6311c045-label=Resume Last 39 | cstm_6311c045-icon=gtk-media-previous 40 | cstm_6311c045-next=cstm_22f53177 41 | cstm_6311c045-prev=cstm_24f65950 42 | cstm_6311c045-task_err=1 43 | cstm_6311c045-task_out=1 44 | cstm_6311c045-keep=1 45 | cstm_22f53177-x=1 46 | cstm_22f53177-y= 47 | cstm_22f53177-label=Resume Prior 48 | cstm_22f53177-icon=gtk-media-rewind 49 | cstm_22f53177-next=cstm_5a35be92 50 | cstm_22f53177-prev=cstm_6311c045 51 | cstm_22f53177-task_err=1 52 | cstm_22f53177-task_out=1 53 | cstm_22f53177-keep=1 54 | cstm_5a35be92-x=3 55 | cstm_5a35be92-y= 56 | cstm_5a35be92-z=~/.mpv/spacetv/watch_later_files 57 | cstm_5a35be92-label=Browse Unfinished 58 | cstm_5a35be92-next=cstm_44ddc0b1 59 | cstm_5a35be92-prev=cstm_22f53177 60 | cstm_5a35be92-task=1 61 | cstm_5a35be92-task_err=1 62 | cstm_5a35be92-task_out=1 63 | cstm_5a35be92-keep=1 64 | cstm_44ddc0b1-x=1 65 | cstm_44ddc0b1-y= 66 | cstm_44ddc0b1-label=Options 67 | cstm_44ddc0b1-icon=gtk-preferences 68 | cstm_44ddc0b1-prev=cstm_5a35be92 69 | cstm_44ddc0b1-task_err=1 70 | cstm_44ddc0b1-task_out=1 71 | cstm_44ddc0b1-keep=1 72 | 73 | --------------------------------------------------------------------------------