{"id":67116,"date":"2023-07-28T17:57:03","date_gmt":"2023-07-28T09:57:03","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=67116"},"modified":"2023-07-28T17:57:03","modified_gmt":"2023-07-28T09:57:03","slug":"linux-moc-music","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-moc-music.html","title":{"rendered":"MOC\uff0c\u547d\u4ee4\u884c\u97f3\u4e50\u64ad\u653e\u5668"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nmoc(Music On Console\uff0c\u64ad\u653e\u5668\u7a0b\u5e8f\u662fmocp\uff0c\u5728Arch Linux\u7684Commity\u4e2d\u6709\u4e2atray\u7248\u672c\u7684moc\uff0c\u542f\u52a8\u65f6\u4f1a\u5728\u9762\u677f\u4e0a\u663e\u793a\u4e00\u4e2a\u56fe\u6807\uff0c\u80fd\u76f4\u63a5\u542f\u52a8mocp\u670d\u52a1\u548c\u64ad\u653e\u5668\u3002\u751a\u81f3\u8fd8\u80fd\u8ba9osdlyrics\u52a0\u8f7d\u684c\u9762\u6b4c\u8bcd\uff0c\u4e0d\u8fc7\u8fd9\u5f88\u5361.)<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u9002\u7528\u4e8e\u547d\u4ee4\u884c\uff0c\u5728\u9ed1\u4e4e\u4e4e\u7684Linux\u6838\u5fc3\u63a7\u5236\u53f0(\u5b57\u7b26\u754c\u9762)\u4e0a\u4e5f\u80fd\u6210\u529f\u542f\u52a8\u548c\u64ad\u653e\uff0c\u4f46Linux\u6838\u5fc3\u63a7\u5236\u53f0\u9ed8\u8ba4\u662f\u6ca1\u6709\u4e2d\u6587\u652f\u6301\u7684\uff0c\u53ef\u4ee5\u8bd5\u8bd5\u80fd\u663e\u793a\u4e2d\u6587\u7684fbterm(\u76f4\u63a5\u4ece\u6838\u5fc3\u63a7\u5236\u53f0\u542f\u52a8\uff0c\u4e0d\u9700\u8981\u8fd0\u884cX\u670d\u52a1)\u5982\u679c\u9700\u8981\u7684\u8bdd\u3002\u5373\u4fbf\u5982\u6b64\uff0c\u6b63\u5e38\u4f7f\u7528\u4ecd\u7136\u9700\u8981\u4e00\u756a\u624b\u52a8\u914d\u7f6e\u624d\u884c\uff0c\u5982\u679c\u5168\u662f\u82f1\u6587\u6b4c\u66f2\u7684\u8bdd\u4f8b\u5916\u3002<\/p>\n

\"\"<\/p>\n

\u57fa\u672c\u4e0a\u5f88\u591a\u7684Linux\u53d1\u884c\u7684\u5b98\u65b9\u6e90\u4e2d\u5df2\u7ecf\u5305\u542b\u4e86\u8fd9\u4e2a\u8f6f\u4ef6\u5305\uff0c\u76f4\u63a5\u4f7f\u7528\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u3002Arch Linux\u7684\u662fpacman\u3002<\/p>\n

\u6ce8\uff1a<\/strong>\u542f\u52a8mocp\u4e4b\u524d,\u5982\u679c\u9700\u8981\u542f\u7528\u66f4\u591a\u7684\u97f3\u9891\u683c\u5f0f\u652f\u6301\uff0c\u6709\u5fc5\u8981\u4ece\u6e90\u4e0a\u5b89\u88c5\u89e3\u7801\u5668<\/p>\n

mocp\u914d\u7f6e<\/strong><\/div>\n

\u5728\u914d\u7f6emocp\u4e4b\u524d\uff0c\u53ef\u4ee5\u5148\u4ecemoc\u7684man\u624b\u518c\u9875\u6216\u8005info\u9875\u83b7\u53d6\u66f4\u591a\u7684\u4fe1\u606f(\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\u662f\u4ec0\u4e48,\u5e94\u8be5\u653e\u5230\u4ec0\u4e48\u4f4d\u7f6e\uff0c\u683c\u5f0f\u5e94\u8be5\u662f\u4ec0\u4e48\u6837\u7684......)<\/p>\n

$ mocp --help\r\n$ man mocp\r\n$ info mocp\r\n<\/pre>\n

\u6ce8\uff1a<\/strong>moc\u7684aur\u7248\u672c\u5141\u8bb8mocp\u52a0\u8f7d\u6b4c\u8bcd(\u4f46\u4ec5\u9650\u67d0\u4e9butf-8\u7f16\u7801\u7684ascii\u6587\u672c(\u7eaf\u82f1\u6587)),\u8fd9\u4e2a\u7248\u672c\u4f1a\u548c\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u7684\u51b2\u7a81.<\/p>\n

\u867d\u7136osdlyrics\u7406\u8bba\u4e0a\u4e5f\u652f\u6301moc\uff0c\u7136\u800c\u4ec5\u4ec5\u53ea\u662f\u5b89\u88c5moc\u7136\u540e\u6253\u5f00mocp\u518d\u6253\u5f00osdlyrics\u5e76\u4e0d\u4f1a\u52a0\u8f7d\u97f3\u9891\u6587\u4ef6\u7684lyrics\u7684(\u5c3d\u7ba1\u8fd9\u4e5f\u4e0d\u4f1a\u5bfc\u81f4osdlyrics\u9000\u51fa)<\/p>\n

\u8981\u8ba9osdlyrics\u771f\u6b63\u652f\u6301moc,\u8fd8\u8981\u5b89\u88c5moc-tray\u8fd9\u4e2a\u4efb\u52a1\u680f\u5c0f\u7a0b\u5e8f\u5e76\u5728\u542f\u52a8osdlyrics\u4e4b\u524d\u542f\u52a8mocp\u548cmoc-tray.<\/p>\n

moc-tray\u53ef\u4ee5\u76f4\u63a5\u542f\u52a8mocp\u5e76\u4e14\u652f\u6301\u505c\u6b62\/\u64ad\u653e\/\u6682\u505c\/\u9000\u51fa\uff0c\u4e0b\u4e00\u9996\/\u4e0a\u4e00\u9996\u7b49\u52a8\u4f5c,\u4e0d\u8fc7\u67d0\u4e9b\u52a8\u4f5c\u9700\u8981\u5728mocp\u4e2d\u914d\u7f6e\u64ad\u653e\u5217\u8868\u624d\u80fd\u5f97\u5230\u6b63\u786e\u54cd\u5e94\u3002<\/p>\n

aur\u4e0a\u7684moc\u6784\u5efa\u548c\u5b89\u88c5:<\/strong><\/span><\/div>\n

\u4e0b\u8f7dPKGBUILD\u7b49makepkg\u9700\u8981\u7684\u811a\u672c.<\/p>\n

$ git clone https:\/\/aur.archlinux.org\/moc-lyrics-git.git\r\n$ pushd mocp-lyrics-git\r\n$ makepkg -sr\r\n<\/pre>\n

\u7f16\u8bd1\u6210\u529f\u4e4b\u540e\u4f1a\u4ea7\u751f\u4e00\u4e2a.pkg.tar.xz\u5305\uff0c\u7136\u540e\u4f7f\u7528pacman -U\u5b89\u88c5<\/p>\n

$ mv moc-lyrics-git-1\\:0.2213.c51e02e-1-x86_64.pkg.tar.xz moc-lyrics-git-x86_64.pkg.tar.xz\r\n# pacman -U moc-lyrics-git-x86_64.pkg.tar.xz\r\n<\/pre>\n

\u62f7\u8d1dmocp\u793a\u4f8b\u914d\u7f6e\u6587\u4ef6\u5230~\/.moc(\u6ca1\u6709\u5c31\u521b\u5efa),\u53c2\u6570\u914d\u7f6e\u53ef\u4ee5\u4ece\u793a\u4f8b\u6587\u4ef6config.example(\u53ef\u4ee5\u8fd0\u884clocate config.example)\u4e2d\u627e\u5230<\/p>\n

mocp\u7684\u793a\u4f8b\u914d\u7f6e\u6587\u4ef6\u5c3d\u7ba1\u4f7f\u7528\u4e86\u82f1\u6587\uff0c\u4f46\u89e3\u91ca\u7684\u5f88\u8be6\u7ec6.<\/p>\n

$ mkdir ~\/.moc\r\n$ cp `locate config.example` ~\/.moc\/config\r\n<\/pre>\n

\u4e0b\u9762\u8fd9\u662f\u4ece\u5b9e\u4f8b\u914d\u7f6e\u6587\u4ef6\u62f7\u8fc7\u6765\u7684\uff0c\u4ee5#\u53f7\u5f00\u59cb\u7684\u90fd\u662f\u6ce8\u91ca(\u5c3d\u7ba1\u6ce8\u91ca\u770b\u8d77\u6765\u663e\u5f97\u6666\u6da9\u96be\u61c2\uff0c\u4f46\u4f5c\u8005\u89e3\u91ca\u7684\u5f88\u6e05\u695a)\u3002<\/p>\n

~\/.moc\/config\r\n\r\n# This is a configuration file for the MOC player. It should be named\r\n# 'config' and placed in the ~\/.moc directory. As this file can specify\r\n# commands which invoke other applications, MOC will refuse to start if it\r\n# is not owned by either root or the current user, or if it is writable by\r\n# anyone other than its owner. All options are given with their default\r\n# values, and therefore commented.\r\n# Comments begin with '#'.\r\n# You can use quotes and escape ('\\') in parameters.\r\n#\r\n# You can have variable values substituted by enclosing the variable name\r\n# as \"${...}\". (This only applies to the portion of the option following\r\n# the '='.) Variables are substituted first from the environment then,\r\n# if not found, from the configuration options. (Note that the value of\r\n# a configuration option substituted is that which it has at the time the\r\n# substitution variable is encountered.) If there is a naming conflict\r\n# between an environment and configuration variable, you may be able to\r\n# resolve it by using lowercase as the environment variable matches are\r\n# case-sensitive whereas the configuration variables are not.\r\n#\r\n# You can also use the form \"${...:-...}\" where the value in the second\r\n# position will be substituted if the variable name given in the first\r\n# position is unset or null.\r\n#\r\n# So, for example:\r\n#\r\n# MusicDir = \/music\/${USER:-public}\r\n# Fastdir1 = ${MusicDir}\/mp3\/rock\r\n# Fastdir2 = ${MusicDir}\/mp3\/electronic\r\n# Fastdir3 = ${MusicDir}\/mp3\/rap\r\n# Fastdir4 = ${MusicDir}\/mp3\/etc\r\n#\r\n\u2026\u2026\r\n\u2026\u2026\r\n\u2026\u2026\r\n<\/pre>\n
mocp\u952e\u76d8\u6620\u5c04\u914d\u7f6e<\/strong><\/div>\n

mocp\u952e\u76d8\u6620\u5c04\u81ea\u5b9a\u4e49,\u793a\u4f8b\u952e\u76d8\u6620\u5c04\u53ef\u4ee5\u4ece$prefix\/share\/moc\/keymap.example\u627e\u5230<\/p>\n

$ vim ~\/.moc\/keymap\r\nmenu_up            = k UP\r\nmenu_down        = j DOWN\r\nmenu_page_up            = ^b PAGE_UP\r\nmenu_page_down        = ^d PAGE_DOWN\r\nmenu_first_item        = M-b HOME\r\nmenu_last_item        = M-d END\r\n<\/pre>\n
mocp\u4e3b\u9898<\/strong><\/div>\n

mocp\u4e3b\u9898\u9ed8\u8ba4\u5b89\u88c5\u5230$prefix\/share\/moc\/themes\u76ee\u5f55\u4e0b,\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4e3b\u9898\u53ea\u5bf9\u7528\u6237\u751f\u6548(\u653e\u5230~\/.moc\/themes\u76ee\u5f55\u4e0b).<\/p>\n

mocp\u542f\u52a8\u65f6\u6307\u5b9a\u7684\u4e3b\u9898\u6216\u8005\u5728\u7528\u6237\u7ea7\u914d\u7f6e\u6587\u4ef6~\/.moc\/config\u4e2d\u6307\u5b9a\u7684\u4e3b\u9898\u53ef\u4ee5\u81ea\u52a8\u4ece$prefix\/share\/moc\/themes\u548c~\/.moc\/themes\u4e2d\u8bfb\u53d6.(\u6ca1\u6709\u5c31\u8981\u5728~\/.moc\/config\u7684Theme \u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u6765\u6307\u5b9a)<\/p>\n

\u521b\u5efa~\/.moc\/themes\u76ee\u5f55<\/p>\n

$ mkdir -pv ~\/.moc\/themes\r\n$ cp \/usr\/share\/moc\/themes\/moca_theme ~\/.moc\/themes\/user_moca_theme \r\n\r\n~\/.moc\/themes\/ user_moca_theme \r\n\r\nbackground        = white    default bold\r\nframe            = white    default bold\r\nwindow_title        = yellow    default    bold\r\ndirectory        = white        default\r\nselected_directory    = white        default bold\r\nplaylist        = white default\r\nselected_playlist    = cyan        default    bold\r\nfile            = green default bold\r\n#selected_file        = yellow    red    bold\r\nselected_file        = white black bold\r\n\u2026\u2026.\r\nmocp User themes\r\n<\/pre>\n

\u8fd9\u662f\u6211\u7684moc\u6700\u7ec8\u7684\u6837\u5b50\uff1a<\/p>\n

\"\"<\/p>\n

fbterm\u663e\u793a\u51fa\u6765\u4e5f\u662f\u8fd9\u4e2a\u6837\u5b50\u7684\uff0c\u4e0d\u8fc7\u684c\u9762\u6b4c\u8bcd\u5c31\u6ca1\u6709\u4e86\u3002<\/p>\n

\u6ce8\uff1a<\/strong>\u5728fbterm\u4e2d\u5c06TERM\u53d8\u91cf\u4e00\u76f4\u8bbe\u4e3afbterm\u65f6\u4f1a\u8ba9\u4e00\u4e9b\u57fa\u4e8encursers\u5e93\u7684\u547d\u4ee4\u884c\u7a0b\u5e8f\u754c\u9762(\u6bd4\u5982mc\u548calsamixer,mocp)\u53d8\u5f97\u4e71\u4e03\u516b\u7cdf\u3002\u800c\u53ea\u6709\u5728\u5c06TERM\u53d8\u91cf\u503c\u8bbe\u7f6e\u4e3afbterm\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u8ba9vim\u5728fbterm\u4e0a\u652f\u6301\u66f4\u591a\u7684\u989c\u8272\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.linuxidc.com\/Linux\/2017-05\/143552.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-moc-music.html<\/a>\u7f16\u8f91\uff1a\u82cf\u897f\u4e91\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb moc(Music On Console\uff0c\u64ad\u653e\u5668\u7a0b\u5e8f\u662fmocp\uff0c\u5728Arch Linux\u7684Commity\u4e2d […]<\/p>\n","protected":false},"author":63,"featured_media":67130,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-67116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/67116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=67116"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/67116\/revisions"}],"predecessor-version":[{"id":67156,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/67116\/revisions\/67156"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/67130"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=67116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=67116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=67116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}