diff options
-rw-r--r-- | misc/haiku/logo.hvif | bin | 0 -> 3645 bytes | |||
-rw-r--r-- | misc/haiku/nnn-master.recipe | 6 | ||||
-rw-r--r-- | misc/haiku/nnn.rdef | 140 | ||||
-rwxr-xr-x | plugins/.cbcp | 4 | ||||
-rwxr-xr-x | plugins/.ntfy | 4 | ||||
-rwxr-xr-x | plugins/nuke | 14 | ||||
-rwxr-xr-x | plugins/x2sel | 4 | ||||
-rw-r--r-- | src/nnn.c | 4 |
8 files changed, 169 insertions, 7 deletions
diff --git a/misc/haiku/logo.hvif b/misc/haiku/logo.hvif Binary files differnew file mode 100644 index 0000000..3f7dfdc --- /dev/null +++ b/misc/haiku/logo.hvif diff --git a/misc/haiku/nnn-master.recipe b/misc/haiku/nnn-master.recipe index b9dadce..a04280c 100644 --- a/misc/haiku/nnn-master.recipe +++ b/misc/haiku/nnn-master.recipe @@ -1,4 +1,4 @@ -SUMMARY="The missing terminal file manager for X" +SUMMARY="A blazing-fast lightweight terminal file manager" DESCRIPTION="nnn is a full-featured terminal file manager. It's tiny and \ nearly 0-config with an incredible performance. @@ -8,7 +8,7 @@ capabilities further. You can plug new functionality and play with a \ custom keybind instantly. There's an independent (neo)vim plugin. It runs smoothly on the Raspberry Pi, Termux on Android, Linux, macOS, BSD, \ -Cygwin, WSL and works seamlessly with DEs and GUI utilities. +Cygwin, WSL, Haiku and works seamlessly with DEs and GUI utilities. Visit the Wiki for concepts, program usage, how-tos and troubleshooting." HOMEPAGE="https://github.com/jarun/nnn" @@ -53,4 +53,6 @@ BUILD() INSTALL() { make -f misc/haiku/Makefile install PREFIX=$prefix + + addResourcesToBinaries misc/haiku/nnn.rdef $prefix/bin/nnn } diff --git a/misc/haiku/nnn.rdef b/misc/haiku/nnn.rdef new file mode 100644 index 0000000..7a35654 --- /dev/null +++ b/misc/haiku/nnn.rdef @@ -0,0 +1,140 @@ + +# How to apply this resource definition file manually (Haiku only): +# First, make sure that nnn is compiled. +# Next, run "rc nnn.rdef -o nnn.rsrc" to compile this resource file. +# Then, run "xres -o nnn nnn.rsrc" to apply the resource file to nnn. +# Finally, run "mimeset -f nnn" to refresh Haiku's MIME database. + +resource app_signature "application/x-vnd.Jarun-nnn"; + +resource app_version { + major = 3, + middle = 4, + minor = 0, + + variety = B_APPV_DEVELOPMENT, + internal = 0, + + short_info = "nnn", + long_info = "A blazing-fast lightweight terminal file manager" +}; + +resource app_flags B_MULTIPLE_LAUNCH | B_BACKGROUND_APP | B_ARGV_ONLY; + +resource file_types message { + "types" = "application/x-vnd.Be-directory" +}; + +resource vector_icon { + $"6E6369660805FF032E343602011202B8E0C339BAC3B985CFB8B7E549F5FF4994" + $"000000FFFF0000020112023745BA3659FABA87063B846942D03049EBF80000FF" + $"FF0000020112033BE54D39FE49B857E23A493A4A91FF489000000000AF0000FF" + $"00FF020112022D299A3B3A49BCE2FF2ED4134A65A94C096A0000FFFF00000201" + $"1202365425358147B6C63037AFB14669664AB9F30000FFFF0000020112023673" + $"5235AC4EB7FB7138A81D481E6A48C2C50000FFFF00000F0241BE60B360BE60B3" + $"60BE5FB360BE3EB364BE46B362BE2AB369BE17B371BE1FB36DBE03B379BDF3B3" + $"85BDFCB37EBDE3B38EBDCEB3A0BDD9B398BDB8B3B1BD8BB3DDBDA4B3C5BD58B4" + $"0EBCCDB4A0BD17B450BC93B4DBBC36B539BC61B50DBC35B537BC32B536BC34B5" + $"37BBE6B50ABB0FB48BBB7EB4CEBA9EB448B9E8B3DDBA36B40AB9C1B3C5B987B3" + $"A5B9A0B3B3B97AB39FB967B394B971B399B961B391B954B38CB95DB390B94FB3" + $"89B942B385B94CB388B93FB382B92FB37EB939B381B926B37DB8FFB379B900B3" + $"79B8E9B379B87FB3A4B8B1B37DB84CB3C8B82FB418B838B3FBB81FB453B826B4" + $"89B825B466B827B4CDB841B5F9B82FB534B848B656B854B6F9B84EB6B1B85AB7" + $"41B85CB776B85CB782B85CB75BB83AB7A7B860B772B814B7DBB767B88FB7CEB8" + $"29B6E7B90DB65CB9D1B694B955B626BA4CB62ABB5AB62CBAB9B629BC54B606BC" + $"9DB634BC1BB5CDBD3EB4B1BEF5B597BDA1B445BF96B3B0C089B3DDC033B31AC1" + $"A4B318C3DAB2D2C2D1B371C536B61FC639B4ABC60FB641C680B698C6F2B65CC6" + $"CFB698C6F2B69AC6F2B69AC6F2B71EC742B838C6F9B7BDC733B8B2C6BEB96CC5" + $"E2B919C65DB99BC59FBA11C4C4B9D8C530BA78C400BB14C34ABAB4C3A1BB75C2" + $"F2BD20C209BC0BC29ABDDEC1A6BED6C108BE5244BED6C121BED8C151BED9C139" + $"BECCC24CBE29C3E9BE9AC307BDC3C4B6BC1DC63ABD84C4F7BB43C700BA57C7FA" + $"BAB9C781B9F5C872B99DC966B9BCC8EBB961CA48B95ECBBBB955CB0830CBFDB9" + $"65CC7FB962CC3DBFC3CC7F60CC7FC621CC7FCC7ECBDECC7ACA9BCC7CCB3CCC6F" + $"C6D6CA63BE51CB9AC1F5C98736C731B8ADC899BA16C5F2B76EC2C4B648C477B6" + $"A1C212B625BFF7B63643B625C013B634C04A28C02FB631C027B5E2BFE0B546C0" + $"04B593BFAFB4D8BF5EB436BF81B47BBF4DB415BF30B3E0BF3FB3F8BF28B3D3BF" + $"18B3BBBF22B3C9BF11B3B4BEFFB39DBF0CB3ABBEF8B398BEE2B385BEF1B390BE" + $"DAB380BEC5B375BED1B37ABEB9B36EBE96B364BE96B364BE96B364BE95B364BE" + $"95B364BE93B364BE93B364BE93B364BE93B364BE60B360BE60B360BE60B36002" + $"23BCA6C6D2BCA6C6D2BE0FC58CBEDFC443BE70C523BF5BC34EBFA3C159BF97C2" + $"6DBFAAC0AEBF80BFC2BF99BFDABF7ABFBBBF34BFE33FBFC7BEA9C048BCC3C154" + $"BDD9C0C2BA90C277B95BC467BA2FC2CFB926C4CCB8C5C56FB8E2C542B83EC636" + $"B702C644B780C68FB6CEC624B6A8C5B6B6B4C5FDB6A1C587B660C581B69CC584" + $"B510C56EB3DDC3A7B426C4C2B3ACC2EDB465C0E9B3E0C1E1B481C0B1B55ABF67" + $"B4F0C005B642BE10B6C7BCE0B689BD92B6F5BC5DB6F6BB5AB6F5BC55B6F7BA1A" + $"B7F5B921B6F5BA1EB8CDB84DB928B776B928B7CEB928B757B90CB5E9B91BB6A4" + $"B8EBB45DB8FFB446B8EBB446B907B446BAA6B53A31B4B4BB85B5C0BC54B62FBC" + $"47B62FBC6128BD60B52BBCDBB5BABDF2B491BE6BB42BBE5EB428BE78B42EBF27" + $"B59ABEC3B4C2BF5DB613BFCBB704BF95B68DBFDEB703C005B702BFF2B702C0F0" + $"B6F1C29CB70FC229B6F9C42AB761C6A0B93DC57CB818C7F0BA8FC9A0BE92C8CC" + $"BC13CACFC21CCBAECA9DCBA3C6F5CBAFCAFBCBB15ECBB0CB56C5D85EBA295EC0" + $"015EBA21CB0FBA61C99A32CA68BA97C8CBBCA6C6D2BAF4C858BCA6C6D20215C8" + $"1C5EC81C5EC80FCB23C7DAC9A7C805CA9DC79EC84BC6E7C4FBC747C6A251C353" + $"C5B5C054C61BC1ACC54FBEF9C4A1BD7F4DBDEFC457BD12C3C3BC5FC40EBCB4C3" + $"79BC0DC2D8BB87C32B36C285BB4BC1C8BAF0C22BBB19C195BADDC120BAC444BA" + $"D2C13EBADEC177BB1CC15CBAF6C19EBB66C1B9BC18C1B5BBBAC1BCBC74C184BD" + $"41C1ABBCD8C15CBDA9C0C1BE85C11DBE17C0683EBF5CBFD2BFF2BF64BF69BFCD" + $"BF80BFC2BF7EBFBFBF99BFDABFA3C159BFAAC0AEBF97C26DBEE1C443BF5BC34E" + $"BE70C523BCA6C6D2BE0FC58CBAF4C858BA61C99ABA97C8CB32CA68BA295EBA21" + $"CB0FBECF5EC81C5EC3755EC81C5E021CBE6BB42BBE6BB42BBE5EB428BD60B52B" + $"BDF2B491BCDBB5BABC54B62FBC6128BC47B62FBAA6B53ABB85B5C031B4B4B8FF" + $"B446B907B446B8EBB446B90CB5E9B8EBB45DB91BB6A4B928B776B928B757B928" + $"B7CEB7F5B921B8CDB84DB6F5BA1EB6F6BB5AB6F7BA1AB6F5BC55B6C7BCE0B6F5" + $"BC5DB689BD92B55ABF67B642BE10B4F0C005B465C0E9B481C0B1B3E0C1E1B3DD" + $"C3A7B3ACC2EEB426C4C2B660C581B510C56EB680C583B697C58AB68FC583B74F" + $"C477B90545B815C32CB9FCC041BC10BD70BB07BEB8BC94BCCCBD99BBBBBD18BC" + $"36BE19BB41BF0DBAA0BE96BADFBF49BA82BFBBBA5FBF82BA6BBFF3BA52C05CBA" + $"59C028BA50C090BA6143BA94C0C2BA75C103BA9FC120BAC4C110BAB6C125BAC5" + $"C130BAC7C12ABAC6C0BBB986BFCEB704C043B846BFCDB704BFCBB704BFCDB704" + $"BF95B68BBF27B59ABF5DB613BEC4B4C2BE6BB42BBE78B42EBE6BB42B0207BFCE" + $"B704BFCEB704C063B85EC18FBB10C0F9B9B7C1C2BB1DC2BCBB74C28DBB61C6B9" + $"BBACC6A0B93DCB98BF33C57CB818C29CB70FC42AB761C229B6F9C005B702C0F0" + $"B6F1BFF3B702BFCEB704BFDFB703BFCEB7040207BCA6C6D2BCA6C6D2474ACB64" + $"C69E5149CB91C805CBAECA9DCBABC963CBAFCAFBCBB15ECBB0CB56C5D85EBA29" + $"5EC0015EBA21CB0FBA61C99A32CA68BA97C8CBBCA6C6D2BAF4C858BCA6C6D206" + $"04BFB67CC579B67CC579B7C1C49BB900C2AFB8F9C22FB906C32EB6F5C5CDB841" + $"C6ABB5AA4DB67CC5790211BD5BC297BD5BC297BDC5C279BEE5C244BE49C25EBF" + $"83C22BC0E8C21FC02EC21FC19DC21FC2AAC26CC234C238C323C29CC3C4C33EC3" + $"81C2E1C40BC399C45BC485C43EC405C478C502C487C626C487C58DC487C7BCC4" + $"87CAE7C487C9514ACAE746CAE7C2EFCAE746C96B46C67346C7EF46C5A0C1DDC4" + $"ABC20BC508C1AFC44FC0C2C421C151C421C097C421C040C424C06D4BC018C428" + $"BFBFC434BFEEC42CBFBFC66FBFBFCAE7BFBFC8ACBEF3CAE7BD5BCAE7BE27CAE7" + $"BD5BC821BD5BC297BD5BC55BBD5BC2970211BE27C363BE27C363BE91C345BFB1" + $"C310BF16C32AC050C2F7C1B4C2EBC0FAC2EBC269C2EBC376C338C300C304C3EF" + $"C368C490C40AC44DC3ADC4D7C465C527C551C50AC4D1C544C5CE4EC6F24EC659" + $"4EC8454ECAE74EC9964CCAE748CAE74ACAE748C9C548C77F48C8A148C6B9C2A9" + $"C5D4C2D7C62BC27BC57FC18EC553C21DC553C163C553C10CC557C1394EC0E4C5" + $"5A42C565C0BAC55E42C73A42CAE742C91140CAE73CCAE73ECAE73CC866BE27C3" + $"63BE27C5E4BE27C3630206B669C28FB669C28FB669C25DB613C207B642C21EB5" + $"8645B4F5C338B507C245B4F1C374B4F7C3BEB4F3C3B2B503C3DAB59DC370B507" + $"C3D7B632C309B669C28FB669C2CAB669C28F0207BAE6BC94BAE6BC94BC1EBB5D" + $"BD8EB8BBBD8EB948BD8EB89BBD1AB854BD5AB86DBBF7B7E7B988B975BA7DB85F" + $"B902BA0EB763BDFCB82DBAE5B751BE42B7F5BEBCB6C13FB92ABE1DBAE6BC94B9" + $"EDBD8CBAE6BC940207B9EABBF2B9EABBF2BA4CBB90BABFBABCBABFBAE9BABFBA" + $"B2BA9BBA9CBAAEBAA3BA40BA79B97BBAF7B9C8BA9EB952BB27B85BBCCCB85BBC" + $"B7B85BBCE3B8FCBC9EB89BBCCFB95EBC6CB9EABBF2B99CBC3FB9EABBF2020FC0" + $"E42CC0E42CC0BFB7C942B801C09DB7E0C07BB825C096B86CC080B84DC0ADB889" + $"C0F8B893C0D4B899C2D4B862C515B9BAC413B8E0C617BA94C789BD20C6D6BBD2" + $"C7CFBDA0C8EFC1C5C869BF62C977C428CA19CA85C9F2C73ACA1BCAABCA4FCADD" + $"CA30CACCCA6FCAEDCAB5CAD7CA97CAEBCAD4CAC4CAE5CA7DCAE7CAA1CABDC722" + $"59C19ACA3FC408C92DBF2BC83CBCC0C89FBD76C786BB6DC599B920C6BEBA17C4" + $"73B827C0E42CC2EEB794C0E42C020AC70ABC69C70ABC69C1BB3BC864C462C353" + $"50C8CFC440C982C3CEC930C411C983C3CDC984C3CCC983C3CCC985C3CAC987C3" + $"C7C986C3C9C9D4C384CA37C2CDCA13C32DCA59C272CA1945CA19C220C9B33FC8" + $"5ABC98C9B33DC85ABC98C859BC98C859BC98C7F2BC76C70ABC69C785BC69C70A" + $"BC690220C6E2C242C6E2C242C740C242C7A5C216C782C234C7CCC1F8C7DFC1AB" + $"C7DFC1D6C7DFC141C6C8C10CC782C10CC690C10CC622C10CC659C10CC622C0A1" + $"C622BFC8C622C035C659BFC8C6C8BFC8C690BFC8C705BFC8C75FBFA5C738BFBD" + $"C785BF8DC798BF35C798BF67C798BEE3C6EBBEB9C75FBEB9C6ADBEB9C635BED9" + $"C66FBEC3C5FABEEEC587BF1BC5BFBF03C555BEB4C4F0BDE5C523BE4CC532BDBA" + $"C5E5BD79C584BD98C64ABD5AC709BD4AC6ABBD4AC774BD4AC814BD6CC7CDBD54" + $"C85EBD84C8C6BDCEC89ABDA5C8F1BDF5C922BE5CC911BE24C935BE91C93DBF04" + $"C93DBECAC93DBF3EC916BFA5C931BF73C8FEBFD4C89AC038C8D4C005C8EEC05D" + $"58C0D7C92CC092C975C117C988C1B0C988C160C988C1FAC966C27CC97DC23EC9" + $"4EC2BBC8F1C321C927C2F1C8BCC34DC821C38BC878C370C7CCC3A5C6E7C3B4C7" + $"63C3B4C68DC3B4C5C5C399C62EC3AAC562C384C4D6C348C511C36AC4F5C2D4C5" + $"34C1EAC515C25EC58CC210C616C236C5D7C229C653C23EC6E2C242C698C242C6" + $"E2C2420F0A000100000A010101000A020102000A030103000A040104000A0501" + $"05000A060106000A010107000A000108000A000109000A07010A000A00010B00" + $"0A00010C000A01010D000A00010E00" +}; diff --git a/plugins/.cbcp b/plugins/.cbcp index bd9910a..04a09dc 100755 --- a/plugins/.cbcp +++ b/plugins/.cbcp @@ -9,6 +9,7 @@ # - clip.exe (WSL) # - clip (Cygwin) # - wl-copy (Wayland) +# - clipboard (Haiku) # # Limitation: breaks if a filename has newline in it # @@ -43,4 +44,7 @@ elif which clip >/dev/null 2>&1; then elif which wl-copy >/dev/null 2>&1; then # Wayland tr '\0' '\n' < "$selection" | wl-copy +elif which clipboard >/dev/null 2>&1; then + # Haiku + tr '\0' '\n' < "$selection" | clipboard --stdin fi diff --git a/plugins/.ntfy b/plugins/.ntfy index 590ebbd..3a7f27f 100755 --- a/plugins/.ntfy +++ b/plugins/.ntfy @@ -4,7 +4,7 @@ # # Details: nnn invokes this plugin to show notification when a cp/mv/rm operation is complete. # -# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS) +# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)/notify (Haiku) # # Shell: POSIX compliant # Author: Anna Arad @@ -17,4 +17,6 @@ elif [ "$OS" = "Darwin" ]; then osascript -e 'display notification "Done!" with title "nnn"' elif which ntfy >/dev/null 2>&1; then ntfy -t nnn send "Done!" +elif [ "$OS" = "Haiku" ]; then + notify --title "nnn" "Done!" fi diff --git a/plugins/nuke b/plugins/nuke index 2c47ce0..f2abe65 100755 --- a/plugins/nuke +++ b/plugins/nuke @@ -32,7 +32,7 @@ # 3. Start GUI apps in bg to unblock. Redirect stdout and strerr if required. # 4. Some CLI utilities are piped to the $PAGER, to wait and quit uniformly. # 5. If the output cannot be paged use "read -r _" to wait for user input. -# 6. On a DE, try 'xdg-open' in handle_fallback() as last resort. +# 6. On a DE, try 'xdg-open' or 'open' in handle_fallback() as last resort. # # Feel free to change the utilities to your favourites and add more mimes. # @@ -42,7 +42,7 @@ # rar: list with unrar # 7-zip: list with 7z # pdf: zathura (GUI), pdftotext, mutool, exiftool -# audio: mocplay (nnn plugin using MOC), mpv, mediainfo, exiftool +# audio: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool # avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool # log: vi # torrent: rtorrent, transmission-show @@ -53,7 +53,7 @@ # Multimedia by mime: # image/*: imv/sxiv (GUI), viu (https://github.com/atanunq/viu), img2txt, exiftool # video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool -# audio/*: mocplay (nnn plugin using MOC), mpv, mediainfo, exiftool +# audio/*: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool # application/pdf: zathura (GUI), pdftotext, mutool, exiftool # Other mimes: # text/troff: man -l @@ -107,6 +107,9 @@ handle_audio() { elif which mpv >/dev/null 2>&1; then mpv "${FPATH}" >/dev/null 2>&1 & exit 0 + elif which media_client >/dev/null 2>&1; then + media_client play "${FPATH}" >/dev/null 2>&1 & + exit 0 elif which mediainfo >/dev/null 2>&1; then mediainfo "${FPATH}" | eval "$PAGER" exit 0 @@ -459,9 +462,12 @@ handle_mime() { } handle_fallback() { - if [ "$GUI" -ne 0 ]; then + if [ "$GUI" -ne 0 ] && which xdg-open >/dev/null 2>&1; then xdg-open "${FPATH}" >/dev/null 2>&1 & exit 0 + elif [ "$GUI" -ne 0 ] && which open >/dev/null 2>&1; then + open "${FPATH}" >/dev/null 2>&1 & + exit 0 fi echo '----- File details -----' && file --dereference --brief -- "${FPATH}" diff --git a/plugins/x2sel b/plugins/x2sel index 09ac68f..0a0fcd4 100755 --- a/plugins/x2sel +++ b/plugins/x2sel @@ -9,6 +9,7 @@ # - powershell (WSL) # - cygwim's /dev/clipboard (Cygwin) # - wl-paste (Wayland) +# - clipboard (Haiku) # # Limitation: breaks if a filename has newline in it # @@ -42,6 +43,9 @@ getclip () { elif which wl-paste >/dev/null 2>&1; then # Wayland wl-paste + elif which clipboard >/dev/null 2>&1; then + # Haiku + clipboard --print fi } @@ -4445,7 +4445,11 @@ static void show_help(const char *path) } if (g_state.fortune && getutil("fortune")) +#ifndef __HAIKU__ pipetof("fortune -s", fp); +#else + pipetof("fortune", fp); +#endif start = end = helpstr; while (*end) { |