Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bluetui for openSUSE:Factory checked 
in at 2024-07-30 11:54:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bluetui (Old)
 and      /work/SRC/openSUSE:Factory/.bluetui.new.1882 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bluetui"

Tue Jul 30 11:54:57 2024 rev:3 rq:1190339 version:0.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/bluetui/bluetui.changes  2024-07-12 
17:05:05.821119195 +0200
+++ /work/SRC/openSUSE:Factory/.bluetui.new.1882/bluetui.changes        
2024-07-30 11:56:53.279395073 +0200
@@ -1,0 +2,7 @@
+Mon Jul 29 20:23:45 UTC 2024 - Muhammad Akbar Yanuar Mantari <mantari...@pm.me>
+
+- Update to version 0.5.1
+  * Detect when the device is soft/hard blocked
+  * Add 'q' to quit
+
+-------------------------------------------------------------------

Old:
----
  bluetui-0.5.tar.gz

New:
----
  bluetui-0.5.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bluetui.spec ++++++
--- /var/tmp/diff_new_pack.1WyYOE/_old  2024-07-30 11:56:54.627449594 +0200
+++ /var/tmp/diff_new_pack.1WyYOE/_new  2024-07-30 11:56:54.643450241 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           bluetui
-Version:        0.5
+Version:        0.5.1
 Release:        0
 Summary:        TUI for managing bluetooth devices
 License:        GPL-3.0-or-later

++++++ bluetui-0.5.tar.gz -> bluetui-0.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/Cargo.lock new/bluetui-0.5.1/Cargo.lock
--- old/bluetui-0.5/Cargo.lock  2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/Cargo.lock        2024-07-29 20:50:43.000000000 +0200
@@ -37,9 +37,9 @@
 
 [[package]]
 name = "anstream"
-version = "0.6.14"
+version = "0.6.15"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
+checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
 dependencies = [
  "anstyle",
  "anstyle-parse",
@@ -52,33 +52,33 @@
 
 [[package]]
 name = "anstyle"
-version = "1.0.7"
+version = "1.0.8"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
+checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
 
 [[package]]
 name = "anstyle-parse"
-version = "0.2.4"
+version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
+checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
 dependencies = [
  "utf8parse",
 ]
 
 [[package]]
 name = "anstyle-query"
-version = "1.1.0"
+version = "1.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
+checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
 dependencies = [
  "windows-sys 0.52.0",
 ]
 
 [[package]]
 name = "anstyle-wincon"
-version = "3.0.3"
+version = "3.0.4"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
+checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
 dependencies = [
  "anstyle",
  "windows-sys 0.52.0",
@@ -125,9 +125,9 @@
 
 [[package]]
 name = "bluer"
-version = "0.17.2"
+version = "0.17.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "204d6580f8238447c5d4d6a338f82b573375dae7bf992fec7347a44240a7e6d8"
+checksum = "e9ef6a5cd82c14b67cb3ac18d6dc6d76e1a48e40afe7e4263a9e3a19a7ed4ffb"
 dependencies = [
  "custom_debug",
  "dbus",
@@ -140,7 +140,7 @@
  "libc",
  "log",
  "macaddr",
- "nix 0.29.0",
+ "nix",
  "num-derive",
  "num-traits",
  "pin-project",
@@ -154,7 +154,7 @@
 
 [[package]]
 name = "bluetui"
-version = "0.5.0"
+version = "0.5.1"
 dependencies = [
  "async-channel",
  "bluer",
@@ -172,9 +172,9 @@
 
 [[package]]
 name = "bytes"
-version = "1.6.0"
+version = "1.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
 
 [[package]]
 name = "cassowary"
@@ -193,9 +193,9 @@
 
 [[package]]
 name = "cc"
-version = "1.1.0"
+version = "1.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8"
+checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
 
 [[package]]
 name = "cfg-if"
@@ -205,21 +205,15 @@
 
 [[package]]
 name = "cfg_aliases"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
-
-[[package]]
-name = "cfg_aliases"
 version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
 
 [[package]]
 name = "clap"
-version = "4.5.9"
+version = "4.5.11"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462"
+checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -227,9 +221,9 @@
 
 [[package]]
 name = "clap_builder"
-version = "4.5.9"
+version = "4.5.11"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942"
+checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa"
 dependencies = [
  "anstream",
  "anstyle",
@@ -239,9 +233,9 @@
 
 [[package]]
 name = "clap_derive"
-version = "4.5.8"
+version = "4.5.11"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
+checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e"
 dependencies = [
  "heck",
  "proc-macro2",
@@ -251,15 +245,15 @@
 
 [[package]]
 name = "clap_lex"
-version = "0.7.1"
+version = "0.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
+checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
 
 [[package]]
 name = "colorchoice"
-version = "1.0.1"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
+checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
 
 [[package]]
 name = "compact_str"
@@ -305,7 +299,7 @@
  "crossterm_winapi",
  "futures-core",
  "libc",
- "mio",
+ "mio 0.8.11",
  "parking_lot",
  "signal-hook",
  "signal-hook-mio",
@@ -635,9 +629,9 @@
 
 [[package]]
 name = "is_terminal_polyfill"
-version = "1.70.0"
+version = "1.70.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
 
 [[package]]
 name = "itertools"
@@ -753,15 +747,15 @@
 ]
 
 [[package]]
-name = "nix"
-version = "0.28.0"
+name = "mio"
+version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4"
+checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
 dependencies = [
- "bitflags",
- "cfg-if",
- "cfg_aliases 0.1.1",
+ "hermit-abi",
  "libc",
+ "wasi",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -772,7 +766,7 @@
 dependencies = [
  "bitflags",
  "cfg-if",
- "cfg_aliases 0.2.1",
+ "cfg_aliases",
  "libc",
 ]
 
@@ -797,20 +791,10 @@
 ]
 
 [[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
 name = "object"
-version = "0.36.1"
+version = "0.36.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
+checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
 dependencies = [
  "memchr",
 ]
@@ -941,9 +925,9 @@
 
 [[package]]
 name = "redox_syscall"
-version = "0.5.2"
+version = "0.5.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
+checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
 dependencies = [
  "bitflags",
 ]
@@ -1005,20 +989,21 @@
 
 [[package]]
 name = "serde_json"
-version = "1.0.120"
+version = "1.0.121"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
+checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
 dependencies = [
  "itoa",
+ "memchr",
  "ryu",
  "serde",
 ]
 
 [[package]]
 name = "serde_spanned"
-version = "0.6.6"
+version = "0.6.7"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
+checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
 dependencies = [
  "serde",
 ]
@@ -1035,12 +1020,12 @@
 
 [[package]]
 name = "signal-hook-mio"
-version = "0.2.3"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af"
+checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
 dependencies = [
  "libc",
- "mio",
+ "mio 0.8.11",
  "signal-hook",
 ]
 
@@ -1124,9 +1109,9 @@
 
 [[package]]
 name = "syn"
-version = "2.0.70"
+version = "2.0.72"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16"
+checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1158,18 +1143,18 @@
 
 [[package]]
 name = "thiserror"
-version = "1.0.61"
+version = "1.0.63"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
+checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.61"
+version = "1.0.63"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
+checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1178,28 +1163,27 @@
 
 [[package]]
 name = "tokio"
-version = "1.38.0"
+version = "1.39.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
+checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
 dependencies = [
  "backtrace",
  "bytes",
  "libc",
- "mio",
- "num_cpus",
+ "mio 1.0.1",
  "parking_lot",
  "pin-project-lite",
  "signal-hook-registry",
  "socket2",
  "tokio-macros",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
 name = "tokio-macros"
-version = "2.3.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
+checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1219,9 +1203,9 @@
 
 [[package]]
 name = "toml"
-version = "0.8.14"
+version = "0.8.16"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
+checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c"
 dependencies = [
  "serde",
  "serde_spanned",
@@ -1231,18 +1215,18 @@
 
 [[package]]
 name = "toml_datetime"
-version = "0.6.6"
+version = "0.6.7"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
+checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db"
 dependencies = [
  "serde",
 ]
 
 [[package]]
 name = "toml_edit"
-version = "0.22.15"
+version = "0.22.17"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1"
+checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16"
 dependencies = [
  "indexmap",
  "serde",
@@ -1308,9 +1292,9 @@
 
 [[package]]
 name = "version_check"
-version = "0.9.4"
+version = "0.9.5"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
 
 [[package]]
 name = "wasi"
@@ -1481,20 +1465,20 @@
 
 [[package]]
 name = "winnow"
-version = "0.6.13"
+version = "0.6.16"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
+checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c"
 dependencies = [
  "memchr",
 ]
 
 [[package]]
 name = "xterm-query"
-version = "0.4.0"
+version = "0.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2f29504d0a2ca8c1714781c1395a8a660d2557b2cf9c9669433153fc903e9bfc"
+checksum = "0ad8964f04823efe0096d7829f6d93f9cb4f88713d07d514486296dd8b9d2194"
 dependencies = [
- "nix 0.28.0",
+ "nix",
  "thiserror",
 ]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/Cargo.toml new/bluetui-0.5.1/Cargo.toml
--- old/bluetui-0.5/Cargo.toml  2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/Cargo.toml        2024-07-29 20:50:43.000000000 +0200
@@ -1,6 +1,6 @@
 [package]
 name = "bluetui"
-version = "0.5.0"
+version = "0.5.1"
 authors = ["Badr Badri <cont...@pythops.com>"]
 license = "GPL-3.0"
 edition = "2021"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/Readme.md new/bluetui-0.5.1/Readme.md
--- old/bluetui-0.5/Readme.md   2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/Readme.md 2024-07-29 20:50:43.000000000 +0200
@@ -61,7 +61,7 @@
 
 `esc`: Dismiss the help pop-up.
 
-`ctrl+c`: Quit the app.
+`ctrl+c` or `q`: Quit the app.
 
 ### Adapters
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/Release.md new/bluetui-0.5.1/Release.md
--- old/bluetui-0.5/Release.md  2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/Release.md        2024-07-29 20:50:43.000000000 +0200
@@ -1,3 +1,10 @@
+## v0.5.1 - 29/07/2024
+
+### Added
+
+- Detect when the device is soft/hard blocked
+- Add `q` to quit
+
 ## v0.5 - 11/07/2024
 
 ### Added
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/src/handler.rs 
new/bluetui-0.5.1/src/handler.rs
--- old/bluetui-0.5/src/handler.rs      2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/src/handler.rs    2024-07-29 20:50:43.000000000 +0200
@@ -65,6 +65,10 @@
                     }
                 }
 
+                KeyCode::Char('q') => {
+                    app.quit();
+                }
+
                 // Show help
                 KeyCode::Char('?') => {
                     app.focused_block = FocusedBlock::Help;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/src/help.rs new/bluetui-0.5.1/src/help.rs
--- old/bluetui-0.5/src/help.rs 2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/src/help.rs       2024-07-29 20:50:43.000000000 +0200
@@ -44,7 +44,7 @@
                     "Start/Stop scanning",
                 ),
                 (Cell::from("?").bold(), "Show help"),
-                (Cell::from("ctrl+c").bold(), "Quit"),
+                (Cell::from("ctrl+c or q").bold(), "Quit"),
                 (Cell::from(""), ""),
                 (
                     Cell::from("## 
Adapters").style(Style::new().bold().fg(Color::Yellow)),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/src/lib.rs new/bluetui-0.5.1/src/lib.rs
--- old/bluetui-0.5/src/lib.rs  2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/src/lib.rs        2024-07-29 20:50:43.000000000 +0200
@@ -17,3 +17,5 @@
 pub mod help;
 
 pub mod config;
+
+pub mod rfkill;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/src/main.rs new/bluetui-0.5.1/src/main.rs
--- old/bluetui-0.5/src/main.rs 2024-07-11 12:23:42.000000000 +0200
+++ new/bluetui-0.5.1/src/main.rs       2024-07-29 20:50:43.000000000 +0200
@@ -2,6 +2,7 @@
 use bluetui::config::Config;
 use bluetui::event::{Event, EventHandler};
 use bluetui::handler::handle_key_events;
+use bluetui::rfkill;
 use bluetui::tui::Tui;
 use clap::{crate_version, Command};
 use ratatui::backend::CrosstermBackend;
@@ -15,6 +16,8 @@
         .version(crate_version!())
         .get_matches();
 
+    rfkill::check()?;
+
     let config = Arc::new(Config::new());
     let mut app = App::new(config.clone()).await?;
     let backend = CrosstermBackend::new(io::stderr());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluetui-0.5/src/rfkill.rs 
new/bluetui-0.5.1/src/rfkill.rs
--- old/bluetui-0.5/src/rfkill.rs       1970-01-01 01:00:00.000000000 +0100
+++ new/bluetui-0.5.1/src/rfkill.rs     2024-07-29 20:50:43.000000000 +0200
@@ -0,0 +1,42 @@
+use std::fs;
+
+use crate::app::AppResult;
+
+pub fn check() -> AppResult<()> {
+    let entries = fs::read_dir("/sys/class/rfkill/")?;
+
+    for entry in entries {
+        let entry = entry?;
+        let entry_path = entry.path();
+
+        if let Some(_file_name) = entry_path.file_name() {
+            let name = fs::read_to_string(entry_path.join("type"))?;
+
+            if name.trim() == "bluetooth" {
+                let state_path = entry_path.join("state");
+                let state = 
fs::read_to_string(state_path)?.trim().parse::<u8>()?;
+
+                // 
https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-rfkill
+                match state {
+                    0 => {
+                        eprintln!(
+                            r#"
+The bluetooth device is soft blocked
+Run the following command to unblock it
+$ sudo rfkill unblock bluetooth
+                    "#
+                        );
+                        std::process::exit(1);
+                    }
+                    2 => {
+                        eprintln!("The bluetooth device is hard blocked");
+                        std::process::exit(1);
+                    }
+                    _ => {}
+                }
+                break;
+            }
+        }
+    }
+    Ok(())
+}

Reply via email to